-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deemphasise additional bond when one already exists #758
Changes from 2 commits
ad55c63
e546ad0
628a89e
5a0c9b9
e70edf6
13bf606
d1ca7fc
15c84ff
4def6d4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -617,7 +617,7 @@ const CreateFidelityBond = ({ otherFidelityBondExists, wallet, walletInfo, onDon | |
} | ||
|
||
return ( | ||
<div className={styles.container}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes the code changes will make this issue. I kinda knew it. But If I try to fix then <rb.collapse> section will have to be repeated twice for both the cases ( active bond exists and no active bond). This will just increase the code length. |
||
<div> | ||
{alert && <Alert {...alert} className="mt-0" onClose={() => setAlert(undefined)} />} | ||
{lockDate && timelockedAddress && selectedJar !== undefined && ( | ||
<PaymentConfirmModal | ||
|
@@ -645,34 +645,42 @@ const CreateFidelityBond = ({ otherFidelityBondExists, wallet, walletInfo, onDon | |
</PaymentConfirmModal> | ||
)} | ||
|
||
<div className={styles.header} onClick={() => setIsExpanded(!isExpanded)}> | ||
<div className="d-flex justify-content-between align-items-center"> | ||
<div className={styles.title}> | ||
{otherFidelityBondExists | ||
? t('earn.fidelity_bond.title_fidelity_bond_exists') | ||
: t('earn.fidelity_bond.title')} | ||
</div> | ||
<Sprite symbol={isExpanded ? 'caret-up' : 'plus'} width="20" height="20" /> | ||
</div> | ||
<div className={styles.subtitle}> | ||
{otherFidelityBondExists ? ( | ||
<Trans i18nKey="earn.fidelity_bond.subtitle_fidelity_bond_exists"> | ||
<a | ||
onClick={(e) => e.stopPropagation()} | ||
{otherFidelityBondExists ? ( | ||
<div className={styles.containerWhenBondAlreadyExists}> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it can be achieved without (or with less) new css classes: <div className="d-flex justify-content-end">
<rb.Button size="sm" variant="outline-dark" onClick={() => setIsExpanded(it => !it)}>
<div className="d-flex justify-content-center align-items-center">
{t('earn.fidelity_bond.title_fidelity_bond_exists')}
<Sprite className="ms-1" symbol={isExpanded ? 'caret-up' : 'plus'} width="16" height="16" />
</div>
</rb.Button>
</div> What do you think? |
||
<div className={styles.headerWhenBondAlreadyExists} onClick={() => setIsExpanded(!isExpanded)}> | ||
<div className="d-flex justify-content-around align-items-center"> | ||
<div className={styles.title}>{t('earn.fidelity_bond.title_fidelity_bond_exists')}</div> | ||
<Sprite symbol={isExpanded ? 'caret-up' : 'plus'} width="15" height="15" /> | ||
</div> | ||
{/* <div className={styles.subtitle}> | ||
<Trans i18nKey="earn.fidelity_bond.subtitle_fidelity_bond_exists"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you have an idea where we can display the message? Maybe after the users actively clicks the button? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we can show this message at the top of the form when user clicks the button, only in the case when active bonds exist. |
||
<a | ||
onClick={(e) => e.stopPropagation()} | ||
rel="noopener noreferrer" | ||
href="https://github.com/JoinMarket-Org/joinmarket-clientserver/blob/master/docs/fidelity-bonds.md#what-amount-of-bitcoins-to-lock-up-and-for-how-long" | ||
> | ||
{/* i18n placeholder */} | ||
</a> | ||
</Trans> | ||
) : ( | ||
<div className="d-flex align-items-center justify-content-center gap-4 px-3 mt-3"> | ||
<Sprite className={styles.subtitleJar} symbol="fb-clock" width="46px" height="74px" /> | ||
{t('earn.fidelity_bond.subtitle')} | ||
> | ||
</a> | ||
</Trans> | ||
</div> */} | ||
</div> | ||
</div> | ||
) : ( | ||
<div className={styles.container}> | ||
<div className={styles.header} onClick={() => setIsExpanded(!isExpanded)}> | ||
<div className="d-flex justify-content-between align-items-center"> | ||
<div className={styles.title}>{t('earn.fidelity_bond.title')}</div> | ||
<Sprite symbol={isExpanded ? 'caret-up' : 'plus'} width="20" height="20" /> | ||
</div> | ||
<div className={styles.subtitle}> | ||
<div className="d-flex align-items-center justify-content-center gap-4 px-3 mt-3"> | ||
<Sprite className={styles.subtitleJar} symbol="fb-clock" width="46px" height="74px" /> | ||
{t('earn.fidelity_bond.subtitle')} | ||
</div> | ||
</div> | ||
)} | ||
</div> | ||
</div> | ||
</div> | ||
)} | ||
|
||
<rb.Collapse in={isExpanded}> | ||
<div> | ||
<hr /> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of positioning with margins, what do think about using flexbox?
e.g. you could use
d-flex justify-content-end
on the parent element to position the button to the "right".