diff --git a/jsapp/js/components/common/SimpleTable.module.scss b/jsapp/js/components/common/SimpleTable.module.scss new file mode 100644 index 0000000000..2c804a8de3 --- /dev/null +++ b/jsapp/js/components/common/SimpleTable.module.scss @@ -0,0 +1,25 @@ +// We need bigger specificity in each selector to ensure we do overwrite default +// styles + +table.SimpleTableRoot { + background-color: var(--mantine-color-gray-9); + border-collapse: separate; + border-radius: var(--mantine-radius-md); +} + +thead.SimpleTableThead { + background-color: var(--mantine-color-gray-8); +} + +th.SimpleTableTh { + font-size: var(--mantine-font-size-sm); + color: var(--mantine-color-gray-2); + font-weight: 400; +} + +td.SimpleTableTd { + font-size: var(--mantine-font-size-md); + border-top-width: 1px; + border-top-color: var(--mantine-color-gray-7); + border-top-style: solid; +} diff --git a/jsapp/js/components/common/SimpleTable.tsx b/jsapp/js/components/common/SimpleTable.tsx index 28c0cfb998..4680131556 100644 --- a/jsapp/js/components/common/SimpleTable.tsx +++ b/jsapp/js/components/common/SimpleTable.tsx @@ -1,6 +1,7 @@ -import {Table, type TableData} from '@mantine/core'; +import {Table, type MantineStyleProps, type TableData} from '@mantine/core'; +import styles from './SimpleTable.module.scss'; -interface SimpleTableProps { +interface SimpleTableProps extends MantineStyleProps { head: TableData['head']; body: TableData['body']; /** @@ -13,20 +14,30 @@ interface SimpleTableProps { /** * A wrapper component for `Table` from `@mantine/core`. It requires column - * headings, column data, and has optional minimum width. + * headings, column data, and has optional minimum width. You can pass all + * standard Mantine style props down to the inner `Table`. */ -export default function SimpleTable(props: SimpleTableProps) { +export default function SimpleTable( + {head, body, minWidth, ...styleProps}: SimpleTableProps +) { const table = (