From d9445fdd04421bbcf562c79c9c53b8871b56efab Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:04:09 +0100 Subject: [PATCH 001/104] clean: clean Signed-off-by: Destiny Saturday --- .github/workflows/clean-cicd.yml | 68 -------------------------------- 1 file changed, 68 deletions(-) delete mode 100644 .github/workflows/clean-cicd.yml diff --git a/.github/workflows/clean-cicd.yml b/.github/workflows/clean-cicd.yml deleted file mode 100644 index 3a5d749b8..000000000 --- a/.github/workflows/clean-cicd.yml +++ /dev/null @@ -1,68 +0,0 @@ - -name: Clean CI/CD Pipeline - -on: - push: - branches: - - clean - paths-ignore: - - .github/workflows/** - -concurrency: - group: ${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: "20" - - - name: Cache pnpm modules - uses: actions/cache@v3 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm- - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Install dependencies - run: pnpm install - - - name: Lint code - run: pnpm lint - - - name: Build email - run: pnpm email:build - - - name: Build project - run: pnpm build - - - name: Run tests - run: pnpm run test:ci - - deploy: - runs-on: ubuntu-latest - needs: build - - steps: - - name: Deploy to dev environment - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} - script: | - ./deploy_dev.sh next \ No newline at end of file From 89298d4eaf00c1659b3b84e3b2fbb4a10cc3aa64 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:06:37 +0100 Subject: [PATCH 002/104] Delete .github/workflows/checks.PR.yml Signed-off-by: Destiny Saturday --- .github/workflows/checks.PR.yml | 40 --------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 .github/workflows/checks.PR.yml diff --git a/.github/workflows/checks.PR.yml b/.github/workflows/checks.PR.yml deleted file mode 100644 index 5c5978f18..000000000 --- a/.github/workflows/checks.PR.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: PR Checks - -on: - pull_request: - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - run: pnpm install - - name: "Test" - run: pnpm run test:ci -- --max-warnings 0 - - name: "Upload Coverage" - uses: actions/upload-artifact@v4 - with: - name: coverage - path: coverage - eslint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - run: pnpm install - - uses: reviewdog/action-eslint@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - fail_on_error: true - eslint_flags: ". --ext js,jsx,ts,tsx --ignore-path=.gitignore --max-warnings 0" From b59ac27142b5263f1f47c5fa0b97298bf26a4096 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:11:11 +0100 Subject: [PATCH 003/104] Update and rename coverage.PR.yml to coverage-report.yml Signed-off-by: Destiny Saturday --- .github/workflows/{coverage.PR.yml => coverage-report.yml} | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename .github/workflows/{coverage.PR.yml => coverage-report.yml} (81%) diff --git a/.github/workflows/coverage.PR.yml b/.github/workflows/coverage-report.yml similarity index 81% rename from .github/workflows/coverage.PR.yml rename to .github/workflows/coverage-report.yml index 2cfb02af8..9aabe5dfc 100644 --- a/.github/workflows/coverage.PR.yml +++ b/.github/workflows/coverage-report.yml @@ -1,8 +1,8 @@ -name: PR Checks - Report Coverage +name: Coverage Report on: workflow_run: - workflows: ["PR Checks"] + workflows: ["CI Build, Lint, and Test"] types: - completed @@ -19,6 +19,6 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ github.event.workflow_run.id }} - - name: "Report Coverage" + - name: "Coverage Report" if: always() uses: davelosert/vitest-coverage-report-action@v2 From 98f4b7a68f27d27e6e0afa9a2d1a86cc0f19c47e Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:15:00 +0100 Subject: [PATCH 004/104] Update and rename test.yml to ci-build-lint-test.yml Signed-off-by: Destiny Saturday --- .github/workflows/ci-build-lint-test.yml | 45 ++++++++++++++++++++++++ .github/workflows/test.yml | 41 --------------------- 2 files changed, 45 insertions(+), 41 deletions(-) create mode 100644 .github/workflows/ci-build-lint-test.yml delete mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/ci-build-lint-test.yml b/.github/workflows/ci-build-lint-test.yml new file mode 100644 index 000000000..ad594bb11 --- /dev/null +++ b/.github/workflows/ci-build-lint-test.yml @@ -0,0 +1,45 @@ +name: CI Build, Lint, and Test + +on: + pull_request + +jobs: + build_lint_test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: "20" + + - name: Cache pnpm modules + uses: actions/cache@v3 + with: + path: ~/.pnpm-store + key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm- + + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + + - name: Install dependencies + run: pnpm install + + - name: Lint code + run: pnpm lint + + - name: Build email + run: pnpm email:build + + - name: Build project + run: pnpm build + + - name: Run tests + run: pnpm run test:ci diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 256efa5bd..000000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Checks - -on: - push: - branches: - - main - - dev - - staging - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - run: pnpm install - - name: "Test" - run: pnpm run test:ci - - eslint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 18 - - uses: pnpm/action-setup@v4 - with: - version: 9 - - run: pnpm install - - uses: reviewdog/action-eslint@v1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - fail_on_error: true - reporter: github-pr-check - eslint_flags: ". --ext js,jsx,ts,tsx --ignore-path=.gitignore --max-warnings 0" From ae4584fb204ce5b346afd214028c9860fb61d020 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:20:36 +0100 Subject: [PATCH 005/104] Update and rename dev-cicd.yml to dev-deployment.yml Signed-off-by: Destiny Saturday --- .github/workflows/dev-cicd.yml | 68 ---------------------------- .github/workflows/dev-deployment.yml | 27 +++++++++++ 2 files changed, 27 insertions(+), 68 deletions(-) delete mode 100644 .github/workflows/dev-cicd.yml create mode 100644 .github/workflows/dev-deployment.yml diff --git a/.github/workflows/dev-cicd.yml b/.github/workflows/dev-cicd.yml deleted file mode 100644 index 0f265d782..000000000 --- a/.github/workflows/dev-cicd.yml +++ /dev/null @@ -1,68 +0,0 @@ - -name: Development CI/CD Pipeline - -on: - push: - branches: - - dev - paths-ignore: - - .github/workflows/** - -concurrency: - group: ${{ github.ref }} - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: "20" - - - name: Cache pnpm modules - uses: actions/cache@v3 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm- - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Install dependencies - run: pnpm install - - - name: Lint code - run: pnpm lint - - - name: Build email - run: pnpm email:build - - - name: Build project - run: pnpm build - - - name: Run tests - run: pnpm run test:ci - - deploy: - runs-on: ubuntu-latest - needs: build - - steps: - - name: Deploy to dev environment - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} - script: | - ./deploy_dev.sh next diff --git a/.github/workflows/dev-deployment.yml b/.github/workflows/dev-deployment.yml new file mode 100644 index 000000000..b29a0eac6 --- /dev/null +++ b/.github/workflows/dev-deployment.yml @@ -0,0 +1,27 @@ +name: Dev Deployment + +on: + push: + branches: + - dev + paths-ignore: + - .github/workflows/** + +jobs: + deploy_to_dev: + if: github.event.repository.fork == false + runs-on: ubuntu-latest + + environment: + name: "dev" + url: ${{ vars.URL }} + + steps: + - name: Deploy to dev environment + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + script: | + ./deploy_dev.sh next From b1f23a477d00926f9296c5b1b2208bc55e8d1552 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:24:08 +0100 Subject: [PATCH 006/104] Update prod-cicd.yml Signed-off-by: Destiny Saturday --- .github/workflows/prod-cicd.yml | 56 +++++---------------------------- 1 file changed, 8 insertions(+), 48 deletions(-) diff --git a/.github/workflows/prod-cicd.yml b/.github/workflows/prod-cicd.yml index d9123984a..2db3074fb 100644 --- a/.github/workflows/prod-cicd.yml +++ b/.github/workflows/prod-cicd.yml @@ -1,4 +1,4 @@ -name: Production CI/CD Pipeline +name: Production Deployment on: push: @@ -7,61 +7,21 @@ on: paths-ignore: - .github/workflows/** -concurrency: - group: ${{ github.ref }} - cancel-in-progress: true - jobs: - build: + deploy_to_production: + if: github.event.repository.fork == false runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: "20" - - - name: Cache pnpm modules - uses: actions/cache@v3 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm- - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Install dependencies - run: pnpm install - - - name: Lint code - run: pnpm lint - - - name: Build email - run: pnpm email:build - - - name: Build project - run: pnpm build - - - name: Run tests - run: pnpm run test:ci - - deploy: - runs-on: ubuntu-latest - needs: build + environment: + name: "production" + url: ${{ vars.URL }} steps: - - name: Deploy to prod environment + - name: Deploy to production environment uses: appleboy/ssh-action@v1.0.3 with: host: ${{ secrets.HOST }} username: ${{ secrets.USERNAME }} password: ${{ secrets.PASSWORD }} script: | - ./deploy_prod.sh next \ No newline at end of file + ./deploy_prod.sh next From 923b17e6ea58f9b729a1de7830940e7cf3272693 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:25:12 +0100 Subject: [PATCH 007/104] Update staging-cicd.yml Signed-off-by: Destiny Saturday --- .github/workflows/staging-cicd.yml | 54 ++++-------------------------- 1 file changed, 7 insertions(+), 47 deletions(-) diff --git a/.github/workflows/staging-cicd.yml b/.github/workflows/staging-cicd.yml index 1dbd788e8..ed32fb66f 100644 --- a/.github/workflows/staging-cicd.yml +++ b/.github/workflows/staging-cicd.yml @@ -1,4 +1,4 @@ -name: Staging CI/CD Pipeline +name: Staging Deployment on: push: @@ -7,54 +7,14 @@ on: paths-ignore: - .github/workflows/** -concurrency: - group: ${{ github.ref }} - cancel-in-progress: true - jobs: - build: + deploy_to_staging: + if: github.event.repository.fork == false runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Node.js - uses: actions/setup-node@v3 - with: - node-version: "20" - - - name: Cache pnpm modules - uses: actions/cache@v3 - with: - path: ~/.pnpm-store - key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: | - ${{ runner.os }}-pnpm- - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 9 - - - name: Install dependencies - run: pnpm install - - - name: Lint code - run: pnpm lint - - - name: Build email - run: pnpm email:build - - - name: Build project - run: pnpm build - - - name: Run tests - run: pnpm run test:ci - - deploy: - runs-on: ubuntu-latest - needs: build + environment: + name: "staging" + url: ${{ vars.URL }} steps: - name: Deploy to staging environment @@ -64,4 +24,4 @@ jobs: username: ${{ secrets.USERNAME }} password: ${{ secrets.PASSWORD }} script: | - ./deploy_staging.sh next \ No newline at end of file + ./deploy_staging.sh next From fa8082834a61b793ca53860305f0ccb9e2e17255 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:25:29 +0100 Subject: [PATCH 008/104] Rename staging-cicd.yml to staging-deployment.yml Signed-off-by: Destiny Saturday --- .github/workflows/{staging-cicd.yml => staging-deployment.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{staging-cicd.yml => staging-deployment.yml} (100%) diff --git a/.github/workflows/staging-cicd.yml b/.github/workflows/staging-deployment.yml similarity index 100% rename from .github/workflows/staging-cicd.yml rename to .github/workflows/staging-deployment.yml From 54f5ed8c6d5f6694543483ed8790465917ce3b15 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:25:53 +0100 Subject: [PATCH 009/104] Rename prod-cicd.yml to production-deployment.yml Signed-off-by: Destiny Saturday --- .github/workflows/{prod-cicd.yml => production-deployment.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{prod-cicd.yml => production-deployment.yml} (100%) diff --git a/.github/workflows/prod-cicd.yml b/.github/workflows/production-deployment.yml similarity index 100% rename from .github/workflows/prod-cicd.yml rename to .github/workflows/production-deployment.yml From 7780993b8d802bc248650b7a4378530313a1e236 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:35:53 +0100 Subject: [PATCH 010/104] Create team-deployment.yaml Signed-off-by: Destiny Saturday --- .github/workflows/team-deployment.yaml | 30 ++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .github/workflows/team-deployment.yaml diff --git a/.github/workflows/team-deployment.yaml b/.github/workflows/team-deployment.yaml new file mode 100644 index 000000000..21f386f61 --- /dev/null +++ b/.github/workflows/team-deployment.yaml @@ -0,0 +1,30 @@ +name: Team Deployment + +on: + push: + branches: + - team-deploy + paths-ignore: + - .github/workflows/** + +jobs: + team_deployment: + if: github.event.repository.fork == false + runs-on: ubuntu-latest + strategy: + matrix: + environment: [kimiko, cyborgs, starlight] + + environment: + name: ${{ matrix.environment }} + url: ${{ secrets.URL }} + + steps: + - name: Deploy to ${{ matrix.environment }} environment + uses: appleboy/ssh-action@v1.0.3 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + script: | + ./deploy_${{ matrix.environment }}.sh From 23803cf10040389a4ace3cb3cdd6beaaa1226d41 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:36:11 +0100 Subject: [PATCH 011/104] Rename team-deployment.yaml to team-deployment.yml Signed-off-by: Destiny Saturday --- .github/workflows/{team-deployment.yaml => team-deployment.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{team-deployment.yaml => team-deployment.yml} (100%) diff --git a/.github/workflows/team-deployment.yaml b/.github/workflows/team-deployment.yml similarity index 100% rename from .github/workflows/team-deployment.yaml rename to .github/workflows/team-deployment.yml From 070cfa53eced93b98d21ac0f8dd53b9b0403dfe5 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:44:01 +0100 Subject: [PATCH 012/104] Update team-deployment.yml Signed-off-by: Destiny Saturday --- .github/workflows/team-deployment.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/team-deployment.yml b/.github/workflows/team-deployment.yml index 21f386f61..832a2c7b0 100644 --- a/.github/workflows/team-deployment.yml +++ b/.github/workflows/team-deployment.yml @@ -4,8 +4,6 @@ on: push: branches: - team-deploy - paths-ignore: - - .github/workflows/** jobs: team_deployment: From c3874009e7e83e4c188c7d02d306ed091ede9cea Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:46:21 +0100 Subject: [PATCH 013/104] Update team-deployment.yml Signed-off-by: Destiny Saturday --- .github/workflows/team-deployment.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/team-deployment.yml b/.github/workflows/team-deployment.yml index 832a2c7b0..8e4cfe1b1 100644 --- a/.github/workflows/team-deployment.yml +++ b/.github/workflows/team-deployment.yml @@ -15,14 +15,14 @@ jobs: environment: name: ${{ matrix.environment }} - url: ${{ secrets.URL }} + url: ${{ secrets["URL"] }} steps: - name: Deploy to ${{ matrix.environment }} environment uses: appleboy/ssh-action@v1.0.3 with: - host: ${{ secrets.HOST }} - username: ${{ secrets.USERNAME }} - password: ${{ secrets.PASSWORD }} + host: ${{ secrets["HOST"] }} + username: ${{ secrets["USERNAME"] }} + password: ${{ secrets["PASSWORD"] }} script: | ./deploy_${{ matrix.environment }}.sh From 7382111e6f70301ae266659c63bb35f86f29a5d2 Mon Sep 17 00:00:00 2001 From: Destiny Saturday Date: Sun, 28 Jul 2024 14:48:41 +0100 Subject: [PATCH 014/104] Update team-deployment.yml Signed-off-by: Destiny Saturday --- .github/workflows/team-deployment.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/team-deployment.yml b/.github/workflows/team-deployment.yml index 8e4cfe1b1..825e1d688 100644 --- a/.github/workflows/team-deployment.yml +++ b/.github/workflows/team-deployment.yml @@ -15,14 +15,10 @@ jobs: environment: name: ${{ matrix.environment }} - url: ${{ secrets["URL"] }} steps: - - name: Deploy to ${{ matrix.environment }} environment - uses: appleboy/ssh-action@v1.0.3 - with: - host: ${{ secrets["HOST"] }} - username: ${{ secrets["USERNAME"] }} - password: ${{ secrets["PASSWORD"] }} - script: | - ./deploy_${{ matrix.environment }}.sh + - name: Checkout code + uses: actions/checkout@v3 + + - name: Print Environment + run: echo "Current environment is ${{ matrix.environment }}" From 8dca4ccc8635880035d66a6257517b2016292471 Mon Sep 17 00:00:00 2001 From: Vxrcel Date: Sun, 28 Jul 2024 15:20:48 +0100 Subject: [PATCH 015/104] products modal --- .../_components/form-images/project-logo.tsx | 27 +- .../_components/new-product-modal.tsx | 332 ++++++++++-------- .../_components/product-body-shadcn.tsx | 2 +- .../products/_components/product-content.tsx | 18 +- .../_components/product-detail-modal.tsx | 2 +- .../_components/product-detail-view.tsx | 4 +- .../products/_components/schema/schema.ts | 13 +- 7 files changed, 222 insertions(+), 176 deletions(-) diff --git a/src/app/dashboard/(user-dashboard)/products/_components/form-images/project-logo.tsx b/src/app/dashboard/(user-dashboard)/products/_components/form-images/project-logo.tsx index 6d6202408..aa5009f02 100644 --- a/src/app/dashboard/(user-dashboard)/products/_components/form-images/project-logo.tsx +++ b/src/app/dashboard/(user-dashboard)/products/_components/form-images/project-logo.tsx @@ -1,8 +1,9 @@ -import { ImageIcon, X } from "lucide-react"; +import { X } from "lucide-react"; import React, { useState } from "react"; import { UseFormReturn } from "react-hook-form"; import BlurImage from "~/components/miscellaneous/blur-image"; +import { Button } from "~/components/ui/button"; import { cn } from "~/lib/utils"; import { NewProduct } from "../schema/schema"; @@ -39,10 +40,10 @@ const ProjectLogo = ({ form, name }: Properties) => { }; return ( -
+

@@ -94,23 +95,25 @@ const ProjectLogo = ({ form, name }: Properties) => { className="grid h-full w-full place-items-center" >

Add Image or drag it here

diff --git a/src/app/dashboard/(user-dashboard)/products/_components/new-product-modal.tsx b/src/app/dashboard/(user-dashboard)/products/_components/new-product-modal.tsx index d8ac48a4b..57132cddc 100644 --- a/src/app/dashboard/(user-dashboard)/products/_components/new-product-modal.tsx +++ b/src/app/dashboard/(user-dashboard)/products/_components/new-product-modal.tsx @@ -1,11 +1,10 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { AnimatePresence, motion } from "framer-motion"; -import { X } from "lucide-react"; +import { Loader, X } from "lucide-react"; import { useTransition } from "react"; import { useForm } from "react-hook-form"; import { z } from "zod"; -import LoadingSpinner from "~/components/miscellaneous/loading-spinner"; import WordCounter from "~/components/miscellaneous/WordCounter"; import { Button } from "~/components/ui/button"; import { @@ -34,6 +33,7 @@ import { CATEGORIES } from "../data/categories.moct"; import ProjectLogo from "./form-images/project-logo"; import { NewProductSchema } from "./schema/schema"; +const MAX_CHAR = 160; const NewProductModal = () => { const { setIsNewModal, isNewModal } = useProductModal(); const { addProduct } = useProducts(); @@ -87,7 +87,7 @@ const NewProductModal = () => {
setIsNewModal(false)} className={cn( - "fixed left-0 top-0 z-[99] min-h-screen w-full overflow-hidden bg-[rgba(10,10,10,0.40)] transition-all duration-300", + "fixed left-0 top-0 z-[9999] min-h-screen w-full overflow-hidden bg-[rgba(10,10,10,0.40)] transition-all duration-300", isNewModal ? "pointer-events-auto opacity-100" : "pointer-events-none opacity-0", @@ -110,14 +110,14 @@ const NewProductModal = () => { exit={{ ...variantProperties, opacity: 0, - scale: 2, + scale: 0.5, }} className={cn( - "fixed left-1/2 top-1/2 z-[999] grid h-[550px] w-full max-w-[95%] -translate-x-1/2 -translate-y-1/2 transform-gpu place-items-center items-center overflow-y-auto rounded-md bg-white pb-6 min-[500px]:max-w-[480px] min-[500px]:rounded-xl sm:h-[650px] lg:h-[800px] lg:max-w-[491px]", + "fixed left-1/2 top-1/2 z-[9999] grid h-fit max-h-[90%] w-full max-w-[95%] -translate-x-1/2 -translate-y-1/2 transform-gpu place-items-center items-center overflow-y-auto rounded-md bg-white pb-6 min-[500px]:max-w-[480px] min-[500px]:rounded-xl md:max-h-[850px] lg:h-fit lg:max-w-[491px]", )} >
-
+

Add a Product