Skip to content
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

feat: use fixed table layout #48

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/components/CollatorList/CollatorList.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
text-align: left;
margin-top: 10px;
background-color: var(--color-bg);
table-layout: fixed;
}

.tableHead {
Expand Down Expand Up @@ -38,3 +39,15 @@ tr.search {
.activeSort {
color: var(--color-primary);
}

.indicatorCol {
width: 110px;
}

.actionCol {
width: 120px;
}

.tokensCol {
width: 50px;
}
6 changes: 3 additions & 3 deletions src/components/CollatorList/CollatorList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ export const CollatorList: React.FC = () => {
<Icon type="search" />
</span>
</th>
<th></th>
<th className={styles.indicatorCol}></th>
<th
className={cx({
[styles.activeSort]:
Expand Down Expand Up @@ -115,11 +115,11 @@ export const CollatorList: React.FC = () => {
className={cx({
[styles.activeSort]: sortBy === SORT_BY.Delegators,
})}
colSpan={2}
>
Delegators
</th>
<th>
<th className={styles.actionCol}></th>
<th className={styles.tokensCol}>
<Icon type="tokens_white" />
</th>
<th className={rowStyles.spacer}></th>
Expand Down
4 changes: 3 additions & 1 deletion src/components/Input/Input.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,10 @@
}

.number {
max-width: 110px;
width: 200px;
max-width: 100%;
text-align: right;
box-sizing: border-box;
}

.number::-webkit-outer-spin-button,
Expand Down
10 changes: 7 additions & 3 deletions src/components/NewStakeRow/NewStakeRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,13 @@ export const NewStakeRow: React.FC<Props> = ({ staked = false, collator }) => {

return (
<tr
className={cx(rowStyles.row, rowStyles.stakeRow, {
[rowStyles.staked]: staked,
})}
className={cx(
rowStyles.row,
staked ? rowStyles.stakeRow : rowStyles.stakedRow,
{
[rowStyles.staked]: staked,
}
)}
>
<td></td>
<td></td>
Expand Down
5 changes: 4 additions & 1 deletion src/styles/row.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@
}

.stakeRow td {
border-top: 1px solid var(--color-primary-light);
border-top: 1px solid #ffee00a8;
font-size: var(--font-size-small);
}
.stakedRow td {
font-size: var(--font-size-small);
}
.stakeRow td:first-of-type,
Expand Down