From 82105b29f46171e8e0207231708bed0fb393778c Mon Sep 17 00:00:00 2001 From: Karan Pargal <83785975+karanpargal@users.noreply.github.com> Date: Tue, 28 May 2024 03:25:04 +0530 Subject: [PATCH] fix: Remove unwanted sorting from Token/NFT approvals (#181) --- .../NFT/NFTApprovalList/NFTApprovalList.tsx | 35 ++++--------------- .../TokenApprovalList/TokenApprovalList.tsx | 25 +++---------- 2 files changed, 10 insertions(+), 50 deletions(-) diff --git a/src/components/Molecules/NFT/NFTApprovalList/NFTApprovalList.tsx b/src/components/Molecules/NFT/NFTApprovalList/NFTApprovalList.tsx index d10fbd64..4ee1621c 100644 --- a/src/components/Molecules/NFT/NFTApprovalList/NFTApprovalList.tsx +++ b/src/components/Molecules/NFT/NFTApprovalList/NFTApprovalList.tsx @@ -9,6 +9,7 @@ import { TableHeaderSorting, TableList } from "@/components/Shared"; import type { ColumnDef } from "@tanstack/react-table"; import { Address } from "@/components/Atoms"; import { Button } from "@/components/ui/button"; +import { TableHeader } from "@/components/ui/table"; export const NFTApprovalList: React.FC = ({ chain_name, @@ -49,13 +50,7 @@ export const NFTApprovalList: React.FC = ({ { id: "token_details", accessorKey: "token_details", - header: ({ column }) => ( - - align="left" - header={"Token"} - column={column} - /> - ), + header: () => Token, cell: ({ row }) => { return (
@@ -74,7 +69,7 @@ export const NFTApprovalList: React.FC = ({ }, { id: "token_balance", - accessorKey: "token_balance", + accessorKey: "token_balances", header: ({ column }) => ( align="left" @@ -87,13 +82,7 @@ export const NFTApprovalList: React.FC = ({ { id: "token_id", accessorKey: "token_id", - header: ({ column }) => ( - - align="left" - header={"Token ID"} - column={column} - /> - ), + header: () => Token ID, cell: ({ row }) => { const token_ids = row.original.token_balances.map( (balance) => balance.token_id @@ -106,13 +95,7 @@ export const NFTApprovalList: React.FC = ({ { id: "spender_address_label", accessorKey: "spender_address_label", - header: ({ column }) => ( - - align="left" - header={"Spender(s)"} - column={column} - /> - ), + header: () => Spender Address Label, cell: ({ row }) => { return (

@@ -131,13 +114,7 @@ export const NFTApprovalList: React.FC = ({ { id: "risk_factor", accessorKey: "risk_factor", - header: ({ column }) => ( - - align="left" - header={"Risk Factor"} - column={column} - /> - ), + header: () => Risk Factor, cell: ({ row }) => { return ( = ({ chain_name, @@ -52,13 +53,7 @@ export const TokenApprovalList: React.FC = ({ { id: "token_details", accessorKey: "token_details", - header: ({ column }) => ( - - align="left" - header={"Token"} - column={column} - /> - ), + header: () => Token, cell: ({ row }) => { return (

@@ -135,13 +130,7 @@ export const TokenApprovalList: React.FC = ({ { id: "spender_address_label", accessorKey: "spender_address_label", - header: ({ column }) => ( - - align="left" - header={"Spender(s)"} - column={column} - /> - ), + header: () => Spender(s), cell: ({ row }) => { return (

@@ -160,13 +149,7 @@ export const TokenApprovalList: React.FC = ({ { id: "risk_factor", accessorKey: "risk_factor", - header: ({ column }) => ( - - align="left" - header={"Risk Factor"} - column={column} - /> - ), + header: () => Risk Factor, cell: ({ row }) => { return (