-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed editmokcup, new manageorder table
- Loading branch information
1 parent
d837e00
commit fed337c
Showing
6 changed files
with
989 additions
and
588 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
import * as React from "react"; | ||
|
||
import { | ||
Table, | ||
Header, | ||
HeaderRow, | ||
Body, | ||
Row, | ||
HeaderCell, | ||
Cell, | ||
} from "@table-library/react-table-library/table"; | ||
import { useTheme } from "@table-library/react-table-library/theme"; | ||
|
||
import { nodes } from "@/utils/dummydata"; | ||
|
||
const Component = () => { | ||
const data = { nodes }; | ||
|
||
const theme = useTheme({ | ||
Table: ` | ||
--data-table-library_grid-template-columns: 250px 150px 25% 25% 50%; | ||
`, | ||
BaseCell: ` | ||
&:nth-of-type(1) { | ||
left: 0px; | ||
} | ||
&:nth-of-type(2) { | ||
left: 250px; | ||
} | ||
`, | ||
}); | ||
|
||
return ( | ||
<Table data={data} theme={theme} layout={{ custom: true }}> | ||
{(tableList) => ( | ||
<> | ||
<Header> | ||
<HeaderRow> | ||
<HeaderCell resize pinLeft> | ||
Task | ||
</HeaderCell> | ||
<HeaderCell resize pinLeft> | ||
Deadline | ||
</HeaderCell> | ||
<HeaderCell resize>Type</HeaderCell> | ||
<HeaderCell resize>Complete</HeaderCell> | ||
<HeaderCell resize>Tasks</HeaderCell> | ||
</HeaderRow> | ||
</Header> | ||
|
||
<Body> | ||
{tableList.map((item) => ( | ||
<Row key={item.id} item={item}> | ||
<Cell pinLeft>{item.name}</Cell> | ||
<Cell pinLeft> | ||
{new Date(item.deadline).toLocaleDateString("en-US", { | ||
year: "numeric", | ||
month: "2-digit", | ||
day: "2-digit", | ||
})} | ||
</Cell> | ||
<Cell>{item.type}</Cell> | ||
<Cell>{item.isComplete.toString()}</Cell> | ||
<Cell>{item.nodes?.length}</Cell> | ||
</Row> | ||
))} | ||
</Body> | ||
</> | ||
)} | ||
</Table> | ||
); | ||
}; | ||
|
||
export default Component; |
Oops, something went wrong.