Skip to content

Commit

Permalink
feat(SalariesInput): add headers to salaries input table
Browse files Browse the repository at this point in the history
  • Loading branch information
mathiazom committed Sep 5, 2024
1 parent 9314259 commit bfde5dd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 6 deletions.
8 changes: 8 additions & 0 deletions studio/components/SalaryCsvInput/SalariesInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ export const SalariesInput = (props: StringInputProps) => {
</Inline>
{salaries && (
<Grid columns={[2]}>
<div className={styles.csvTableHeader}>
<span className={styles.csvTableHeaderLabel}>Examination Year</span>
</div>
<div
className={`${styles.csvTableHeader} ${styles.csvTableSalaryHeader}`}
>
<span className={styles.csvTableHeaderLabel}>Amount</span>
</div>
{Object.entries(salaries)
.toSorted(([a], [b]) => Number(b) - Number(a))
.map(([year, salary], index) => (
Expand Down
27 changes: 21 additions & 6 deletions studio/components/SalaryCsvInput/salariesInput.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,34 @@
color: black;
}

.csvTableCell {
.csvTableHeader {
font-weight: 600;
font-size: 0.8125rem;
}

.csvTableSalaryHeader {
justify-content: end;
padding-right: 1.25rem;
}

.csvTableCell,
.csvTableHeader {
display: flex;
align-items: center;
font-size: 0.95rem;
padding: 0.25rem;
}

.csvTableCell:nth-child(4n + 1),
.csvTableCell:nth-child(4n + 2) {
.csvTableCell {
font-size: 0.95rem;
}

.csvTableCell:nth-child(4n),
.csvTableCell:nth-child(4n + 3) {
background-color: #f5f5f5;
}

[data-scheme="dark"] .csvTableCell:nth-child(4n + 1),
[data-scheme="dark"] .csvTableCell:nth-child(4n + 2) {
[data-scheme="dark"] .csvTableCell:nth-child(4n),
[data-scheme="dark"] .csvTableCell:nth-child(4n + 3) {
background-color: #212121;
}

Expand All @@ -85,6 +99,7 @@
background-color: transparent;
}

.csvTableHeaderLabel,
.csvTableYearLabel {
padding: 0.5rem;
}

0 comments on commit bfde5dd

Please sign in to comment.