Skip to content

Commit

Permalink
frontend: add hideamount toggle for ln screens
Browse files Browse the repository at this point in the history
  • Loading branch information
shonsirsha committed Mar 6, 2024
1 parent 8d0ba96 commit 1448032
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
2 changes: 1 addition & 1 deletion frontends/web/src/components/qrcode/qrcode.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}

.copiedText {
margin-top: 16px;
margin-top: 16px !important;
transition: opacity 250ms;
}

Expand Down
6 changes: 3 additions & 3 deletions frontends/web/src/components/qrcode/qrcode.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ const TapToCopyQRCode = ({ data, qrCodeData, size }: TTapToCopyQRCodeProps) => {


return (
<div onClick={handleCopy}>
<>
<input className={style.hiddenInput} ref={inputRef} value={data} readOnly/>
<div style={{ width: size, height: size }} className={style.outerContainer}>
<img className={`${style.qrCodeContainer} ${success ? style.hide : style.show}`} width={size} height={size} src={qrCodeData} />
<img onClick={handleCopy} className={`${style.qrCodeContainer} ${success ? style.hide : style.show}`} width={size} height={size} src={qrCodeData} />
<div className={`${style.checkContainer} ${style.show}`}>
<Check width={size / 2} height={size / 2} />
</div>
</div>
<p className={`${style.copiedText} ${success ? style.show : style.hide}`}>{t('receive.qrCodeCopiedMessage')}</p>
</div>
</>
);
};
5 changes: 4 additions & 1 deletion frontends/web/src/routes/lightning/lightning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { LightningGuide } from './guide';
import { Payments } from './components/payments';
import { unsubscribe } from '../../utils/subscriptions';
import { Status } from '../../components/status/status';
import { HideAmountsButton } from '../../components/hideamountsbutton/hideamountsbutton';

export function Lightning() {
const { t } = useTranslation();
Expand Down Expand Up @@ -97,7 +98,9 @@ export function Lightning() {
<span>{t('lightning.accountLabel')}</span>
</h2>
}
></Header>
>
<HideAmountsButton />
</Header>
<div className="innerContainer scrollableContainer">
<div className="content padded">
<div className="flex flex-column flex-reverse-mobile">
Expand Down
6 changes: 3 additions & 3 deletions frontends/web/src/routes/lightning/receive/receive.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export function Receive() {
<Grid col="1">
<Column>
<h1 className={styles.title}>{t('lightning.receive.subtitle')}</h1>
<span>{t('lightning.receive.amountSats.label')} ({<FiatConversion amount={invoiceAmount} noBtcZeroes />})</span>
<span>{t('lightning.receive.amountSats.label')} ({<FiatConversion alwaysShowAmounts amount={invoiceAmount} noBtcZeroes />})</span>
<Input
type="number"
min="0"
Expand Down Expand Up @@ -206,7 +206,7 @@ export function Receive() {
<QRCode data={receivePaymentResponse?.lnInvoice.bolt11} />
</div>
<div className={styles.invoiceSummary}>
{inputSatsText} sats (<FiatConversion amount={invoiceAmount} noBtcZeroes />)
{inputSatsText} sats (<FiatConversion alwaysShowAmounts amount={invoiceAmount} noBtcZeroes />)
{description && ` / ${description}`}
</div>
<ColumnButtons>
Expand All @@ -233,7 +233,7 @@ export function Receive() {
<View fitContent textCenter verticallyCentered>
<ViewContent withIcon="success">
<p>{t('lightning.receive.success.message')}</p>
<span>{inputSatsText} sats (<FiatConversion amount={invoiceAmount} noBtcZeroes />)</span>
<span>{inputSatsText} sats (<FiatConversion alwaysShowAmounts amount={invoiceAmount} noBtcZeroes />)</span>
<br />
{description && ` / ${description}`}
</ViewContent>
Expand Down

0 comments on commit 1448032

Please sign in to comment.