diff --git a/app/assets/assets-table/data-table.tsx b/app/assets/assets-table/data-table.tsx index 8f8fe5af..784a0d15 100644 --- a/app/assets/assets-table/data-table.tsx +++ b/app/assets/assets-table/data-table.tsx @@ -12,12 +12,10 @@ import { getSortedRowModel, useReactTable, } from "@tanstack/react-table" -import { DollarSign } from "lucide-react" +import { DollarSign, EyeOff } from "lucide-react" import { TransferDialog } from "@/components/dialogs/transfer/transfer-dialog" import { TableEmptyState } from "@/components/table-empty-state" -import { Label } from "@/components/ui/label" -import { Switch } from "@/components/ui/switch" import { Table, TableBody, @@ -27,8 +25,11 @@ import { TableRow, } from "@/components/ui/table" import { Toggle } from "@/components/ui/toggle" - -import { cn } from "@/lib/utils" +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from "@/components/ui/tooltip" interface DataTableProps { columns: ColumnDef[] @@ -95,58 +96,76 @@ export function DataTable({ Your deposits inside of Renegade. Only you and your connected relayer can see your balances. -
- { - value - ? setColumnVisibility({ - renegadeUsdValue: true, - l2UsdValue: true, - renegadeBalance: false, - l2Balance: false, - }) - : setColumnVisibility({ - renegadeUsdValue: false, - l2UsdValue: false, - renegadeBalance: true, - l2Balance: true, - }) - }} - > - - -
-
- { - setShowZeroL2Balance(!!value) - setShowZeroRenegadeBalance(!!value) - }} - /> - -
-
- setIsLongFormat(!!value)} - /> - +
+ + + { + value + ? setColumnVisibility({ + renegadeUsdValue: true, + l2UsdValue: true, + renegadeBalance: false, + l2Balance: false, + }) + : setColumnVisibility({ + renegadeUsdValue: false, + l2UsdValue: false, + renegadeBalance: true, + l2Balance: true, + }) + }} + > + + + + +

USD Value

+
+
+ + + { + setShowZeroL2Balance(!value) + setShowZeroRenegadeBalance(!value) + }} + > + + + + +

Hide zero balances

+
+
+ + + setIsLongFormat(value)} + > + .00 + + + +

Show decimals

+
+
diff --git a/app/assets/history-table/data-table.tsx b/app/assets/history-table/data-table.tsx index 16d88d84..ff24dafb 100644 --- a/app/assets/history-table/data-table.tsx +++ b/app/assets/history-table/data-table.tsx @@ -26,6 +26,12 @@ import { TableHeader, TableRow, } from "@/components/ui/table" +import { Toggle } from "@/components/ui/toggle" +import { + Tooltip, + TooltipContent, + TooltipTrigger, +} from "@/components/ui/tooltip" import { DISPLAY_TOKENS } from "@/lib/token" @@ -150,17 +156,24 @@ export function DataTable({ Clear ) : null} -
- setIsLongFormat(!!value)} - /> - +
+ + + setIsLongFormat(value)} + > + .00 + + + +

Toggle decimals

+
+
diff --git a/app/assets/page-client.tsx b/app/assets/page-client.tsx index 69751aba..ec3287bb 100644 --- a/app/assets/page-client.tsx +++ b/app/assets/page-client.tsx @@ -1,8 +1,7 @@ "use client" -import React, { useRef } from "react" +import React from "react" -import { InfoCircledIcon } from "@radix-ui/react-icons" import { TaskType, Token, @@ -10,14 +9,13 @@ import { useBackOfQueueWallet, useTaskHistory, } from "@renegade-fi/react" -import { ChevronDown, ChevronUp, Info } from "lucide-react" +import { Info } from "lucide-react" import { formatUnits } from "viem/utils" import { useAccount, useReadContracts } from "wagmi" import { DataTable as AssetTable } from "@/app/assets/assets-table/data-table" import { DataTable as TransferHistoryTable } from "@/app/assets/history-table/data-table" -import { Button } from "@/components/ui/button" import { Tooltip, TooltipContent, @@ -158,38 +156,13 @@ export function PageClient() { }, []) }, [transferHistory]) - const assetsRef = useRef(null) - const transferHistoryRef = useRef(null) - - const scrollToSection = (ref: React.RefObject) => { - if (ref.current) { - const yOffset = -100 // Adjust this value to set your desired offset - const y = - ref.current.getBoundingClientRect().top + window.scrollY + yOffset - window.scrollTo({ top: y, behavior: "smooth" }) - } - } - return (
-
-
-

Assets

-
- -
-
+
+

+ Assets +

-
-
-

Transfer History

-
- -
-
+
+

+ Transfer History +

({ ) : null} -
- setIsLongFormat(!!value)} - /> - -
+ + + setIsLongFormat(value)} + > + .00 + + + +

Show decimals

+
+
diff --git a/components/ui/toggle.tsx b/components/ui/toggle.tsx index c50c2733..7ebdbf56 100644 --- a/components/ui/toggle.tsx +++ b/components/ui/toggle.tsx @@ -7,7 +7,7 @@ import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const toggleVariants = cva( - "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground", + "inline-flex items-center justify-center text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground", { variants: { variant: { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 474c30e7..6049603b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -11064,7 +11064,7 @@ snapshots: eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-react: 7.34.2(eslint@8.57.0) eslint-plugin-react-hooks: 4.6.2(eslint@8.57.0) @@ -11092,7 +11092,7 @@ snapshots: enhanced-resolve: 5.16.1 eslint: 8.57.0 eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 is-core-module: 2.13.1 @@ -11114,7 +11114,7 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-node@0.3.9)(eslint-plugin-import@2.29.1(eslint@8.57.0))(eslint@8.57.0))(eslint@8.57.0): + eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.4.5))(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): dependencies: array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5