Skip to content

Commit

Permalink
fix: jar spacing (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel committed Jul 21, 2022
1 parent b2faeb7 commit 484afbc
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/components/Balance.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const BalanceComponent = ({ symbol, value, symbolIsPrefix }) => {
return (
<span className="d-inline-flex align-items-center">
{symbolIsPrefix && symbol}
<span className="d-inline-flex align-items-center slashed-zeroes">{value}</span>
<span className="d-inline-flex align-items-center slashed-zeroes balance-value">{value}</span>
{!symbolIsPrefix && symbol}
</span>
)
Expand Down Expand Up @@ -101,8 +101,12 @@ export default function Balance({
// Treat decimal numbers as btc.
const valueIsBtc = !valueIsSats && !Number.isNaN(Number.parseFloat(valueString)) && valueString.indexOf('.') > -1

const btcSymbol = <span style={{ paddingRight: '0.1em' }}>{'\u20BF'}</span>
const satSymbol = <Sprite symbol="sats" width="1.2em" height="1.2em" />
const btcSymbol = (
<span className="balance-symbol" style={{ paddingRight: '0.1em' }}>
{'\u20BF'}
</span>
)
const satSymbol = <Sprite className="balance-symbol" symbol="sats" width="1.2em" height="1.2em" />

if (valueIsBtc && displayMode === DISPLAY_MODE_BTC)
return <BalanceComponent symbol={btcSymbol} value={formatBtc(valueString)} symbolIsPrefix={true} />
Expand Down
25 changes: 25 additions & 0 deletions src/components/fb/FidelityBondSteps.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,31 @@
color: var(--bs-gray-600);
}

.jarsContainer {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 2rem;
}

.jarsContainer :global .balance-value {
font-size: 0.7rem;
}

.jarsContainer :global .balance-symbol {
font-size: 0.7rem;
}

@media only screen and (min-width: 768px) {
.jarsContainer {
flex-direction: row;
justify-content: space-around;
gap: 0.5rem;
flex-wrap: wrap;
}
}

.utxoCard {
display: flex;
align-items: center;
Expand Down
2 changes: 1 addition & 1 deletion src/components/fb/FidelityBondSteps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const SelectJar = ({ accountBalances, totalBalance, utxos, selectedJar, onJarSel
return (
<div className="d-flex flex-column gap-4">
<div className={styles.stepDescription}>{t('earn.fidelity_bond.select_jar.description')}</div>
<div className="d-flex justify-content-between">
<div className={styles.jarsContainer}>
{sortedAccountBalances.map((account, index) => (
<SelectableJar
key={index}
Expand Down

0 comments on commit 484afbc

Please sign in to comment.