Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tables): ts #168

Merged
merged 1 commit into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/components/Atoms/Address/Address.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ export const Address: React.FC<AddressProps> = ({
};

return (
<div className="flex items-center gap-x-2">
<p>{truncate(address)}</p>
<p className="flex items-center gap-x-2">
{truncate(address)}

{show_copy_icon ? (
<button
className="cursor-pointer"
Expand All @@ -49,6 +50,6 @@ export const Address: React.FC<AddressProps> = ({
) : (
<></>
)}
</div>
</p>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -46,64 +46,54 @@ export const AddressActivityListView: React.FC<
const columns: ColumnDef<ChainActivityEvent>[] = [
{
accessorKey: "label",
id: "label",
header: ({ column }) => (
<TableHeaderSorting
<TableHeaderSorting<ChainActivityEvent>
align="left"
header_name={"Name"}
header="Chain Name"
column={column}
/>
),
cell: ({ row }) => {
return (
<div className="flex items-center gap-x-1">
<TokenAvatar
is_chain_logo={true}
token_url={row.original.logo_url}
size={GRK_SIZES.EXTRA_EXTRA_SMALL}
/>
{row.getValue("label")}
</div>
);
},
cell: ({ row }) => (
<div className="flex items-center gap-x-1">
<TokenAvatar
is_chain_logo={true}
token_url={row.original.logo_url}
size={GRK_SIZES.EXTRA_EXTRA_SMALL}
/>
{row.getValue("label")}
</div>
),
},
{
accessorKey: "last_seen_at",
id: "last_seen_at",
header: ({ column }) => (
<TableHeaderSorting
<TableHeaderSorting<ChainActivityEvent>
align="left"
header_name={"Last Active"}
header="Last Active"
column={column}
/>
),
cell: ({ row }) => {
const t = (row.getValue("last_seen_at") as string).toString();

return <div>{timestampParser(t, "relative")}</div>;
},
cell: ({ row }) =>
timestampParser(row.getValue("last_seen_at"), "relative"),
},
{
accessorKey: "is_testnet",
id: "is_testnet",
header: ({ column }) => (
<TableHeaderSorting
<TableHeaderSorting<ChainActivityEvent>
align="center"
header_name={"Mainnet"}
header="Mainnet"
column={column}
/>
),

cell: ({ row }) => {
const t = row.getValue("is_testnet");

return (
<div className="text-center">
{t ? (
""
) : (
<IconWrapper icon_class_name="playlist_add_check" />
)}
</div>
);
},
cell: ({ row }) =>
!row.getValue("is_testnet") ? (
<IconWrapper icon_class_name="playlist_add_check" />
) : (
<></>
),
},
];

Expand Down
Loading
Loading