-
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
Deemphasise additional bond when one already exists #758
Conversation
border: 1px solid var(--bs-gray-200); | ||
border-radius: 0.3rem; | ||
display: block; | ||
margin-left: 41rem; |
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".
@@ -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 comment
The 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 comment
The 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.
One solution is that eventually it will be a modal so this issue shouldn't be there after we do that. So we can possibly fix that issue(modal instead of dropdown for the form) first and then there will be nothing to talk about this.
<a | ||
onClick={(e) => e.stopPropagation()} | ||
{otherFidelityBondExists ? ( | ||
<div className={styles.containerWhenBondAlreadyExists}> |
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.
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?
<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 comment
The 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 comment
The 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.
Fixes in new commits
Suggestions needed
please have a look @theborakompanioni |
From our conversation:
|
Suggested changes have been made.. |
Looks nice and exactly as discussed. 🚀 Can you check whether some added css classes are unused and can be removed? Also, what do you think.. can we bring the existing bond help text back somehow? <Trans i18nKey="earn.fidelity_bond.subtitle_fidelity_bond_exists">
<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> |
ya my fault.. It somehow disappeared from my code. Added it back now.. and css file has also been omitted. |
Nice. Looks good! There really should be little to no reason for users to have more than one active fidelity bond, so I think this message can be emphasized a bit more. But I am okay with this being tackled in a follow-up PR. Great work @barrytra - way better than before 💪 |
This PR fixes #756
Size of the button has been reduced to look like this:
Earlier it also had a message displayed as : "If more than one fidelity bond exists, only the <0>the most valuable one</0> will be used." I don't get how to use this if we reduce the button size. So for now I have just commented this portion. One Idea is simply we can add this info in settings which will be tackled in next PR. Would love to hear any other suggestion as well.
Secondly the dropdown now looks a bit weird. like this:
But This eventually should not be a problem as we would have a modal instead of dropdown.