Skip to content

Commit

Permalink
optimize some layout styles
Browse files Browse the repository at this point in the history
  • Loading branch information
codeJiahaoLiu committed Dec 19, 2023
1 parent 9a47bab commit fafe6b0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/components/Table/Table.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
position: sticky;
top: -1px;
z-index: 500;
background-color: var(--mantine-color-body);
background-color: rgb(245,245,245);
transition: box-shadow 150ms ease;

&::after {
Expand Down
3 changes: 2 additions & 1 deletion src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ function Table<T extends { id: string }>({
renderColumns={renderColumns}
setRenderColumns={setRenderColumns}
/>
{!noSelector &&
<Flex justify="space-between" align="center" w="100%" mt="xs">
<Text size="xs">Total {total} users</Text>
<Menu shadow="lg" width={180}>
Expand All @@ -137,7 +138,7 @@ function Table<T extends { id: string }>({
</Menu.Item>
</MenuDropdown>
</Menu>
</Flex>
</Flex>}
</>
)}
<ScrollArea
Expand Down
22 changes: 13 additions & 9 deletions src/components/Table/TableSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ function TableSearch<T>({
const [searchItem, setSearchItem] = useState<string | null>(
columns.filter((item) => item.searchable)[0].name
);
const [searchItemUid, setSearchItemUid] = useState<keyof T | 'actions'>(
columns.filter((item) => item.searchable)[0].uid
);
const [opened, { open, close }] = useDisclosure(false);

return (
Expand All @@ -59,23 +62,24 @@ function TableSearch<T>({
/>
<TextInput className={classes.search} placeholder={`Search by ${searchItem}...`} />
</Group>
<MultiSelect
w={150}
classNames={multiSelectClasses}
checkIconPosition="right"
data={columns.map((item) => item.name)}
placeholder="Columns"
defaultValue={renderColumns}
onChange={setRenderColumns}
/>
<Group>
<Button
visibleFrom="sm"
variant="outline"
onClick={() => sigleSearch()}
rightSection={<IconSearch style={{ width: rem(18), height: rem(18) }} stroke={1.8} />}
>
Search
</Button>
<MultiSelect
w={150}
classNames={multiSelectClasses}
checkIconPosition="right"
data={columns.map((item) => item.name)}
placeholder="Columns"
defaultValue={renderColumns}
onChange={setRenderColumns}
/>
<UnstyledButton
onClick={() => {
const formData = new FormData();
Expand Down

0 comments on commit fafe6b0

Please sign in to comment.