From 0211e61f124abcf29678833a0a84ac1fc6e62b97 Mon Sep 17 00:00:00 2001 From: sadmann7 Date: Sat, 20 Apr 2024 20:00:00 +0600 Subject: [PATCH 1/3] feat: update button size --- .../dashboard/stores/_components/add-store-dialog.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/(dashboard)/dashboard/stores/_components/add-store-dialog.tsx b/src/app/(dashboard)/dashboard/stores/_components/add-store-dialog.tsx index e8241f08..e68ccc32 100644 --- a/src/app/(dashboard)/dashboard/stores/_components/add-store-dialog.tsx +++ b/src/app/(dashboard)/dashboard/stores/_components/add-store-dialog.tsx @@ -305,7 +305,10 @@ function DynamicTrigger({ return ( - @@ -357,14 +360,14 @@ function DynamicTrigger({ if (isDesktop) { return ( - + ) } return ( - + ) } From 1cbcbab6d42426339f09e50477ea3e2d24508e3a Mon Sep 17 00:00:00 2001 From: sadmann7 Date: Sun, 21 Apr 2024 04:03:30 +0600 Subject: [PATCH 2/3] feat: rate limit users based on subscription plan --- pnpm-lock.yaml | 6 +- .../dashboard/_components/store-switcher.tsx | 20 +-- .../_components/user-profile.tsx | 16 +- .../account/{ => [[...rest]]}/loading.tsx | 0 .../account/{ => [[...rest]]}/page.tsx | 8 +- .../dashboard/billing/_components/billing.tsx | 20 +-- .../(dashboard)/dashboard/billing/page.tsx | 6 +- src/app/(dashboard)/dashboard/layout.tsx | 8 +- ...ore-dialog.tsx => create-store-dialog.tsx} | 156 ++++++++---------- src/app/(dashboard)/dashboard/stores/page.tsx | 11 +- .../_components/category-card-skeleton.tsx | 10 +- src/app/(lobby)/_components/category-card.tsx | 25 +-- src/components/layouts/sidebar-nav.tsx | 5 + src/components/ui/command.tsx | 2 +- src/components/ui/toaster.tsx | 6 +- src/lib/actions/product.ts | 16 +- src/lib/queries/user.ts | 13 +- src/middleware.ts | 7 +- 18 files changed, 156 insertions(+), 179 deletions(-) rename src/app/(dashboard)/dashboard/account/{ => [[...rest]]}/_components/user-profile.tsx (52%) rename src/app/(dashboard)/dashboard/account/{ => [[...rest]]}/loading.tsx (100%) rename src/app/(dashboard)/dashboard/account/{ => [[...rest]]}/page.tsx (75%) rename src/app/(dashboard)/dashboard/stores/_components/{add-store-dialog.tsx => create-store-dialog.tsx} (68%) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 239ee8d7..2e4b8860 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -267,7 +267,7 @@ devDependencies: version: 7.4.1 drizzle-kit: specifier: ^0.20.16 - version: 0.20.16 + version: 0.20.17 eslint: specifier: ^8.57.0 version: 8.57.0 @@ -6324,8 +6324,8 @@ packages: wordwrap: 1.0.0 dev: true - /drizzle-kit@0.20.16: - resolution: {integrity: sha512-WoqV0XDny8mHnVoLYcUs6H3Ae1HBxeV0zi3VXG/mTahIQYfadZmIc3eRqzXjD3yxemj+GdHI1nThddmsoabdIA==} + /drizzle-kit@0.20.17: + resolution: {integrity: sha512-mLVDS4nXmO09wFVlzGrdshWnAL+U9eQGC5zRs6hTN6Q9arwQGWU2XnZ17I8BM8Quau8CQRx3Ms6VPgRWJFVp7Q==} hasBin: true dependencies: '@esbuild-kit/esm-loader': 2.6.5 diff --git a/src/app/(dashboard)/dashboard/_components/store-switcher.tsx b/src/app/(dashboard)/dashboard/_components/store-switcher.tsx index 9b556128..95605fe9 100644 --- a/src/app/(dashboard)/dashboard/_components/store-switcher.tsx +++ b/src/app/(dashboard)/dashboard/_components/store-switcher.tsx @@ -10,7 +10,7 @@ import { } from "@radix-ui/react-icons" import { type getStoresByUserId } from "@/lib/actions/store" -import { type getProgress } from "@/lib/queries/user" +import { type getUserPlanMetrics } from "@/lib/queries/user" import { cn } from "@/lib/utils" import { Button } from "@/components/ui/button" import { @@ -28,19 +28,19 @@ import { PopoverTrigger, } from "@/components/ui/popover" -import { AddStoreDialog } from "../stores/_components/add-store-dialog" +import { CreateStoreDialog } from "../stores/_components/create-store-dialog" interface StoreSwitcherProps extends React.ComponentPropsWithoutRef { userId: string storesPromise: ReturnType - progressPromise: ReturnType + planMetricsPromise: ReturnType } export function StoreSwitcher({ userId, storesPromise, - progressPromise, + planMetricsPromise, className, ...props }: StoreSwitcherProps) { @@ -51,15 +51,15 @@ export function StoreSwitcher({ const [showNewStoreDialog, setShowNewStoreDialog] = React.useState(false) const stores = React.use(storesPromise) - const progress = React.use(progressPromise) + const planMetrics = React.use(planMetricsPromise) const selectedStore = stores.find((store) => store.id === storeId) return ( <> - {selectedStore?.name ?? "Select a store"}