-
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.
Use cell metadata to align the text to the right. For this, need to extend the type consistent for all columns. This is recommended and following the TanStack [documentation](https://tanstack.com/table/v8/docs/api/core/column-def#meta).
- Loading branch information
1 parent
096599d
commit 8d875cb
Showing
8 changed files
with
37 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
dist | ||
src/react-table.d.ts |
17 changes: 13 additions & 4 deletions
17
dapp/src/components/TransactionHistory/Table/Cell/components/Status.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,16 +1,25 @@ | ||
import React from "react" | ||
import { TransactionInfoStatus } from "#/types" | ||
import StatusInfo from "#/components/shared/StatusInfo" | ||
import { TextProps } from "@chakra-ui/react" | ||
import SimpleText from "./SimpleText" | ||
|
||
function Status({ status }: { status: TransactionInfoStatus }) { | ||
type StatusProps = { | ||
status: TransactionInfoStatus | ||
} & TextProps | ||
|
||
function Status({ status, ...textProps }: StatusProps) { | ||
if (status === "syncing") | ||
return <StatusInfo status={status} withDefaultColor /> | ||
return <StatusInfo status={status} withDefaultColor {...textProps} /> | ||
|
||
if (status === "pending") | ||
return <SimpleText color="grey.400">In queue</SimpleText> | ||
return ( | ||
<SimpleText color="grey.400" {...textProps}> | ||
In queue | ||
</SimpleText> | ||
) | ||
|
||
return <StatusInfo status={status} /> | ||
return <StatusInfo status={status} {...textProps} /> | ||
} | ||
|
||
export default Status |
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 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 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,9 @@ | ||
import "@tanstack/react-table" | ||
|
||
declare module "@tanstack/react-table" { | ||
interface ColumnMeta<TData extends RowData, TValue> { | ||
style: { | ||
textAlign: "left" | "center" | "right" | ||
} | ||
} | ||
} |
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