diff --git a/apps/portal-dashboard/app/root.tsx b/apps/portal-dashboard/app/root.tsx index a30231031..d0c17926c 100644 --- a/apps/portal-dashboard/app/root.tsx +++ b/apps/portal-dashboard/app/root.tsx @@ -1,4 +1,3 @@ -import { useMemo } from "react"; import { Links, Meta, @@ -6,35 +5,37 @@ import { Scripts, ScrollRestoration, } from "@remix-run/react"; +import { useMemo } from "react"; -import stylesheet from "portal-shared/tailwind.css?url"; import type { LinksFunction } from "@remix-run/node"; +import stylesheet from "portal-shared/tailwind.css?url"; // Supports weights 200-800 import "@fontsource-variable/manrope"; +import { createServiceProvider } from "@/dataProviders/serviceProvider"; +import useUploader from "@/features/uploadManager/hooks/useUploader"; +import { useAppInitialization } from "@/hooks/useAppInitialization"; +import { SERVICE_ROUTE } from "@/routeConfig"; +import { getResetServices } from "@/services/index"; import { - AuthProvider, - NotificationProvider, + type AuthProvider, + type NotificationProvider, Refine, - ResourceProps, + type ResourceProps, } from "@refinedev/core"; -import { Toaster } from "portal-shared/components/ui/toaster"; -import useSdk from "portal-shared/hooks/useSdk"; import routerProvider from "@refinedev/remix-router"; -import { notificationProvider } from "portal-shared/dataProviders/notificationProvider"; -import { getResetServices } from "@/services/index"; -import useUploader from "@/features/uploadManager/hooks/useUploader"; +import restDataProvider from "@refinedev/simple-rest"; +import { Skeleton } from "portal-shared/components/ui/skeleton"; +import { Toaster } from "portal-shared/components/ui/toaster"; import { createAccountProvider } from "portal-shared/dataProviders/accountProvider"; +import { notificationProvider } from "portal-shared/dataProviders/notificationProvider"; import { useAuthProvider } from "portal-shared/hooks/useAuthProvider"; -import { useAppInitialization } from "@/hooks/useAppInitialization"; +import useSdk from "portal-shared/hooks/useSdk"; import { withTheme } from "portal-shared/hooks/useTheme"; -import { Skeleton } from "portal-shared/components/ui/skeleton"; -import restDataProvider from "@refinedev/simple-rest"; -import { createServiceProvider } from "@/dataProviders/serviceProvider"; -import { SERVICE_ROUTE } from "@/routeConfig"; export const links: LinksFunction = () => [ { rel: "stylesheet", href: stylesheet }, + { rel: "icon", href: "/favicon.svg" }, ]; export function Layout({ children }: { children: React.ReactNode }) { diff --git a/apps/portal-dashboard/app/routes/account/components/BillingAddressComboBox.tsx b/apps/portal-dashboard/app/routes/account/components/BillingAddressComboBox.tsx index 90c560213..b1f5bf60b 100644 --- a/apps/portal-dashboard/app/routes/account/components/BillingAddressComboBox.tsx +++ b/apps/portal-dashboard/app/routes/account/components/BillingAddressComboBox.tsx @@ -1,15 +1,6 @@ -import React, { useState, useEffect } from "react"; -import { - useController, - Control, - FieldPath, - FieldValues, -} from "react-hook-form"; -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "portal-shared/components/ui/popover"; +import type { GetListResponse } from "@refinedev/core"; +import type { QueryObserverResult } from "@tanstack/react-query"; +import { Check, ChevronsUpDown } from "lucide-react"; import { Button } from "portal-shared/components/ui/button"; import { Command, @@ -27,11 +18,20 @@ import { FormMessage, } from "portal-shared/components/ui/form"; import { Input } from "portal-shared/components/ui/input"; -import { cn } from "portal-shared/lib/utils"; -import { Check, ChevronsUpDown } from "lucide-react"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "portal-shared/components/ui/popover"; import { Skeleton } from "portal-shared/components/ui/skeleton"; -import { GetListResponse } from "@refinedev/core"; -import type { QueryObserverResult } from "@tanstack/react-query"; +import { cn } from "portal-shared/lib/utils"; +import React, { useState, useEffect } from "react"; +import { + type Control, + type FieldPath, + type FieldValues, + useController, +} from "react-hook-form"; interface ComboBoxProps { name: FieldPath; @@ -92,7 +92,7 @@ export function BillingAddressComboBox({ role="combobox" disabled={disabled || isLoading} className={cn( - "w-full justify-between", + "w-full justify-between bg-secondary border border-input h-14", !field.value && "text-muted-foreground", )}> {isLoading ? ( diff --git a/apps/portal-dashboard/app/routes/account/components/BillingInformation.tsx b/apps/portal-dashboard/app/routes/account/components/BillingInformation.tsx index 1be526bb9..6b80ca1ee 100644 --- a/apps/portal-dashboard/app/routes/account/components/BillingInformation.tsx +++ b/apps/portal-dashboard/app/routes/account/components/BillingInformation.tsx @@ -1,6 +1,8 @@ -import React, { useEffect, useState } from "react"; -import { useForm } from "react-hook-form"; +import useBillingInfo from "@/routes/account/hooks/useBillingInfo"; +import useSubmitBillingInfo from "@/routes/account/hooks/useSubmitBillingInfo"; import { zodResolver } from "@hookform/resolvers/zod"; +import { useList } from "@refinedev/core"; +import { Button } from "portal-shared/components/ui/button"; import { Card, CardContent, @@ -17,20 +19,19 @@ import { FormMessage, } from "portal-shared/components/ui/form"; import { Input } from "portal-shared/components/ui/input"; -import { Textarea } from "portal-shared/components/ui/textarea"; -import { Button } from "portal-shared/components/ui/button"; import { Skeleton } from "portal-shared/components/ui/skeleton"; -import useBillingInfo from "@/routes/account/hooks/useBillingInfo"; -import useSubmitBillingInfo from "@/routes/account/hooks/useSubmitBillingInfo"; +import { Textarea } from "portal-shared/components/ui/textarea"; +import React, { useEffect, useState } from "react"; +import { useForm } from "react-hook-form"; +import { isValid } from "zod"; +import { BillingAddressComboBox, type Entry } from "./BillingAddressComboBox"; import { + type BillingInfoFields, + type EntityCode, + type FieldName, createBillingInfoSchema, - EntityCode, - FieldName, fieldMapping, - BillingInfoFields, } from "./BillingInformation.schema"; -import { useList } from "@refinedev/core"; -import { BillingAddressComboBox, Entry } from "./BillingAddressComboBox"; type FormFields = { [K in keyof BillingInfoFields]: string; @@ -47,7 +48,7 @@ export default function BillingInformation() { const { data: countryData } = useCountryList(); const form = useForm({ - resolver: zodResolver(createBillingInfoSchema(supportedEntities)), + resolver: zodResolver(createBillingInfoSchema([])), defaultValues: { name: "", country: "", @@ -71,6 +72,9 @@ export default function BillingInformation() { ], }); + + console.log({ formState: form.formState, errors: form.formState.errors }); + useEffect(() => { if (billingInfo && !isInitialized) { console.log("Billing info loaded:", billingInfo); @@ -87,7 +91,7 @@ export default function BillingInformation() { const entities = (selectedCountryData?.supported_entities || []) as EntityCode[]; setSupportedEntities(entities); - form.reset(form.getValues(), { keepValues: true }); + // form.reset(form.getValues(), { keepValues: true }); }, [form.watch("country"), countryData]); const onSubmit = async (data: FormFields) => { @@ -203,7 +207,7 @@ export default function BillingInformation() { }; return ( - + Billing Information diff --git a/apps/portal-dashboard/app/routes/account/components/PricingPlans.tsx b/apps/portal-dashboard/app/routes/account/components/PricingPlans.tsx index efbc0cce3..523f90c7f 100644 --- a/apps/portal-dashboard/app/routes/account/components/PricingPlans.tsx +++ b/apps/portal-dashboard/app/routes/account/components/PricingPlans.tsx @@ -1,19 +1,6 @@ -// src/components/PricingPlans.tsx -import React, { useEffect, useState } from "react"; -import { - Carousel, - CarouselContent, - CarouselItem, - CarouselNext, - CarouselPrevious, -} from "portal-shared/components/ui/carousel"; -import { - Card, - CardContent, - CardHeader, - CardTitle, -} from "portal-shared/components/ui/card"; -import { Button } from "portal-shared/components/ui/button"; +import SubscribePayment from "@/routes/account/components/SubscribePayment"; +import { useSubscriptionContext } from "@/routes/account/contexts/SubscriptionContext.js"; +import { CloudIcon, CloudUploadIcon, DownloadIcon } from "portal-shared/components/icons"; import { AlertDialog, AlertDialogAction, @@ -24,14 +11,24 @@ import { AlertDialogHeader, AlertDialogTitle, } from "portal-shared/components/ui/alert-dialog"; +import { Button } from "portal-shared/components/ui/button"; +import { + Card, + CardContent, + CardHeader, + CardTitle, +} from "portal-shared/components/ui/card"; +import { Progress } from "portal-shared/components/ui/progress"; import { Skeleton } from "portal-shared/components/ui/skeleton"; +import type { SubscriptionPlan, SubscriptionResponse } from "portal-shared/dataProviders/accountProvider"; +import useOnFreePlan from "portal-shared/hooks/useOnFreePlan"; import { cn } from "portal-shared/util/cn.js"; import filesize from "portal-shared/util/filesize.js"; -import { SubscriptionPlan } from "portal-shared/dataProviders/accountProvider"; -import { useSubscriptionContext } from "@/routes/account/contexts/SubscriptionContext.js"; -import useOnFreePlan from "portal-shared/hooks/useOnFreePlan"; -import SubscribePayment from "@/routes/account/components/SubscribePayment"; +import { useEffect, useState } from "react"; + + +// TODO(@pcfreak30): Changing plan is buggy when PAID_BILLING is disabled. It is requesting that the billing information is complete when it is not needed. export default function PricingPlans() { const { subscription, @@ -48,7 +45,7 @@ export default function PricingPlans() { const [showPaymentDialog, setShowPaymentDialog] = useState(false); const paymentExpired = - new Date(subscription?.payment_info?.payment_expires!) <= new Date(); + new Date(subscription?.payment_info?.payment_expires ?? "") <= new Date(); const planPending = subscription?.plan?.status === "PENDING"; const showPayment = !!subscription?.payment_info?.payment_id && @@ -67,10 +64,6 @@ export default function PricingPlans() { const onFreePlan = useOnFreePlan(); - const formatStorage = (storage: number) => filesize(storage, 0).toUpperCase(); - const formatBandwidth = (bandwidth: number) => - filesize(bandwidth, 0).toUpperCase(); - const handleChoosePlan = (plan: SubscriptionPlan) => { handlePlanSelection(plan); if (!isBillingComplete) { @@ -97,100 +90,87 @@ export default function PricingPlans() { if (paymentExpired && planPending) { submitPlanChange(subscription?.plan); } - }, [paymentExpired, planPending]); - - const getChangeType = ( - currentPlan: SubscriptionPlan, - newPlan: SubscriptionPlan, - ) => { - if (onFreePlan) { - return "Subscribe"; - } - - const currentIndex = plans.findIndex( - (p: { identifier: string }) => p.identifier === currentPlan.identifier, - ); - const newIndex = plans.findIndex( - (p: { identifier: string }) => p.identifier === newPlan.identifier, - ); - return newIndex > currentIndex ? "Upgrade" : "Downgrade"; - }; - - const renderPlanCard = (plan: SubscriptionPlan) => ( - - - - {plan.name} - -
- ${plan.price} - - /{plan.period === "MONTH" ? "month" : "year"} - -
-
- -
    -
  • Storage: {formatStorage(plan.storage)}
  • -
  • Upload: {formatBandwidth(plan.upload)}/month
  • -
  • Download: {formatBandwidth(plan.download)}/month
  • -
- {!subscription?.plan && ( - - )} - {subscription?.plan && - plan.identifier !== subscription.plan.identifier && ( - - )} - {plan.identifier === subscription?.plan?.identifier && ( -
- {planPending ? "Pending Plan" : "Current Plan"} -
- )} -
-
- ); + }, [paymentExpired, planPending, submitPlanChange, subscription?.plan]); if (isLoading || isPlanChanging) { return ( - - - {[...Array(3)].map((_, index) => ( - - - - ))} - - - - +
+ +
+ + +
+
); } + const plan = subscription?.plan; + // TODO(@pcfreak30): Get actual storage used + const storageUsed = 1000000000; // This is in bytes + const storagePercent = plan ? (storageUsed / (plan?.storage ?? 0)) * 100 : 0; return ( <> - - - {plans.map( - (plan: SubscriptionPlan, index: React.Key | null | undefined) => ( - + + Current Plan: {plan.name} +
+ ${plan?.price}/{plan?.period === "MONTH" ? "mo" : "yr"} +
+
+ +
+
+
+ Storage Used + {formatStorage(storageUsed)} / {formatStorage(plan.storage)} +
+ + {storagePercent > 80 && ( +

+ Running low on storage! Consider upgrading. +

+ )} +
+
+
+
+ )} + {!subscription ? ( +
+ + + +
+ ) : ( +
+ {plans.map((plan, index) => ( +
-
{renderPlanCard(plan)}
- - ), - )} - - - - + }, + { + "md:col-span-3": index === plans.length - 1 && plans.length % 3 === 1, + "md:col-span-2": index === plans.length - 1 && plans.length % 3 === 2, + } + )}> + +
+ ))} +
+ )} @@ -216,7 +196,7 @@ export default function PricingPlans() { {subscription?.plan && selectedPlan - ? `Are you sure you want to ${getChangeType(subscription.plan, selectedPlan)} to the ${selectedPlan?.name} plan?` + ? `Are you sure you want to ${onFreePlan ? "Subscribe" : selectedPlan.price > subscription.plan.price ? "Upgrade" : "Downgrade"} to the ${selectedPlan?.name} plan?` : `Are you sure you want to subscribe to the ${selectedPlan?.name} plan?`} @@ -232,3 +212,74 @@ export default function PricingPlans() { ); } + +const formatStorage = (storage: number) => filesize(storage, 0).toUpperCase(); +const formatBandwidth = (bandwidth: number) => filesize(bandwidth, 0).toUpperCase(); + +function PlanCard(props: { + plan: SubscriptionPlan; + subscription: SubscriptionResponse; + selectedPlan: SubscriptionPlan | null; + onChoosePlan: (plan: SubscriptionPlan) => void; + onFreePlan: boolean; +}) { + const { plan, subscription, onChoosePlan, onFreePlan } = props; + const getChangeType = (currentPlan: SubscriptionPlan, newPlan: SubscriptionPlan) => { + if (onFreePlan) { + return "Subscribe"; + } + + return newPlan.price > currentPlan.price ? "Upgrade" : "Downgrade"; + }; + + const planPending = subscription?.plan?.status === "PENDING"; + + return ( + + + + {plan.name} + +
+ ${plan.price} + + /{plan.period === "MONTH" ? "month" : "year"} + +
+
+ +
+
+ + Storage: {formatStorage(plan.storage)} +
+
+ + Upload: {formatBandwidth(plan.upload)}/month +
+
+ + Download: {formatBandwidth(plan.download)}/month +
+
+ + {!subscription?.plan && ( + + )} + {subscription?.plan && + plan.identifier !== subscription.plan.identifier && ( + + )} + {plan.identifier === subscription?.plan?.identifier && ( +
+ {planPending ? "Pending Plan" : "Current Plan"} +
+ )} +
+
+ ); +} \ No newline at end of file diff --git a/apps/portal-dashboard/app/routes/account/subscription.tsx b/apps/portal-dashboard/app/routes/account/subscription.tsx index dc506114b..8625ce4a8 100644 --- a/apps/portal-dashboard/app/routes/account/subscription.tsx +++ b/apps/portal-dashboard/app/routes/account/subscription.tsx @@ -1,16 +1,18 @@ +import { useSearchParams } from "@remix-run/react"; +import { Skeleton } from "portal-shared/components/ui/skeleton"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "portal-shared/components/ui/tabs"; +import useIsPaidBillingEnabled from "portal-shared/hooks/useIsPaidBillingEnabled"; +import useOnFreePlan from "portal-shared/hooks/useOnFreePlan"; import React from "react"; -import PricingPlans from "./components/PricingPlans"; -import PaymentHistory from "./components/PaymentHistory"; -import ChangePaymentMethod from "./components/ChangePaymentMethod"; import Addons from "./components/Addons"; import BillingInformation from "./components/BillingInformation"; -import { Skeleton } from "portal-shared/components/ui/skeleton"; +import ChangePaymentMethod from "./components/ChangePaymentMethod"; +import PaymentHistory from "./components/PaymentHistory"; +import PricingPlans from "./components/PricingPlans"; import { SubscriptionProvider, useSubscriptionContext, } from "./contexts/SubscriptionContext"; -import useIsPaidBillingEnabled from "portal-shared/hooks/useIsPaidBillingEnabled"; -import useOnFreePlan from "portal-shared/hooks/useOnFreePlan"; export default function Subscription() { return ( @@ -19,31 +21,63 @@ export default function Subscription() { ); } +const TABS = { + BILLING: "billing", + PAYMENT_HISTORY: "payment-history", + PAYMENT_METHOD: "payment-method", + ADDONS: "addons", +} as const; function SubscriptionContent() { const { isLoading } = useSubscriptionContext(); + const [searchParams, setSearchParams] = useSearchParams(); const paidBillingEnabled = useIsPaidBillingEnabled(); const onFreePlan = useOnFreePlan(); + const searchTab = TABS[searchParams.get("tab") as keyof typeof TABS] ?? TABS.BILLING; if (isLoading) return ; return ( -
+
-
- {paidBillingEnabled && !onFreePlan && } - {paidBillingEnabled && !onFreePlan && } - {false && } +
+ setSearchParams({ tab: value })} className="space-y-4"> + + {paidBillingEnabled && Billing Information} + {paidBillingEnabled && !onFreePlan && Payment History} + {paidBillingEnabled && !onFreePlan && Payment Method} + {false && Add-ons} + + + {paidBillingEnabled && !onFreePlan && ( + + + + )} + + {paidBillingEnabled && !onFreePlan && ( + + + + )} + + {paidBillingEnabled && ( + + + + )} + + {false && ( + + + + )} +
- {paidBillingEnabled && ( -
- -
- )}
); } diff --git a/apps/portal-dashboard/public/favicon.ico b/apps/portal-dashboard/public/favicon.ico deleted file mode 100644 index 8830cf682..000000000 Binary files a/apps/portal-dashboard/public/favicon.ico and /dev/null differ diff --git a/apps/portal-dashboard/public/favicon.svg b/apps/portal-dashboard/public/favicon.svg new file mode 100644 index 000000000..ad46205dd --- /dev/null +++ b/apps/portal-dashboard/public/favicon.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/libs/portal-shared/src/components/MainNavigation.tsx b/libs/portal-shared/src/components/MainNavigation.tsx index 0c6bdbdf9..4e3844bf3 100644 --- a/libs/portal-shared/src/components/MainNavigation.tsx +++ b/libs/portal-shared/src/components/MainNavigation.tsx @@ -1,20 +1,22 @@ -import React, { createElement } from "react"; -import { useLocation } from "@remix-run/react"; import { Navigation, NavigationItem, NavigationItemContent, NavigationSubItem, } from "@/components/ui/navigation-menu"; -import { MenuItem } from "apps/portal-dashboard/app/types"; -import useMenuItems from "@/hooks/useMenuItems"; import useIsBillingEnabled from "@/hooks/useIsBillingEnabled"; +import useMenuItems from "@/hooks/useMenuItems"; +import type { MenuItem } from "@/types"; +import { useMatches } from "@remix-run/react"; +import type React from "react"; +import { createElement } from "react"; const NavItem: React.FC<{ item: MenuItem; active: boolean }> = ({ item, active, }) => { const billingEnable = useIsBillingEnabled(); + const matches = useMatches(); return ( @@ -35,21 +37,24 @@ const NavItem: React.FC<{ item: MenuItem; active: boolean }> = ({ return true; }) - ?.map((child) => ( - + ?.map((child) => { + const isActive = child.path ? matches.some((match) => match.pathname.startsWith(child.path)) : false; + return ( + {child.label} - ))} + )})} ); }; export const MainNavigation: React.FC = () => { - const location = useLocation(); + const matches = useMatches(); const menu = useMenuItems(); const renderMenuItem = (item: MenuItem) => { - const isActive = location.pathname.startsWith(item.path!); + const paths = item.path === "/" ? ["/dashboard"] : [item.path, ...(item.children?.map(child => child.path) ?? [])]; + const isActive = matches.some((match) => paths.some(path => match.pathname.startsWith(path))); return ; }; diff --git a/libs/portal-shared/src/components/icons.tsx b/libs/portal-shared/src/components/icons.tsx index 6bc0a4f2d..7b823dffc 100644 --- a/libs/portal-shared/src/components/icons.tsx +++ b/libs/portal-shared/src/components/icons.tsx @@ -1,714 +1,747 @@ export const InfoIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const AddIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const RemoveIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const CloudIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const CloudDownloadIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const CloudUploadIcon = ({ className }: { className?: string }) => { - return ( - - - - - - - - - - - ); + return ( + + + + + + + + + + + ); }; export const CloudUploadSolidIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const CrownIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const PersonIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const CheckRoundedIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const ClockIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const CircleLockIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const DriveIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const PageIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const TrashIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const CloudCheckIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const BoxCheckedIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const PictureIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const XlsxIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const FileIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const CloudSelectIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const MoreIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const FingerPrintIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const EditIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const ThemeIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const ChevronDownIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const FolderIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const RecentIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const ExclamationCircleIcon = ({ - className, + className, }: { - className?: string; + className?: string; }) => { - return ( - - ); + return ( + + ); }; export const DownloadIcon = ({ className }: { className?: string }) => { - return ( - - ); + return ( + + ); }; export const CurrentUsageIcon = ({ className }: { className?: string }) => { - return ( - - - - ); + return ( + + + + ); }; export const FilesIcon = ({ className }: { className?: string }) => { - return ( - - - - ); + return ( + + + + ); }; export const HamburgerMenuIcon = ({ className }: { className?: string }) => { - return ( - - - - - - ); + return ( + + + + + + ); }; diff --git a/libs/portal-shared/src/components/ui/card.tsx b/libs/portal-shared/src/components/ui/card.tsx index 75cc36980..b0132d7c5 100644 --- a/libs/portal-shared/src/components/ui/card.tsx +++ b/libs/portal-shared/src/components/ui/card.tsx @@ -9,7 +9,7 @@ const Card = React.forwardRef<
0; const isOpen = _isOpen || active; const itemContent = ( -
{href ? ( @@ -88,13 +90,13 @@ export function NavigationItem({ initial={{ height: 0, opacity: 0 }} animate={{ height: "auto", opacity: 1 }} exit={{ height: 0, opacity: 0 }} - transition={{ duration: 0.5 }} + transition={{ duration: 0.1 }} className="ml-4 mt-1 space-y-1 overflow-hidden"> {subItems} )} -
+ ); return
{itemContent}
; @@ -103,12 +105,14 @@ export function NavigationItem({ export function NavigationItemContent({ children, }: NavigationItemContentProps) { - return
{children}
; + return
{children}
; } -export function NavigationSubItem({ children, href }: NavigationSubItemProps) { +export function NavigationSubItem({ children, href, active }: NavigationSubItemProps) { const content = ( -
+
{children}
); diff --git a/libs/portal-shared/src/components/ui/progress.tsx b/libs/portal-shared/src/components/ui/progress.tsx index 3c88a1c3c..51eb611f8 100644 --- a/libs/portal-shared/src/components/ui/progress.tsx +++ b/libs/portal-shared/src/components/ui/progress.tsx @@ -1,5 +1,5 @@ -import * as React from "react"; import * as ProgressPrimitive from "@radix-ui/react-progress"; +import * as React from "react"; import { cn } from "@/lib/utils"; @@ -17,7 +17,7 @@ const Progress = React.forwardRef< diff --git a/libs/portal-shared/src/components/ui/tabs.tsx b/libs/portal-shared/src/components/ui/tabs.tsx index 7d8d5e222..3e1e90991 100644 --- a/libs/portal-shared/src/components/ui/tabs.tsx +++ b/libs/portal-shared/src/components/ui/tabs.tsx @@ -1,5 +1,5 @@ -import * as React from "react"; import * as TabsPrimitive from "@radix-ui/react-tabs"; +import * as React from "react"; import { cn } from "@/lib/utils"; @@ -27,7 +27,7 @@ const TabsTrigger = React.forwardRef< ( return (