-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Moves some css up a level to make it useful elsewhere * Moves CustomMeta up a level to make it more useful * Uses CustomMeta in NameView component * Adds loading to NamesView * Cleans up useKeyboardPaging * Make names columns consistent * Improves messaging
- Loading branch information
Showing
10 changed files
with
91 additions
and
92 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import React from "react"; | ||
|
||
export interface CustomMeta { | ||
className?: string; | ||
} |
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 |
---|---|---|
@@ -1,49 +1,62 @@ | ||
import React from "react"; | ||
import { IconCircleCheck } from "@tabler/icons-react"; | ||
import { types } from "@gocode/models"; | ||
import { createColumnHelper } from "@tanstack/react-table"; | ||
import { createColumnHelper, ColumnDef } from "@tanstack/react-table"; | ||
import { CustomMeta } from "../CustomMeta"; | ||
|
||
type CustomColumnDef<TData, TValue> = ColumnDef<TData, TValue> & { | ||
meta?: CustomMeta; | ||
}; | ||
|
||
const nameColumnHelper = createColumnHelper<types.Name>(); | ||
|
||
export const nameColumns = [ | ||
export const nameColumns: CustomColumnDef<types.Name, any>[] = [ | ||
nameColumnHelper.accessor("address", { | ||
header: () => "Address", | ||
cell: (info) => info.getValue(), | ||
cell: (info) => info.renderValue(), | ||
size: 100, | ||
meta: { className: "wide" }, | ||
}), | ||
nameColumnHelper.accessor("tags", { | ||
header: () => "Tags", | ||
cell: (info) => info.renderValue(), | ||
size: 100, | ||
meta: { className: "wide" }, | ||
}), | ||
nameColumnHelper.accessor("name", { | ||
header: () => "Name", | ||
cell: (info) => info.renderValue(), | ||
size: 100, | ||
meta: { className: "wide" }, | ||
}), | ||
nameColumnHelper.accessor("symbol", { | ||
header: () => "Symbol", | ||
cell: (info) => info.renderValue(), | ||
size: 100, | ||
meta: { className: "small" }, | ||
}), | ||
nameColumnHelper.accessor("decimals", { | ||
header: () => "Decimals", | ||
cell: (info) => info.renderValue(), | ||
size: 100, | ||
meta: { className: "small" }, | ||
}), | ||
nameColumnHelper.accessor("isContract", { | ||
header: () => "isContract", | ||
cell: (info) => (info.getValue() ? <IconCircleCheck size={20} color="white" fill="green" /> : ""), | ||
size: 100, | ||
meta: { className: "small-centered" }, | ||
}), | ||
nameColumnHelper.accessor("isErc20", { | ||
header: () => "isErc20", | ||
cell: (info) => (info.getValue() ? <IconCircleCheck size={20} color="white" fill="green" /> : ""), | ||
size: 100, | ||
meta: { className: "small-centered" }, | ||
}), | ||
nameColumnHelper.accessor("isErc721", { | ||
header: () => "isErc721", | ||
cell: (info) => (info.getValue() ? <IconCircleCheck size={20} color="white" fill="green" /> : ""), | ||
size: 100, | ||
meta: { className: "small-centered" }, | ||
}), | ||
]; |
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