Skip to content

Commit

Permalink
chore(table): fix table header text alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
theborakompanioni committed Jan 6, 2024
1 parent 44d1ad8 commit 7af12fe
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 39 deletions.
14 changes: 5 additions & 9 deletions src/components/EarnReport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import * as Api from '../libs/JmWalletApi'
import { useSettings } from '../context/SettingsContext'
import Balance from './Balance'
import Sprite from './Sprite'
import styles from './EarnReport.module.css'
import TablePagination from './TablePagination'
import styles from './EarnReport.module.css'

const SORT_KEYS = {
timestamp: 'TIMESTAMP',
Expand All @@ -27,20 +27,16 @@ const TABLE_THEME = {
font-size: 0.9rem;
`,
BaseCell: `
&:nth-of-type(2) button {
display: flex;
&:nth-of-type(2) div div {
justify-content: end;
}
&:nth-of-type(3) button {
display: flex;
&:nth-of-type(3) div div {
justify-content: end;
}
&:nth-of-type(4) button {
display: flex;
&:nth-of-type(4) div div {
justify-content: end;
}
&:nth-of-type(5) button {
display: flex;
&:nth-of-type(5) div div {
justify-content: end;
}
`,
Expand Down
18 changes: 6 additions & 12 deletions src/components/Orderbook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,22 @@ const TABLE_THEME = {
font-size: 0.9rem;
`,
BaseCell: `
&:nth-of-type(3) button {
display: flex;
&:nth-of-type(3) div div {
justify-content: center;
}
&:nth-of-type(4) button {
display: flex;
&:nth-of-type(4) div div {
justify-content: end;
}
&:nth-of-type(5) button {
display: flex;
&:nth-of-type(5) div div {
justify-content: end;
}
&:nth-of-type(6) button {
display: flex;
&:nth-of-type(6) div div {
justify-content: end;
}
&:nth-of-type(7) button {
display: flex;
&:nth-of-type(7) div div {
justify-content: end;
}
&:nth-of-type(8) button {
display: flex;
&:nth-of-type(8) div div {
justify-content: end;
}
`,
Expand Down
33 changes: 15 additions & 18 deletions src/components/jar_details/UtxoList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,14 @@ const utxoTags = (utxo: Utxo, walletInfo: WalletInfo, t: TFunction): Tag[] => {

const utxoIcon = (utxo: Utxo, t: TFunction) => {
if (fb.utxo.isFidelityBond(utxo)) {
return (
<>
{withTooltip({
node: (
<div className={styles.utxoIcon}>
<Sprite className={styles.iconLocked} symbol="timelock" width="20" height="20" />
</div>
),
tooltip: <div>{t('jar_details.utxo_list.utxo_tooltip_locktime', { locktime: utxo.locktime })}</div>,
})}
</>
)
return withTooltip({
node: (
<div className={styles.utxoIcon}>
<Sprite className={styles.iconLocked} symbol="timelock" width="20" height="20" />
</div>
),
tooltip: <div>{t('jar_details.utxo_list.utxo_tooltip_locktime', { locktime: utxo.locktime })}</div>,
})
} else if (utxo.frozen) {
return (
<div className={styles.utxoIcon}>
Expand Down Expand Up @@ -121,15 +117,13 @@ const TABLE_THEME = {
text-align: center;
padding: 0 !important;
}
&:nth-of-type(4) button {
display: flex;
&:nth-of-type(4) div div {
justify-content: end;
}
&:nth-of-type(6) {
padding: 0 !important;
}
&:nth-of-type(6) button {
display: flex;
&:nth-of-type(6) div div {
justify-content: center;
}
`,
Expand All @@ -144,6 +138,9 @@ const TABLE_THEME = {
display: flex;
justify-content: center;
}
&:nth-of-type(8) {
text-align: right;
}
`,
Row: `
&.row-select-selected {
Expand Down Expand Up @@ -336,13 +333,13 @@ const UtxoList = ({
<div className="d-block d-lg-none">
{withTooltip({
node: <code>{shortenStringMiddle(item.address, 16)}</code>,
tooltip: <div className="break-word">{item.address}</div>,
tooltip: <div className="slashed-zeroes">{item.address}</div>,
})}
</div>
<div className="d-none d-lg-block d-xl-none">
{withTooltip({
node: <code>{shortenStringMiddle(item.address, 32)}</code>,
tooltip: <div className="break-word">{item.address}</div>,
tooltip: <div className="slashed-zeroes">{item.address}</div>,
})}
</div>
<div className="d-none d-xl-block">
Expand Down

0 comments on commit 7af12fe

Please sign in to comment.