aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorMax Nanis2025-06-03 20:06:44 +0700
committerMax Nanis2025-06-03 20:06:44 +0700
commit62456f41288eb0f03c5092d36610d566f275c8b5 (patch)
tree20b0170545f6b6c1ae1af233aca795d1d4aac2ef /src/components
parentbf027779eb4c839420406e3547f22f5665ec08ab (diff)
downloadpanel-ui-62456f41288eb0f03c5092d36610d566f275c8b5.tar.gz
panel-ui-62456f41288eb0f03c5092d36610d566f275c8b5.zip
selectQuestionById, useMemo selector (MultiChoice.choices makes a lot of lookup). Setting up the Questions view to do Pagination to tab through available questions and view one at a time
Diffstat (limited to 'src/components')
-rw-r--r--src/components/app-sidebar.tsx84
-rw-r--r--src/components/nav-main.tsx6
-rw-r--r--src/components/site-header.tsx2
3 files changed, 6 insertions, 86 deletions
diff --git a/src/components/app-sidebar.tsx b/src/components/app-sidebar.tsx
index d2bc03e..e8cbd4c 100644
--- a/src/components/app-sidebar.tsx
+++ b/src/components/app-sidebar.tsx
@@ -1,19 +1,9 @@
"use client"
import * as React from "react"
-import {CircleDollarSign, MessageCircle, MoreVerticalIcon, SquareStack, UserCircleIcon} from "lucide-react"
+import {CircleDollarSign, MessageCircle, SquareStack} from "lucide-react"
import {NavMain} from "@/components/nav-main"
-import {Avatar, AvatarFallback, AvatarImage,} from "@/components/ui/avatar"
-import {
- DropdownMenu,
- DropdownMenuContent,
- DropdownMenuGroup,
- DropdownMenuItem,
- DropdownMenuLabel,
- DropdownMenuSeparator,
- DropdownMenuTrigger,
-} from "@/components/ui/dropdown-menu"
import {
Sidebar,
SidebarContent,
@@ -34,15 +24,11 @@ export function AppSidebar({...props}: React.ComponentProps<typeof Sidebar>) {
const {isMobile} = useSidebar()
- // <button onClick={() => setActiveView('offerwall')}>Offerwall</button>
- // <button onClick={() => setActiveView('questions')}>Questions</button>
- // <button onClick={() => setActiveView('cashout')}>Cashout Methods</button>
-
return (
<Sidebar collapsible="offcanvas" {...props}>
<SidebarHeader>
<SidebarMenu>
- <SidebarMenuItem>
+ <SidebarMenuItem key="panel_name">
<SidebarMenuButton
asChild
className="data-[slot=sidebar-menu-button]:!p-1.5"
@@ -87,72 +73,6 @@ export function AppSidebar({...props}: React.ComponentProps<typeof Sidebar>) {
</SidebarGroup>
</SidebarContent>
- <SidebarGroupContent>
- <SidebarMenu>
- <SidebarMenuItem key="support">
- <SidebarMenuButton asChild>
- <a href="#">
- <MessageCircle/>
- <span>Support</span>
- </a>
- </SidebarMenuButton>
- </SidebarMenuItem>
- </SidebarMenu>
- </SidebarGroupContent>
-
-
- <SidebarFooter>
- <DropdownMenu>
- <DropdownMenuTrigger>
- <SidebarMenuButton
- size="lg"
- className="data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground"
- >
- <Avatar className="h-8 w-8 rounded-lg grayscale">
- <AvatarImage src="#" alt="foo"/>
- <AvatarFallback className="rounded-lg">IW</AvatarFallback>
- </Avatar>
- <div className="grid flex-1 text-left text-sm leading-tight">
- <span className="truncate font-medium">Ironwood User</span>
- <span className="truncate text-xs text-muted-foreground">
- ironwood@example.com
- </span>
- </div>
- <MoreVerticalIcon className="ml-auto size-4"/>
- </SidebarMenuButton>
- </DropdownMenuTrigger>
- <DropdownMenuContent
- className="w-[--radix-dropdown-menu-trigger-width] min-w-56 rounded-lg"
- side={isMobile ? "bottom" : "right"}
- align="end"
- sideOffset={4}
- >
- <DropdownMenuLabel className="p-0 font-normal">
- <div className="flex items-center gap-2 px-1 py-1.5 text-left text-sm">
- <Avatar className="h-8 w-8 rounded-lg">
- <AvatarImage src="#" alt="Ironwood User"/>
- <AvatarFallback className="rounded-lg">IW</AvatarFallback>
- </Avatar>
- <div className="grid flex-1 text-left text-sm leading-tight">
- <span className="truncate font-medium">Ironwood User</span>
- <span className="truncate text-xs text-muted-foreground">
- ironwood@example.com
- </span>
- </div>
- </div>
- </DropdownMenuLabel>
- <DropdownMenuSeparator/>
- <DropdownMenuGroup>
- <DropdownMenuItem>
- <UserCircleIcon/>
- Account
- </DropdownMenuItem>
- </DropdownMenuGroup>
- <DropdownMenuSeparator/>
- </DropdownMenuContent>
- </DropdownMenu>
- </SidebarFooter>
-
</Sidebar>
)
}
diff --git a/src/components/nav-main.tsx b/src/components/nav-main.tsx
index 873d236..12a60aa 100644
--- a/src/components/nav-main.tsx
+++ b/src/components/nav-main.tsx
@@ -19,7 +19,7 @@ export function NavMain() {
<SidebarGroupContent className="flex flex-col gap-2">
<SidebarMenu>
- <SidebarMenuItem key="Surveys"
+ <SidebarMenuItem key="surveys"
onClick={() => dispatch(setPage("offerwall"))}
>
<SidebarMenuButton tooltip="Surveys">
@@ -29,7 +29,7 @@ export function NavMain() {
</SidebarMenuItem>
- <SidebarMenuItem key="Questions"
+ <SidebarMenuItem key="questions"
onClick={() => dispatch(setPage("questions"))}
>
<SidebarMenuButton tooltip="Questions">
@@ -38,7 +38,7 @@ export function NavMain() {
</SidebarMenuButton>
</SidebarMenuItem>
- <SidebarMenuItem key="Community">
+ <SidebarMenuItem key="community">
<SidebarMenuButton tooltip="Community">
<Users/>
<span>Community</span>
diff --git a/src/components/site-header.tsx b/src/components/site-header.tsx
index 5bc5ca7..0000e5f 100644
--- a/src/components/site-header.tsx
+++ b/src/components/site-header.tsx
@@ -14,7 +14,7 @@ const SiteHeader = () => {
orientation="vertical"
className="mx-2 data-[orientation=vertical]:h-4"
/>
- <h1 className="text-base font-medium">"activeView"</h1>
+ <h1 className="text-base font-medium">Offerwall</h1>
</div>
</header>