-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #392 from alleslabs/refactor/proposal-table
feat: refactor proposal table
- Loading branch information
Showing
9 changed files
with
130 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 25 additions & 14 deletions
39
src/lib/components/table/proposals/ProposalsTableHeader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,31 @@ | ||
import type { GridProps } from "@chakra-ui/react"; | ||
import { Grid } from "@chakra-ui/react"; | ||
import type { DividerProps, GridProps } from "@chakra-ui/react"; | ||
import { Grid, Text } from "@chakra-ui/react"; | ||
|
||
import { TableHeader } from "../tableComponents"; | ||
import { TableHeader, TableHeaderFreeze } from "../tableComponents"; | ||
|
||
export const ProposalsTableHeader = ({ | ||
templateColumns, | ||
boxShadow, | ||
}: { | ||
templateColumns: GridProps["templateColumns"]; | ||
}) => ( | ||
<Grid templateColumns={templateColumns}> | ||
<TableHeader>Proposal ID</TableHeader> | ||
<TableHeader>Proposal Title</TableHeader> | ||
<TableHeader textAlign="center">Status</TableHeader> | ||
<TableHeader>Voting ends</TableHeader> | ||
<TableHeader>Resolved Block Height</TableHeader> | ||
<TableHeader>Type</TableHeader> | ||
<TableHeader>Proposer</TableHeader> | ||
</Grid> | ||
); | ||
boxShadow: DividerProps["boxShadow"]; | ||
}) => { | ||
// TODO - Revisit split columnsWidth | ||
const columnsWidth = templateColumns?.toString().split(" "); | ||
return ( | ||
<Grid templateColumns={templateColumns} minW="min-content"> | ||
<TableHeaderFreeze left="0">Proposal ID</TableHeaderFreeze> | ||
<TableHeaderFreeze | ||
left={columnsWidth && columnsWidth[0]} | ||
boxShadow={boxShadow} | ||
color="gray.800" | ||
> | ||
<Text color="text.main">Proposal Title/Type</Text> | ||
</TableHeaderFreeze> | ||
<TableHeader textAlign="center">Status</TableHeader> | ||
<TableHeader>Voting ends</TableHeader> | ||
<TableHeader>Resolved Block Height</TableHeader> | ||
<TableHeader>Proposed By</TableHeader> | ||
</Grid> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.