From 80539188ef6814b4202d677d62b761bd5b670574 Mon Sep 17 00:00:00 2001 From: Max Nanis Date: Tue, 24 Jun 2025 19:04:01 +0700 Subject: Dynamic height adjustment for widget size. CSS inject by JS for single file --- src/components/app-sidebar.tsx | 82 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 74 insertions(+), 8 deletions(-) (limited to 'src/components/app-sidebar.tsx') diff --git a/src/components/app-sidebar.tsx b/src/components/app-sidebar.tsx index c60bf17..b61a716 100644 --- a/src/components/app-sidebar.tsx +++ b/src/components/app-sidebar.tsx @@ -1,9 +1,7 @@ "use client" import React from "react" -import {CircleDollarSign, SquareStack} from "lucide-react" - -import {NavMain} from "@/components/nav-main" +import {Activity, CircleDollarSign, ListIcon, NotebookText, SquareStack, User} from "lucide-react" import { Sidebar, SidebarContent, @@ -22,6 +20,8 @@ import {Badge} from "@/components/ui/badge.tsx"; import {useSelector} from "react-redux"; import {selectCashoutMethods} from "@/models/cashoutMethodSlice.ts"; import {selectTransactionHistory} from "@/models/transactionHistorySlice.ts"; +import {selectQuestions} from "../models/questionSlice"; +import {selectUserUpkAnswers} from "../models/userUpkAnswerSlice"; export function AppSidebar({...props}: React.ComponentProps) { const app: App = useAppSelector(state => state.app) @@ -29,8 +29,12 @@ export function AppSidebar({...props}: React.ComponentProps) { const cashoutMethods = useSelector(selectCashoutMethods) const transactionHistory = useSelector(selectTransactionHistory) + const questions = useSelector(selectQuestions) + const upkAnswers = useSelector(selectUserUpkAnswers) + const taskAttempts = useAppSelector(state => state.taskStatus) + return ( - + @@ -38,7 +42,6 @@ export function AppSidebar({...props}: React.ComponentProps) { asChild className="data-[slot=sidebar-menu-button]:!p-1.5" > - {app.panelName} @@ -46,10 +49,73 @@ export function AppSidebar({...props}: React.ComponentProps) { - - + + + + + dispatch(setPage("offerwall"))} + > + + + + Surveys {(app.availability_count ?? 0).toLocaleString()} + + + + + + dispatch(setPage("questions"))} + > + + + + Questions {questions.length.toLocaleString()} + + + + + dispatch(setPage("demographics"))} + > + + + + Demographics {upkAnswers.length.toLocaleString()} + + + + + dispatch(setPage("task_attempts"))} + > + + + + Survey History {taskAttempts.length.toLocaleString()} + + + + + + + - Redemption -- cgit v1.2.3