diff options
| author | Max Nanis | 2025-06-09 16:05:52 +0700 |
|---|---|---|
| committer | Max Nanis | 2025-06-09 16:05:52 +0700 |
| commit | 74890e251dee3e0f195583431cb48b9f3a58ecc9 (patch) | |
| tree | a27ceee03999f18fd3ef2e0d44ba7deb39f0b6c8 /src/components/app-sidebar.tsx | |
| parent | a674d2e03de3bd048714d9c06e4bba9d9ecdb328 (diff) | |
| download | panel-ui-74890e251dee3e0f195583431cb48b9f3a58ecc9.tar.gz panel-ui-74890e251dee3e0f195583431cb48b9f3a58ecc9.zip | |
Cashout Methods page: adding walletSlice and cashoutmethodsSlice so they're in the stored state. Iterating with fix vs variable filters. Pulling old validators from old code and setting up the wallet fetch.
Diffstat (limited to 'src/components/app-sidebar.tsx')
| -rw-r--r-- | src/components/app-sidebar.tsx | 31 |
1 files changed, 24 insertions, 7 deletions
diff --git a/src/components/app-sidebar.tsx b/src/components/app-sidebar.tsx index e8cbd4c..f314c9f 100644 --- a/src/components/app-sidebar.tsx +++ b/src/components/app-sidebar.tsx @@ -1,13 +1,12 @@ "use client" import * as React from "react" -import {CircleDollarSign, MessageCircle, SquareStack} from "lucide-react" +import {CircleDollarSign, SquareStack} from "lucide-react" import {NavMain} from "@/components/nav-main" import { Sidebar, SidebarContent, - SidebarFooter, SidebarGroup, SidebarGroupContent, SidebarGroupLabel, @@ -17,10 +16,16 @@ import { SidebarMenuItem, useSidebar, } from "@/components/ui/sidebar" -import {useAppSelector} from "@/hooks.ts"; +import {useAppDispatch, useAppSelector} from "@/hooks.ts"; +import {setPage} from "@/models/appSlice.ts"; +import {Badge} from "@/components/ui/badge.tsx"; +import {useSelector} from "react-redux"; +import {selectCashoutMethods} from "@/models/cashoutMethodSlice.ts"; export function AppSidebar({...props}: React.ComponentProps<typeof Sidebar>) { const app = useAppSelector(state => state.app) + const dispatch = useAppDispatch() + const cashoutMethods = useSelector(selectCashoutMethods) const {isMobile} = useSidebar() @@ -50,12 +55,24 @@ export function AppSidebar({...props}: React.ComponentProps<typeof Sidebar>) { <SidebarGroupContent> <SidebarMenu> - <SidebarMenuItem key="cashout_methods"> + <SidebarMenuItem + key="cashout_methods" + className="cursor-pointer" + > <SidebarMenuButton asChild> - <a href="#"> + <a + onClick={() => dispatch(setPage("cashout_methods"))} + > <CircleDollarSign/> - <span>Methods</span> - </a> + <span> + Methods <Badge + className="absolute top-2 right-2 h-5 min-w-5 rounded-full px-1 font-mono tabular-nums cursor-pointer" + variant="outline" + title={`${cashoutMethods.length.toLocaleString()} cashout methods available`} + >{cashoutMethods.length.toLocaleString()}</Badge> + </span> </a> + + </SidebarMenuButton> </SidebarMenuItem> |
