Skip to content

Commit 16da507

Browse files
axelvyrnhuumn
andauthored
Lnurl UI update (#2220)
* Update index.js added info tooltip for LNURL-auth button * Update index.js * Update index.js * Update index.js * Update index.js * Update index.js * Update index.js * use existing lightning explainer --------- Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com> Co-authored-by: k00b <k00b@stacker.news>
1 parent 8309674 commit 16da507

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

components/lightning-auth.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,18 @@ function QrAuth ({ k1, encodedUrl, callbackUrl, multiAuth }) {
4545
)
4646
}
4747

48-
function LightningExplainer ({ text, children }) {
48+
function LightningExplainer ({ text, children, backButton, md = 12, lg = 6 }) {
4949
const router = useRouter()
5050
return (
5151
<Container>
5252
<div className={styles.login}>
53-
<div className='w-100 mb-3 text-muted pointer' onClick={() => router.back()}><BackIcon /></div>
53+
{backButton && <div className='w-100 mb-3 text-muted pointer' onClick={() => router.back()}><BackIcon /></div>}
5454
<h3 className='w-100 pb-2'>
5555
{text || 'Login'} with Lightning
5656
</h3>
5757
<div className='fw-bold text-muted pb-4'>This is the most private way to use Stacker News. Just open your Lightning wallet and scan the QR code.</div>
5858
<Row className='w-100 text-muted'>
59-
<Col className='ps-0 mb-4' md>
59+
<Col className='ps-0 mb-4' md={md} lg={lg}>
6060
<AccordianItem
6161
header={`Which wallets can I use to ${(text || 'Login').toLowerCase()}?`}
6262
body={
@@ -92,7 +92,7 @@ function LightningExplainer ({ text, children }) {
9292
}
9393
/>
9494
</Col>
95-
<Col md className='mx-auto' style={{ maxWidth: '300px' }}>
95+
<Col md={md} lg={lg} className='mx-auto' style={{ maxWidth: '300px' }}>
9696
{children}
9797
</Col>
9898
</Row>
@@ -101,9 +101,9 @@ function LightningExplainer ({ text, children }) {
101101
)
102102
}
103103

104-
export function LightningAuthWithExplainer ({ text, callbackUrl, multiAuth }) {
104+
export function LightningAuthWithExplainer ({ text, callbackUrl, multiAuth, backButton = true, md = 12, lg = 6 }) {
105105
return (
106-
<LightningExplainer text={text}>
106+
<LightningExplainer text={text} backButton={backButton} md={md} lg={lg}>
107107
<LightningAuth callbackUrl={callbackUrl} multiAuth={multiAuth} />
108108
</LightningExplainer>
109109
)

pages/settings/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { gql, useMutation, useQuery } from '@apollo/client'
99
import { getGetServerSideProps } from '@/api/ssrApollo'
1010
import LoginButton from '@/components/login-button'
1111
import { signIn } from 'next-auth/react'
12-
import { LightningAuth } from '@/components/lightning-auth'
12+
import { LightningAuthWithExplainer } from '@/components/lightning-auth'
1313
import { SETTINGS, SET_SETTINGS } from '@/fragments/users'
1414
import { useRouter } from 'next/router'
1515
import Info from '@/components/info'
@@ -706,7 +706,7 @@ function QRLinkButton ({ provider, unlink, status }) {
706706
? unlink
707707
: () => showModal(onClose =>
708708
<div className='d-flex flex-column align-items-center'>
709-
<LightningAuth />
709+
<LightningAuthWithExplainer backButton={false} md={12} lg={12} />
710710
</div>)
711711

712712
return (

0 commit comments

Comments
 (0)