From 40c45ed8d454294fa8d9053bbfbbe566adeadf13 Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Sun, 20 Oct 2024 18:05:32 +0700 Subject: [PATCH 01/27] Refactor package.json to add @radix-ui/react-popover dependency --- package.json | 2 + pnpm-lock.yaml | 370 ++++++++++++++++++++++++++++++++ src/app/business/apply/page.tsx | 4 +- src/app/project/apply/page.tsx | 8 +- src/components/ProjectForm.tsx | 110 +++++++++- src/components/ui/command.tsx | 155 +++++++++++++ src/components/ui/popover.tsx | 31 +++ 7 files changed, 670 insertions(+), 10 deletions(-) create mode 100644 src/components/ui/command.tsx create mode 100644 src/components/ui/popover.tsx diff --git a/package.json b/package.json index 2bed454..6b372a0 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@radix-ui/react-hover-card": "^1.1.1", "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-navigation-menu": "^1.2.0", + "@radix-ui/react-popover": "^1.1.2", "@radix-ui/react-progress": "^1.1.0", "@radix-ui/react-radio-group": "^1.2.1", "@radix-ui/react-select": "^2.1.1", @@ -34,6 +35,7 @@ "b2d-ventures": "file:", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", + "cmdk": "1.0.0", "date-fns": "^4.1.0", "dotenv": "^16.4.5", "embla-carousel-react": "^8.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9e7705f..b750070 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,6 +26,9 @@ dependencies: '@radix-ui/react-navigation-menu': specifier: ^1.2.0 version: 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-popover': + specifier: ^1.1.2 + version: 1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) '@radix-ui/react-progress': specifier: ^1.1.0 version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) @@ -77,6 +80,9 @@ dependencies: clsx: specifier: ^2.1.1 version: 2.1.1 + cmdk: + specifier: 1.0.0 + version: 1.0.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) date-fns: specifier: ^4.1.0 version: 4.1.0 @@ -119,6 +125,9 @@ dependencies: stripe: specifier: ^17.1.0 version: 17.2.0 + sweetalert2: + specifier: ^11.14.3 + version: 11.14.3 tailwind-merge: specifier: ^2.5.2 version: 2.5.2 @@ -151,6 +160,9 @@ devDependencies: '@types/react-dom': specifier: ^18 version: 18.3.0 + '@types/react-select-country-list': + specifier: ^2.2.3 + version: 2.2.3 eslint: specifier: ^8 version: 8.57.0 @@ -621,6 +633,12 @@ packages: resolution: {integrity: sha512-V3gRzhVNU1ldS5XhAPTom1fOIo4ccrjjJgmE+LI2h/WaFpHmx0MQApT+KZHnx8abG6Avtfcz4WoEciMnpFT3HQ==} dev: false + /@radix-ui/primitive@1.0.1: + resolution: {integrity: sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==} + dependencies: + '@babel/runtime': 7.25.7 + dev: false + /@radix-ui/primitive@1.1.0: resolution: {integrity: sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA==} dev: false @@ -691,6 +709,20 @@ packages: react-dom: 18.3.1(react@18.3.1) dev: false + /@radix-ui/react-compose-refs@1.0.1(@types/react@18.3.4)(react@18.3.1): + resolution: {integrity: sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@types/react': 18.3.4 + react: 18.3.1 + dev: false + /@radix-ui/react-compose-refs@1.1.0(@types/react@18.3.4)(react@18.3.1): resolution: {integrity: sha512-b4inOtiaOnYf9KWyO3jAeeCG6FeyfY6ldiEPanbUjWd+xIk5wZeHa8yVwmrJ2vderhu/BQvzCrJI0lHd+wIiqw==} peerDependencies: @@ -704,6 +736,20 @@ packages: react: 18.3.1 dev: false + /@radix-ui/react-context@1.0.1(@types/react@18.3.4)(react@18.3.1): + resolution: {integrity: sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@types/react': 18.3.4 + react: 18.3.1 + dev: false + /@radix-ui/react-context@1.1.0(@types/react@18.3.4)(react@18.3.1): resolution: {integrity: sha512-OKrckBy+sMEgYM/sMmqmErVn0kZqrHPJze+Ql3DzYsDDp0hl0L62nx/2122/Bvps1qz645jlcu2tD9lrRSdf8A==} peerDependencies: @@ -730,6 +776,40 @@ packages: react: 18.3.1 dev: false + /@radix-ui/react-dialog@1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-GjWJX/AUpB703eEBanuBnIWdIXg6NvJFCXcNlSZk4xdszCdhrJgBoUd1cGk67vFO+WdA2pfI/plOpqz/5GUP6Q==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@radix-ui/primitive': 1.0.1 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-context': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-dismissable-layer': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-focus-guards': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-focus-scope': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-id': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-portal': 1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-presence': 1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-slot': 1.0.2(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-use-controllable-state': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@types/react': 18.3.4 + '@types/react-dom': 18.3.0 + aria-hidden: 1.2.4 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + react-remove-scroll: 2.5.5(@types/react@18.3.4)(react@18.3.1) + dev: false + /@radix-ui/react-dialog@1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-Yj4dZtqa2o+kG61fzB0H2qUvmwBA2oyQroGLyNtBj1beo1khoQ3q1a2AO8rrQYjd8256CO9+N8L9tvsS+bnIyA==} peerDependencies: @@ -776,6 +856,31 @@ packages: react: 18.3.1 dev: false + /@radix-ui/react-dismissable-layer@1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@radix-ui/primitive': 1.0.1 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-use-escape-keydown': 1.0.3(@types/react@18.3.4)(react@18.3.1) + '@types/react': 18.3.4 + '@types/react-dom': 18.3.0 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + dev: false + /@radix-ui/react-dismissable-layer@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-/UovfmmXGptwGcBQawLzvn2jOfM0t4z3/uKffoBlj724+n3FvBbZ7M0aaBOmkp6pqFYpO4yx8tSVJjx3Fl2jig==} peerDependencies: @@ -850,6 +955,20 @@ packages: react-dom: 18.3.1(react@18.3.1) dev: false + /@radix-ui/react-focus-guards@1.0.1(@types/react@18.3.4)(react@18.3.1): + resolution: {integrity: sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@types/react': 18.3.4 + react: 18.3.1 + dev: false + /@radix-ui/react-focus-guards@1.1.0(@types/react@18.3.4)(react@18.3.1): resolution: {integrity: sha512-w6XZNUPVv6xCpZUqb/yN9DL6auvpGX3C/ee6Hdi16v2UUy25HV2Q5bcflsiDyT/g5RwbPQ/GIT1vLkeRb+ITBw==} peerDependencies: @@ -876,6 +995,29 @@ packages: react: 18.3.1 dev: false + /@radix-ui/react-focus-scope@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-sL04Mgvf+FmyvZeYfNu1EPAaaxD+aw7cYeIB9L9Fvq8+urhltTRaEo5ysKOpHuKPclsZcSUMKlN05x4u+CINpA==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@types/react': 18.3.4 + '@types/react-dom': 18.3.0 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + dev: false + /@radix-ui/react-focus-scope@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-200UD8zylvEyL8Bx+z76RJnASR2gRMuxlgFCPAe/Q/679a/r0eK3MBVYMb7vZODZcffZBdob1EGnky78xmVvcA==} peerDependencies: @@ -926,6 +1068,21 @@ packages: react-dom: 18.3.1(react@18.3.1) dev: false + /@radix-ui/react-id@1.0.1(@types/react@18.3.4)(react@18.3.1): + resolution: {integrity: sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@types/react': 18.3.4 + react: 18.3.1 + dev: false + /@radix-ui/react-id@1.1.0(@types/react@18.3.4)(react@18.3.1): resolution: {integrity: sha512-EJUrI8yYh7WOjNOqpoJaf1jlFIH2LvtgAl+YcFqNCa+4hj64ZXmPkAKOFs/ukjz3byN6bdb/AVUqHkI8/uWWMA==} peerDependencies: @@ -1030,6 +1187,40 @@ packages: react-dom: 18.3.1(react@18.3.1) dev: false + /@radix-ui/react-popover@1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-u2HRUyWW+lOiA2g0Le0tMmT55FGOEWHwPFt1EPfbLly7uXQExFo5duNKqG2DzmFXIdqOeNd+TpE8baHWJCyP9w==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-context': 1.1.1(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-dismissable-layer': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-focus-guards': 1.1.1(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-focus-scope': 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-id': 1.1.0(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-popper': 1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-portal': 1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-presence': 1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-use-controllable-state': 1.1.0(@types/react@18.3.4)(react@18.3.1) + '@types/react': 18.3.4 + '@types/react-dom': 18.3.0 + aria-hidden: 1.2.4 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + react-remove-scroll: 2.6.0(@types/react@18.3.4)(react@18.3.1) + dev: false + /@radix-ui/react-popper@1.2.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-ZnRMshKF43aBxVWPWvbj21+7TQCvhuULWJ4gNIKYpRlQt5xGRhLx66tMp8pya2UkGHTSlhpXwmjqltDYHhw7Vg==} peerDependencies: @@ -1059,6 +1250,27 @@ packages: react-dom: 18.3.1(react@18.3.1) dev: false + /@radix-ui/react-portal@1.0.4(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@types/react': 18.3.4 + '@types/react-dom': 18.3.0 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + dev: false + /@radix-ui/react-portal@1.1.1(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-A3UtLk85UtqhzFqtoC8Q0KvR2GbXF3mtPgACSazajqq6A41mEQgo53iPzY4i6BwDxlIFqWIhiQ2G729n+2aw/g==} peerDependencies: @@ -1101,6 +1313,28 @@ packages: react-dom: 18.3.1(react@18.3.1) dev: false + /@radix-ui/react-presence@1.0.1(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-use-layout-effect': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@types/react': 18.3.4 + '@types/react-dom': 18.3.0 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + dev: false + /@radix-ui/react-presence@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-Gq6wuRN/asf9H/E/VzdKoUtT8GC9PQc9z40/vEr0VCJ4u5XvvhWIrSsCB6vD2/cH7ugTdSfYq9fLJCcM00acrQ==} peerDependencies: @@ -1143,6 +1377,27 @@ packages: react-dom: 18.3.1(react@18.3.1) dev: false + /@radix-ui/react-primitive@1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@radix-ui/react-slot': 1.0.2(@types/react@18.3.4)(react@18.3.1) + '@types/react': 18.3.4 + '@types/react-dom': 18.3.0 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + dev: false + /@radix-ui/react-primitive@2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-ZSpFm0/uHa8zTvKBDjLFWLo8dkr4MBsiDLz0g3gMUwqgLHz9rTaRRGYDgvZPtBJgYCBKXkS9fzmoySgr8CO6Cw==} peerDependencies: @@ -1301,6 +1556,21 @@ packages: react-dom: 18.3.1(react@18.3.1) dev: false + /@radix-ui/react-slot@1.0.2(@types/react@18.3.4)(react@18.3.1): + resolution: {integrity: sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@radix-ui/react-compose-refs': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@types/react': 18.3.4 + react: 18.3.1 + dev: false + /@radix-ui/react-slot@1.1.0(@types/react@18.3.4)(react@18.3.1): resolution: {integrity: sha512-FUCf5XMfmW4dtYl69pdS4DbxKy8nj4M7SafBgPllysxmdachynNflAdp/gCsnYWNDnge6tI9onzMp5ARYc1KNw==} peerDependencies: @@ -1399,6 +1669,20 @@ packages: react-dom: 18.3.1(react@18.3.1) dev: false + /@radix-ui/react-use-callback-ref@1.0.1(@types/react@18.3.4)(react@18.3.1): + resolution: {integrity: sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@types/react': 18.3.4 + react: 18.3.1 + dev: false + /@radix-ui/react-use-callback-ref@1.1.0(@types/react@18.3.4)(react@18.3.1): resolution: {integrity: sha512-CasTfvsy+frcFkbXtSJ2Zu9JHpN8TYKxkgJGWbjiZhFivxaeW7rMeZt7QELGVLaYVfFMsKHjb7Ak0nMEe+2Vfw==} peerDependencies: @@ -1412,6 +1696,21 @@ packages: react: 18.3.1 dev: false + /@radix-ui/react-use-controllable-state@1.0.1(@types/react@18.3.4)(react@18.3.1): + resolution: {integrity: sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@types/react': 18.3.4 + react: 18.3.1 + dev: false + /@radix-ui/react-use-controllable-state@1.1.0(@types/react@18.3.4)(react@18.3.1): resolution: {integrity: sha512-MtfMVJiSr2NjzS0Aa90NPTnvTSg6C/JLCV7ma0W6+OMV78vd8OyRpID+Ng9LxzsPbLeuBnWBA1Nq30AtBIDChw==} peerDependencies: @@ -1426,6 +1725,21 @@ packages: react: 18.3.1 dev: false + /@radix-ui/react-use-escape-keydown@1.0.3(@types/react@18.3.4)(react@18.3.1): + resolution: {integrity: sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@radix-ui/react-use-callback-ref': 1.0.1(@types/react@18.3.4)(react@18.3.1) + '@types/react': 18.3.4 + react: 18.3.1 + dev: false + /@radix-ui/react-use-escape-keydown@1.1.0(@types/react@18.3.4)(react@18.3.1): resolution: {integrity: sha512-L7vwWlR1kTTQ3oh7g1O0CBF3YCyyTj8NmhLR+phShpyA50HCfBFKVJTpshm9PzLiKmehsrQzTYTpX9HvmC9rhw==} peerDependencies: @@ -1440,6 +1754,20 @@ packages: react: 18.3.1 dev: false + /@radix-ui/react-use-layout-effect@1.0.1(@types/react@18.3.4)(react@18.3.1): + resolution: {integrity: sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==} + peerDependencies: + '@types/react': '*' + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@babel/runtime': 7.25.7 + '@types/react': 18.3.4 + react: 18.3.1 + dev: false + /@radix-ui/react-use-layout-effect@1.1.0(@types/react@18.3.4)(react@18.3.1): resolution: {integrity: sha512-+FPE0rOdziWSrH9athwI1R0HDVbWlEhd+FR+aSDk4uWGmSJ9Z54sdZVDQPZAinJhJXwfT+qnj969mCsT2gfm5w==} peerDependencies: @@ -1847,6 +2175,10 @@ packages: dependencies: '@types/react': 18.3.4 + /@types/react-select-country-list@2.2.3: + resolution: {integrity: sha512-nffcYOwuun+5B0EWqubK+amHpPdK9Xj20xkLYNqYrzmESd8FnpLwHsS79ClLAWA9y+icVA8gWPkbwBp1gpjSwA==} + dev: true + /@types/react@18.3.4: resolution: {integrity: sha512-J7W30FTdfCxDDjmfRM+/JqLHBIyl7xUIp9kwK637FGmY7+mkSFSe6L4jpZzhj5QMfLssSDP4/i75AKkrdC7/Jw==} dependencies: @@ -2340,6 +2672,21 @@ packages: engines: {node: ^18.17.0 || >=20.5.0} dev: true + /cmdk@1.0.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-gDzVf0a09TvoJ5jnuPvygTB77+XdOSwEmJ88L6XPFPlv7T3RxbP9jgenfylrAMD0+Le1aO0nVjQUzl2g+vjz5Q==} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + dependencies: + '@radix-ui/react-dialog': 1.0.5(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-primitive': 1.0.3(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + transitivePeerDependencies: + - '@types/react' + - '@types/react-dom' + dev: false + /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: @@ -5069,6 +5416,25 @@ packages: tslib: 2.7.0 dev: false + /react-remove-scroll@2.5.5(@types/react@18.3.4)(react@18.3.1): + resolution: {integrity: sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw==} + engines: {node: '>=10'} + peerDependencies: + '@types/react': ^16.8.0 || ^17.0.0 || ^18.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + dependencies: + '@types/react': 18.3.4 + react: 18.3.1 + react-remove-scroll-bar: 2.3.6(@types/react@18.3.4)(react@18.3.1) + react-style-singleton: 2.2.1(@types/react@18.3.4)(react@18.3.1) + tslib: 2.7.0 + use-callback-ref: 1.3.2(@types/react@18.3.4)(react@18.3.1) + use-sidecar: 1.1.2(@types/react@18.3.4)(react@18.3.1) + dev: false + /react-remove-scroll@2.5.7(@types/react@18.3.4)(react@18.3.1): resolution: {integrity: sha512-FnrTWO4L7/Bhhf3CYBNArEG/yROV0tKmTv7/3h9QCFvH6sndeFf1wPqOcbFVu5VAulS5dV1wGT3GZZ/1GawqiA==} engines: {node: '>=10'} @@ -5690,6 +6056,10 @@ packages: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + /sweetalert2@11.14.3: + resolution: {integrity: sha512-6NuBHWJCv2gtw4y8PUXLB41hty+V6U2mKZMAvydL1IRPcORR0yuyq3cjFD/+ByrCk3muEFggbZX/x6HwmbVfbA==} + dev: false + /tailwind-merge@2.5.2: resolution: {integrity: sha512-kjEBm+pvD+6eAwzJL2Bi+02/9LFLal1Gs61+QB7HvTfQQ0aXwC5LGT8PEt1gS0CWKktKe6ysPTAy3cBC5MeiIg==} dev: false diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index bfdbd60..2abf407 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -6,6 +6,7 @@ import { z } from "zod"; import BusinessForm from "@/components/BusinessForm"; import { businessFormSchema } from "@/types/schemas/application.schema"; import Swal from "sweetalert2"; +import { getCurrentUserID } from "@/app/api/userApi"; type businessSchema = z.infer; export default function ApplyBusiness() { @@ -20,8 +21,7 @@ export default function ApplyBusiness() { const { data: { user }, } = await supabase.auth.getUser(); - // console.log(user?.id); - + const { data, error } = await supabase .from("business_application") .insert([ diff --git a/src/app/project/apply/page.tsx b/src/app/project/apply/page.tsx index b4574dc..89e9d34 100644 --- a/src/app/project/apply/page.tsx +++ b/src/app/project/apply/page.tsx @@ -7,19 +7,13 @@ import { SubmitHandler } from "react-hook-form"; type projectSchema = z.infer; export default function ApplyProject() { - const [projectType, setProjectType] = useState([]); - const [projectPitch, setProjectPitch] = useState("text"); - const [applyProject, setApplyProject] = useState(false); - const [selectedImages, setSelectedImages] = useState([]); - const [projectPitchFile, setProjectPitchFile] = useState(""); - const onSubmit: SubmitHandler = async (data) => { alert("มาแน้ววว"); console.table(data); }; return (
-
+
diff --git a/src/components/ProjectForm.tsx b/src/components/ProjectForm.tsx index 3cf2888..f02ca8a 100644 --- a/src/components/ProjectForm.tsx +++ b/src/components/ProjectForm.tsx @@ -17,6 +17,21 @@ import { zodResolver } from "@hookform/resolvers/zod"; import { Label } from "@/components/ui/label"; import { createSupabaseClient } from "@/lib/supabase/clientComponentClient"; import { Textarea } from "./ui/textarea"; +import { + Command, + CommandEmpty, + CommandGroup, + CommandInput, + CommandItem, + CommandList, +} from "@/components/ui/command"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "@/components/ui/popover"; +import { cn } from "@/lib/utils"; +import { ChevronsUpDown, Check } from "lucide-react"; type projectSchema = z.infer; type FieldType = ControllerRenderProps; @@ -38,6 +53,9 @@ const ProjectForm = ({ const [projectPitch, setProjectPitch] = useState("text"); const [selectedImages, setSelectedImages] = useState([]); const [projectPitchFile, setProjectPitchFile] = useState(""); + const [tag, setTag] = useState<{ id: number; value: string }[]>([]); + const [open, setOpen] = useState(false); + const [selectedTag, setSelectedTag] = useState(""); const handleFileChange = ( event: React.ChangeEvent, @@ -83,8 +101,25 @@ const ProjectForm = ({ } } }; + const fetchTag = async () => { + let { data: tag, error } = await supabase.from("tag").select("id, value"); + + if (error) { + console.error(error); + } else { + if (tag) { + setTag( + tag.map((item) => ({ + id: item.id, + value: item.value, + })) + ); + } + } + }; useEffect(() => { fetchProjectType(); + fetchTag(); }, []); return (
@@ -92,7 +127,7 @@ const ProjectForm = ({ onSubmit={form.handleSubmit(onSubmit as SubmitHandler)} className="space-y-8" > -

+

Begin Your First Fundraising Project

@@ -447,6 +482,79 @@ const ProjectForm = ({ )} /> + {/* Tags */} + ( + +

+ Tags + +
+ + + + + + + + + No tag found. + + {tag.map((tag) => ( + { + setSelectedTag( + currentValue === selectedTag + ? "" + : currentValue + ); + setOpen(false); + }} + > + + {tag.value} + + ))} + + + + + + + What is the deadline for your fundraising project? + Setting
a clear timeline can help motivate + potential investors. +
+
+
+
+ + + )} + />
- + - No tag found. + No tags found. {tag.map((tag) => ( { - setSelectedTag( - currentValue === selectedTag - ? "" - : currentValue + setSelectedTag((prev) => + prev.includes(currentValue) + ? prev.filter( + (item) => item !== currentValue + ) + : [...prev, currentValue] ); setOpen(false); }} @@ -530,7 +530,7 @@ const ProjectForm = ({ - What is the deadline for your fundraising project? - Setting
a clear timeline can help motivate - potential investors. + Add 1 to 5 tags that describe your project. Tags help{" "} +
+ investors understand your focus.
+ + {/* display selected tags */} +
+ {selectedTag.map((tag) => ( +
+ {tag} + +
+ ))} +
@@ -555,14 +577,12 @@ const ProjectForm = ({ )} /> -
- -
+ diff --git a/src/types/schemas/application.schema.ts b/src/types/schemas/application.schema.ts index 1111349..509ab51 100644 --- a/src/types/schemas/application.schema.ts +++ b/src/types/schemas/application.schema.ts @@ -90,6 +90,10 @@ const projectFormSchema = z.object({ .refine((date) => date > new Date(), { message: "Deadline must be in the future.", }), + tag: z + .array(z.string()) + .min(1, "Please provide at least one tag.") + .max(5, "You can provide up to 5 tags."), }); const businessFormSchema = z.object({ From cbe387172aeb56b4d45785a6e94559e858adf63f Mon Sep 17 00:00:00 2001 From: Pattadon Date: Mon, 21 Oct 2024 11:17:27 +0700 Subject: [PATCH 03/27] Refactor ApplyBusiness page and ProjectForm component - Refactor ApplyBusiness page to update the layout and add introductory text. - Refactor ProjectForm component to improve tag functionality and display selected tags. --- package-lock.json | 398 ++++++++++++++++++++++++++++++++ src/app/business/apply/page.tsx | 2 +- src/app/project/apply/page.tsx | 17 +- src/components/ProjectForm.tsx | 75 +++--- 4 files changed, 453 insertions(+), 39 deletions(-) diff --git a/package-lock.json b/package-lock.json index eb29a8d..02852bc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "@radix-ui/react-hover-card": "^1.1.1", "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-navigation-menu": "^1.2.0", + "@radix-ui/react-popover": "^1.1.2", "@radix-ui/react-progress": "^1.1.0", "@radix-ui/react-radio-group": "^1.2.1", "@radix-ui/react-select": "^2.1.1", @@ -33,6 +34,7 @@ "b2d-ventures": "file:", "class-variance-authority": "^0.7.0", "clsx": "^2.1.1", + "cmdk": "1.0.0", "date-fns": "^4.1.0", "dotenv": "^16.4.5", "embla-carousel-react": "^8.2.0", @@ -1333,6 +1335,42 @@ } } }, + "node_modules/@radix-ui/react-popover": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-popover/-/react-popover-1.1.2.tgz", + "integrity": "sha512-u2HRUyWW+lOiA2g0Le0tMmT55FGOEWHwPFt1EPfbLly7uXQExFo5duNKqG2DzmFXIdqOeNd+TpE8baHWJCyP9w==", + "dependencies": { + "@radix-ui/primitive": "1.1.0", + "@radix-ui/react-compose-refs": "1.1.0", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-dismissable-layer": "1.1.1", + "@radix-ui/react-focus-guards": "1.1.1", + "@radix-ui/react-focus-scope": "1.1.0", + "@radix-ui/react-id": "1.1.0", + "@radix-ui/react-popper": "1.2.0", + "@radix-ui/react-portal": "1.1.2", + "@radix-ui/react-presence": "1.1.1", + "@radix-ui/react-primitive": "2.0.0", + "@radix-ui/react-slot": "1.1.0", + "@radix-ui/react-use-controllable-state": "1.1.0", + "aria-hidden": "^1.1.1", + "react-remove-scroll": "2.6.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-popper": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-popper/-/react-popper-1.2.0.tgz", @@ -3153,6 +3191,366 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, + "node_modules/cmdk": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cmdk/-/cmdk-1.0.0.tgz", + "integrity": "sha512-gDzVf0a09TvoJ5jnuPvygTB77+XdOSwEmJ88L6XPFPlv7T3RxbP9jgenfylrAMD0+Le1aO0nVjQUzl2g+vjz5Q==", + "dependencies": { + "@radix-ui/react-dialog": "1.0.5", + "@radix-ui/react-primitive": "1.0.3" + }, + "peerDependencies": { + "react": "^18.0.0", + "react-dom": "^18.0.0" + } + }, + "node_modules/cmdk/node_modules/@radix-ui/primitive": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.0.1.tgz", + "integrity": "sha512-yQ8oGX2GVsEYMWGxcovu1uGWPCxV5BFfeeYxqPmuAzUyLT9qmaMXSAhXpb0WrspIeqYzdJpkh2vHModJPgRIaw==", + "dependencies": { + "@babel/runtime": "^7.13.10" + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-compose-refs": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.1.tgz", + "integrity": "sha512-fDSBgd44FKHa1FRMU59qBMPFcl2PZE+2nmqunj+BWFyYYjnhIDWL2ItDs3rrbJDQOtzt5nIebLCQc4QRfz6LJw==", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-context": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-context/-/react-context-1.0.1.tgz", + "integrity": "sha512-ebbrdFoYTcuZ0v4wG5tedGnp9tzcV8awzsxYph7gXUyvnNLuTIcCk1q17JEbnVhXAKG9oX3KtchwiMIAYp9NLg==", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-dialog": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dialog/-/react-dialog-1.0.5.tgz", + "integrity": "sha512-GjWJX/AUpB703eEBanuBnIWdIXg6NvJFCXcNlSZk4xdszCdhrJgBoUd1cGk67vFO+WdA2pfI/plOpqz/5GUP6Q==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.1", + "@radix-ui/react-compose-refs": "1.0.1", + "@radix-ui/react-context": "1.0.1", + "@radix-ui/react-dismissable-layer": "1.0.5", + "@radix-ui/react-focus-guards": "1.0.1", + "@radix-ui/react-focus-scope": "1.0.4", + "@radix-ui/react-id": "1.0.1", + "@radix-ui/react-portal": "1.0.4", + "@radix-ui/react-presence": "1.0.1", + "@radix-ui/react-primitive": "1.0.3", + "@radix-ui/react-slot": "1.0.2", + "@radix-ui/react-use-controllable-state": "1.0.1", + "aria-hidden": "^1.1.1", + "react-remove-scroll": "2.5.5" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-dismissable-layer": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.5.tgz", + "integrity": "sha512-aJeDjQhywg9LBu2t/At58hCvr7pEm0o2Ke1x33B+MhjNmmZ17sy4KImo0KPLgsnc/zN7GPdce8Cnn0SWvwZO7g==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/primitive": "1.0.1", + "@radix-ui/react-compose-refs": "1.0.1", + "@radix-ui/react-primitive": "1.0.3", + "@radix-ui/react-use-callback-ref": "1.0.1", + "@radix-ui/react-use-escape-keydown": "1.0.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-focus-guards": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-guards/-/react-focus-guards-1.0.1.tgz", + "integrity": "sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA==", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-focus-scope": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.4.tgz", + "integrity": "sha512-sL04Mgvf+FmyvZeYfNu1EPAaaxD+aw7cYeIB9L9Fvq8+urhltTRaEo5ysKOpHuKPclsZcSUMKlN05x4u+CINpA==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.1", + "@radix-ui/react-primitive": "1.0.3", + "@radix-ui/react-use-callback-ref": "1.0.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-id": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-id/-/react-id-1.0.1.tgz", + "integrity": "sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-use-layout-effect": "1.0.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-portal": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@radix-ui/react-portal/-/react-portal-1.0.4.tgz", + "integrity": "sha512-Qki+C/EuGUVCQTOTD5vzJzJuMUlewbzuKyUy+/iHM2uwGiru9gZeBJtHAPKAEkB5KWGi9mP/CHKcY0wt1aW45Q==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-primitive": "1.0.3" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-presence": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-presence/-/react-presence-1.0.1.tgz", + "integrity": "sha512-UXLW4UAbIY5ZjcvzjfRFo5gxva8QirC9hF7wRE4U5gz+TP0DbRk+//qyuAQ1McDxBt1xNMBTaciFGvEmJvAZCg==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.1", + "@radix-ui/react-use-layout-effect": "1.0.1" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-primitive": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-primitive/-/react-primitive-1.0.3.tgz", + "integrity": "sha512-yi58uVyoAcK/Nq1inRY56ZSjKypBNKTa/1mcL8qdl6oJeEaDbOldlzrGn7P6Q3Id5d+SYNGc5AJgc4vGhjs5+g==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-slot": "1.0.2" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0", + "react-dom": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-slot": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-slot/-/react-slot-1.0.2.tgz", + "integrity": "sha512-YeTpuq4deV+6DusvVUW4ivBgnkHwECUu0BiN43L5UCDFgdhsRUWAghhTF5MbvNTPzmiFOx90asDSUjWuCNapwg==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-compose-refs": "1.0.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-use-callback-ref": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.0.1.tgz", + "integrity": "sha512-D94LjX4Sp0xJFVaoQOd3OO9k7tpBYNOXdVhkltUbGv2Qb9OXdrg/CpsjlZv7ia14Sylv398LswWBVVu5nqKzAQ==", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-use-controllable-state": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-controllable-state/-/react-use-controllable-state-1.0.1.tgz", + "integrity": "sha512-Svl5GY5FQeN758fWKrjM6Qb7asvXeiZltlT4U2gVfl8Gx5UAv2sMR0LWo8yhsIZh2oQ0eFdZ59aoOOMV7b47VA==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-use-callback-ref": "1.0.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-use-escape-keydown": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-escape-keydown/-/react-use-escape-keydown-1.0.3.tgz", + "integrity": "sha512-vyL82j40hcFicA+M4Ex7hVkB9vHgSse1ZWomAqV2Je3RleKGO5iM8KMOEtfoSB0PnIelMd2lATjTGMYqN5ylTg==", + "dependencies": { + "@babel/runtime": "^7.13.10", + "@radix-ui/react-use-callback-ref": "1.0.1" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/@radix-ui/react-use-layout-effect": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.0.1.tgz", + "integrity": "sha512-v/5RegiJWYdoCvMnITBkNNx6bCj20fiaJnWtRkU18yITptraXjffz5Qbn05uOiQnOvi+dbkznkoaMltz1GnszQ==", + "dependencies": { + "@babel/runtime": "^7.13.10" + }, + "peerDependencies": { + "@types/react": "*", + "react": "^16.8 || ^17.0 || ^18.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/cmdk/node_modules/react-remove-scroll": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz", + "integrity": "sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw==", + "dependencies": { + "react-remove-scroll-bar": "^2.3.3", + "react-style-singleton": "^2.2.1", + "tslib": "^2.1.0", + "use-callback-ref": "^1.3.0", + "use-sidecar": "^1.1.2" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index 2abf407..2a4f587 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -21,7 +21,7 @@ export default function ApplyBusiness() { const { data: { user }, } = await supabase.auth.getUser(); - + const { data, error } = await supabase .from("business_application") .insert([ diff --git a/src/app/project/apply/page.tsx b/src/app/project/apply/page.tsx index 89e9d34..7e16b5c 100644 --- a/src/app/project/apply/page.tsx +++ b/src/app/project/apply/page.tsx @@ -13,7 +13,22 @@ export default function ApplyProject() { }; return (
-
+
+

+ Apply to raise on B2DVentures +

+
+

+ Begin Your First Fundraising Project. Starting a fundraising project + is mandatory for all businesses. +

+

+ This step is crucial to begin your journey and unlock the necessary + tools for raising funds. +

+
+
+
diff --git a/src/components/ProjectForm.tsx b/src/components/ProjectForm.tsx index 179e246..94e3310 100644 --- a/src/components/ProjectForm.tsx +++ b/src/components/ProjectForm.tsx @@ -127,23 +127,14 @@ const ProjectForm = ({ onSubmit={form.handleSubmit(onSubmit as SubmitHandler)} className="space-y-8" > -

- Begin Your First Fundraising Project -

-

- Starting a fundraising project is mandatory for all businesses. This - step is crucial
- to begin your journey and unlock the necessary tools for raising - funds. -

-
+
{/* project name */} ( -
+
Project name @@ -517,13 +508,18 @@ const ProjectForm = ({ key={tag.value} value={tag.value} onSelect={(currentValue) => { - setSelectedTag((prev) => - prev.includes(currentValue) + setSelectedTag((prev) => { + const updatedTags = prev.includes( + currentValue + ) ? prev.filter( (item) => item !== currentValue ) - : [...prev, currentValue] - ); + : [...prev, currentValue]; + field.onChange(updatedTags); + + return updatedTags; + }); setOpen(false); }} > @@ -548,35 +544,40 @@ const ProjectForm = ({
investors understand your focus. - - {/* display selected tags */} -
- {selectedTag.map((tag) => ( -
- {tag} - -
- ))} -
+ {/* display selected tags */} +
+ {selectedTag.map((tag) => ( +
+ {tag} + +
+ ))} +
)} /> + -
+ ); diff --git a/src/components/navigationBar/nav.tsx b/src/components/navigationBar/nav.tsx index f7679a4..8579b13 100644 --- a/src/components/navigationBar/nav.tsx +++ b/src/components/navigationBar/nav.tsx @@ -51,8 +51,8 @@ export function NavigationBar() { const projectComponents = [ { title: "Projects", - href: "/landing", - description: "Raise on B2DVentures", + href: "/project/apply", + description: "Start your new project on B2DVentures", }, ]; From 886fc659d51bdb3888e17391e5a306f52b15f865 Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Mon, 21 Oct 2024 19:07:24 +0700 Subject: [PATCH 06/27] Refactor ApplyBusiness component to upload files to Supabase storage --- src/app/business/apply/page.tsx | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index 2abf407..890b0b1 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -6,7 +6,6 @@ import { z } from "zod"; import BusinessForm from "@/components/BusinessForm"; import { businessFormSchema } from "@/types/schemas/application.schema"; import Swal from "sweetalert2"; -import { getCurrentUserID } from "@/app/api/userApi"; type businessSchema = z.infer; export default function ApplyBusiness() { @@ -21,7 +20,7 @@ export default function ApplyBusiness() { const { data: { user }, } = await supabase.auth.getUser(); - + const { data, error } = await supabase .from("business_application") .insert([ @@ -39,7 +38,7 @@ export default function ApplyBusiness() { }, ]) .select(); - console.table(data); + // console.table(data); Swal.fire({ icon: error == null ? "success" : "error", title: error == null ? "success" : "Error: " + error.code, @@ -54,6 +53,19 @@ export default function ApplyBusiness() { } }); }; + async function uploadFile(file: File) { + const { data, error } = await supabase.storage.listBuckets(); + console.table(data); + // if (error) { + // Swal.fire({ + // icon: error == null ? "success" : "error", + // title: error == null ? "success" : "Error: " + error.cause, + // text: + // error == null ? "Your application has been submitted" : error.message, + // confirmButtonColor: error == null ? "green" : "red", + // }); + // } + } let supabase = createSupabaseClient(); const transformChoice = (data: any) => { From 31f80b0af6e30cc4f77aad0cf8d615be8e1d2585 Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Mon, 21 Oct 2024 19:38:11 +0700 Subject: [PATCH 07/27] Refactor ApplyBusiness component to upload files to Supabase storage --- src/app/business/apply/page.tsx | 78 ++++++++++++++++++++++++++------- 1 file changed, 61 insertions(+), 17 deletions(-) diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index 890b0b1..6c25fbd 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -1,6 +1,6 @@ "use client"; import { createSupabaseClient } from "@/lib/supabase/clientComponentClient"; -import { useState } from "react"; +import { useState, useEffect } from "react"; import { SubmitHandler } from "react-hook-form"; import { z } from "zod"; import BusinessForm from "@/components/BusinessForm"; @@ -8,18 +8,26 @@ import { businessFormSchema } from "@/types/schemas/application.schema"; import Swal from "sweetalert2"; type businessSchema = z.infer; +const BUCKET_NAME = "project-pitches"; export default function ApplyBusiness() { const [applyProject, setApplyProject] = useState(false); const onSubmit: SubmitHandler = async (data) => { const transformedData = await transformChoice(data); - console.log(transformedData); - await sendRegistration(transformedData); + await sendApplication(transformedData); }; - const sendRegistration = async (recvData: any) => { + const sendApplication = async (recvData: any) => { const { data: { user }, } = await supabase.auth.getUser(); + const pitchType = typeof recvData["businessPitchDeck"]; + if (pitchType === "object") { + if (user?.id) { + uploadFile(recvData["businessPitchDeck"], user.id, BUCKET_NAME); + } else { + console.error("User ID is undefined. Cannot upload file."); + } + } const { data, error } = await supabase .from("business_application") @@ -32,7 +40,8 @@ export default function ApplyBusiness() { is_for_sale: recvData["isForSale"], is_generating_revenue: recvData["isGenerating"], is_in_us: recvData["isInUS"], - pitch_deck_url: recvData["businessPitchDeck"], + pitch_deck_url: + pitchType === "string" ? recvData["businessPitchDeck"] : "", money_raised_to_date: recvData["totalRaised"], community_size: recvData["communitySize"], }, @@ -53,18 +62,50 @@ export default function ApplyBusiness() { } }); }; - async function uploadFile(file: File) { - const { data, error } = await supabase.storage.listBuckets(); - console.table(data); - // if (error) { - // Swal.fire({ - // icon: error == null ? "success" : "error", - // title: error == null ? "success" : "Error: " + error.cause, - // text: - // error == null ? "Your application has been submitted" : error.message, - // confirmButtonColor: error == null ? "green" : "red", - // }); - // } + async function uploadFile(file: File, userID: string, bucketName: string) { + const folderPath = `${userID}/`; + const filePath = `${folderPath}${file.name}`; + + // check if the folder exists + const { data: folderData, error: folderError } = await supabase.storage + .from(bucketName) + .list(folderPath); + + if (folderError) { + console.error("Error checking for folder:", folderError.message); + return; + } + + // if the folder exists, clear the folder + if (folderData && folderData.length > 0) { + console.log("Folder exists. Clearing contents..."); + + for (const fileItem of folderData) { + const { error: removeError } = await supabase.storage + .from(bucketName) + .remove([`${folderPath}${fileItem.name}`]); + + if (removeError) { + console.error( + `Error removing file (${fileItem.name}):`, + removeError.message + ); + return; + } + } + } + + // upload new file to the folder + const { data: uploadData, error: uploadError } = await supabase.storage + .from(bucketName) + .upload(filePath, file); + + if (uploadError) { + console.error("Error uploading file:", uploadError.message); + return; + } + + console.log("File uploaded successfully:", uploadData); } let supabase = createSupabaseClient(); @@ -90,6 +131,9 @@ export default function ApplyBusiness() { ); return transformedData; }; + // useEffect(() => { + // uploadFile(); + // }, []); return (
From 121418ed257cab15e736e40cef9778d15da7bd7d Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Mon, 21 Oct 2024 19:52:39 +0700 Subject: [PATCH 08/27] Refactor ApplyBusiness component to upload files to Supabase storage --- src/app/business/apply/page.tsx | 55 ++++++++++++++++++++++----------- 1 file changed, 37 insertions(+), 18 deletions(-) diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index 6c25fbd..160355b 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -11,6 +11,7 @@ type businessSchema = z.infer; const BUCKET_NAME = "project-pitches"; export default function ApplyBusiness() { const [applyProject, setApplyProject] = useState(false); + let supabase = createSupabaseClient(); const onSubmit: SubmitHandler = async (data) => { const transformedData = await transformChoice(data); @@ -23,9 +24,20 @@ export default function ApplyBusiness() { const pitchType = typeof recvData["businessPitchDeck"]; if (pitchType === "object") { if (user?.id) { - uploadFile(recvData["businessPitchDeck"], user.id, BUCKET_NAME); + const uploadSuccess = await uploadFile( + recvData["businessPitchDeck"], + user.id, + BUCKET_NAME + ); + + if (!uploadSuccess) { + return; + } + + console.log("file upload successful"); } else { - console.error("User ID is undefined. Cannot upload file."); + console.error("user ID is undefined."); + return; } } @@ -62,9 +74,11 @@ export default function ApplyBusiness() { } }); }; + async function uploadFile(file: File, userID: string, bucketName: string) { const folderPath = `${userID}/`; const filePath = `${folderPath}${file.name}`; + let errorMessages: string[] = []; // check if the folder exists const { data: folderData, error: folderError } = await supabase.storage @@ -72,8 +86,7 @@ export default function ApplyBusiness() { .list(folderPath); if (folderError) { - console.error("Error checking for folder:", folderError.message); - return; + errorMessages.push(`Error checking for folder: ${folderError.message}`); } // if the folder exists, clear the folder @@ -86,29 +99,35 @@ export default function ApplyBusiness() { .remove([`${folderPath}${fileItem.name}`]); if (removeError) { - console.error( - `Error removing file (${fileItem.name}):`, - removeError.message + errorMessages.push( + `Error removing file (${fileItem.name}): ${removeError.message}` ); - return; } } } - // upload new file to the folder - const { data: uploadData, error: uploadError } = await supabase.storage - .from(bucketName) - .upload(filePath, file); + // upload the new file to the folder (if no folderError) + if (errorMessages.length === 0) { + const { error: uploadError } = await supabase.storage + .from(bucketName) + .upload(filePath, file); - if (uploadError) { - console.error("Error uploading file:", uploadError.message); - return; + if (uploadError) { + errorMessages.push(`Error uploading file: ${uploadError.message}`); + } } - - console.log("File uploaded successfully:", uploadData); + if (errorMessages.length > 0) { + Swal.fire({ + icon: "error", + title: "Errors occurred", + html: errorMessages.join("
"), + confirmButtonColor: "red", + }); + return false; + } + return true; } - let supabase = createSupabaseClient(); const transformChoice = (data: any) => { // convert any yes and no to true or false const transformedData = Object.entries(data).reduce( From 729da7112ff231c8bef345267d40175d88f485e4 Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Mon, 21 Oct 2024 20:15:01 +0700 Subject: [PATCH 09/27] Refactor ApplyBusiness component to upload files to Supabase storage and add user application check --- src/app/business/apply/page.tsx | 50 +++++++++++++++++++++++++++++---- 1 file changed, 45 insertions(+), 5 deletions(-) diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index 160355b..d1eaa35 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -1,17 +1,19 @@ "use client"; import { createSupabaseClient } from "@/lib/supabase/clientComponentClient"; -import { useState, useEffect } from "react"; +import { useState, useEffect, useRef } from "react"; import { SubmitHandler } from "react-hook-form"; import { z } from "zod"; import BusinessForm from "@/components/BusinessForm"; import { businessFormSchema } from "@/types/schemas/application.schema"; import Swal from "sweetalert2"; +import { getCurrentUserID } from "@/app/api/userApi"; type businessSchema = z.infer; const BUCKET_NAME = "project-pitches"; export default function ApplyBusiness() { const [applyProject, setApplyProject] = useState(false); let supabase = createSupabaseClient(); + const alertShownRef = useRef(false); const onSubmit: SubmitHandler = async (data) => { const transformedData = await transformChoice(data); @@ -127,7 +129,17 @@ export default function ApplyBusiness() { } return true; } - + const hasUserApplied = async (userID: string) => { + let { data: business, error } = await supabase + .from("business") + .select("*") + .eq("user_id", userID); + console.table(business); + if (business) { + return true; + } + return false; + }; const transformChoice = (data: any) => { // convert any yes and no to true or false const transformedData = Object.entries(data).reduce( @@ -150,9 +162,37 @@ export default function ApplyBusiness() { ); return transformedData; }; - // useEffect(() => { - // uploadFile(); - // }, []); + useEffect(() => { + const fetchUserData = async () => { + try { + const userID = await getCurrentUserID(); + if (userID) { + const hasApplied = await hasUserApplied(userID); + if (hasApplied && !alertShownRef.current) { + alertShownRef.current = true; + Swal.fire({ + icon: "info", + title: "You Already Have an Account", + text: "You have already submitted your business application.", + confirmButtonText: "OK", + allowOutsideClick: false, + allowEscapeKey: false, + }).then((result) => { + if (result.isConfirmed) { + window.location.href = "/"; + } + }); + } + } else { + console.error("User ID is undefined."); + } + } catch (error) { + console.error("Error fetching user ID:", error); + } + }; + + fetchUserData(); + }, []); return (
From f70c3a5573c0f01ac9b82c60fcf238d2b45fdd9e Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Mon, 21 Oct 2024 20:22:18 +0700 Subject: [PATCH 10/27] Refactor ApplyBusiness component to upload files to Supabase storage and clear existing files --- src/app/business/apply/page.tsx | 108 ++++++++++++++++---------------- 1 file changed, 55 insertions(+), 53 deletions(-) diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index d1eaa35..d5c342e 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -10,9 +10,63 @@ import { getCurrentUserID } from "@/app/api/userApi"; type businessSchema = z.infer; const BUCKET_NAME = "project-pitches"; +let supabase = createSupabaseClient(); + +async function uploadFile(file: File, userID: string, bucketName: string) { + const folderPath = `${userID}/`; + const filePath = `${folderPath}${file.name}`; + let errorMessages: string[] = []; + + // check if the folder exists + const { data: folderData, error: folderError } = await supabase.storage + .from(bucketName) + .list(folderPath); + + if (folderError) { + errorMessages.push(`Error checking for folder: ${folderError.message}`); + } + + // if the folder exists, clear the folder + if (folderData && folderData.length > 0) { + // console.log("Folder exists. Clearing contents..."); + + for (const fileItem of folderData) { + const { error: removeError } = await supabase.storage + .from(bucketName) + .remove([`${folderPath}${fileItem.name}`]); + + if (removeError) { + errorMessages.push( + `Error removing file (${fileItem.name}): ${removeError.message}` + ); + } + } + } + + // upload the new file to the folder (if no folderError) + if (errorMessages.length === 0) { + const { error: uploadError } = await supabase.storage + .from(bucketName) + .upload(filePath, file); + + if (uploadError) { + errorMessages.push(`Error uploading file: ${uploadError.message}`); + } + } + if (errorMessages.length > 0) { + Swal.fire({ + icon: "error", + title: "Errors occurred", + html: errorMessages.join("
"), + confirmButtonColor: "red", + }); + return false; + } + return true; +} + export default function ApplyBusiness() { const [applyProject, setApplyProject] = useState(false); - let supabase = createSupabaseClient(); const alertShownRef = useRef(false); const onSubmit: SubmitHandler = async (data) => { @@ -77,58 +131,6 @@ export default function ApplyBusiness() { }); }; - async function uploadFile(file: File, userID: string, bucketName: string) { - const folderPath = `${userID}/`; - const filePath = `${folderPath}${file.name}`; - let errorMessages: string[] = []; - - // check if the folder exists - const { data: folderData, error: folderError } = await supabase.storage - .from(bucketName) - .list(folderPath); - - if (folderError) { - errorMessages.push(`Error checking for folder: ${folderError.message}`); - } - - // if the folder exists, clear the folder - if (folderData && folderData.length > 0) { - console.log("Folder exists. Clearing contents..."); - - for (const fileItem of folderData) { - const { error: removeError } = await supabase.storage - .from(bucketName) - .remove([`${folderPath}${fileItem.name}`]); - - if (removeError) { - errorMessages.push( - `Error removing file (${fileItem.name}): ${removeError.message}` - ); - } - } - } - - // upload the new file to the folder (if no folderError) - if (errorMessages.length === 0) { - const { error: uploadError } = await supabase.storage - .from(bucketName) - .upload(filePath, file); - - if (uploadError) { - errorMessages.push(`Error uploading file: ${uploadError.message}`); - } - } - if (errorMessages.length > 0) { - Swal.fire({ - icon: "error", - title: "Errors occurred", - html: errorMessages.join("
"), - confirmButtonColor: "red", - }); - return false; - } - return true; - } const hasUserApplied = async (userID: string) => { let { data: business, error } = await supabase .from("business") From fd3930f3061ffe28b904824e797b003b4c77a589 Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Mon, 21 Oct 2024 21:28:59 +0700 Subject: [PATCH 11/27] Refactor ApplyBusiness component to update bucket name for file uploads --- src/app/business/apply/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index d5c342e..14da3ca 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -9,7 +9,7 @@ import Swal from "sweetalert2"; import { getCurrentUserID } from "@/app/api/userApi"; type businessSchema = z.infer; -const BUCKET_NAME = "project-pitches"; +const BUCKET_NAME = "business-pitches"; let supabase = createSupabaseClient(); async function uploadFile(file: File, userID: string, bucketName: string) { From 24f452ae7011298710f08ed5fa365edc7c3ac6a9 Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Mon, 21 Oct 2024 21:48:02 +0700 Subject: [PATCH 12/27] Refactor ApplyBusiness component to update bucket name for file uploads --- src/app/business/apply/page.tsx | 7 ++-- src/app/project/apply/page.tsx | 62 +++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+), 2 deletions(-) diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index 14da3ca..d269743 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -9,7 +9,7 @@ import Swal from "sweetalert2"; import { getCurrentUserID } from "@/app/api/userApi"; type businessSchema = z.infer; -const BUCKET_NAME = "business-pitches"; +const BUCKET_PITCH_NAME = "business-pitches"; let supabase = createSupabaseClient(); async function uploadFile(file: File, userID: string, bucketName: string) { @@ -83,7 +83,7 @@ export default function ApplyBusiness() { const uploadSuccess = await uploadFile( recvData["businessPitchDeck"], user.id, - BUCKET_NAME + BUCKET_PITCH_NAME ); if (!uploadSuccess) { @@ -137,6 +137,9 @@ export default function ApplyBusiness() { .select("*") .eq("user_id", userID); console.table(business); + if (error) { + console.error(error); + } if (business) { return true; } diff --git a/src/app/project/apply/page.tsx b/src/app/project/apply/page.tsx index 8d49c62..fa081a4 100644 --- a/src/app/project/apply/page.tsx +++ b/src/app/project/apply/page.tsx @@ -1,16 +1,78 @@ "use client"; import { useState } from "react"; +import { createSupabaseClient } from "@/lib/supabase/clientComponentClient"; import ProjectForm from "@/components/ProjectForm"; import { projectFormSchema } from "@/types/schemas/application.schema"; import { z } from "zod"; import { SubmitHandler } from "react-hook-form"; +import Swal from "sweetalert2"; type projectSchema = z.infer; +let supabase = createSupabaseClient(); +const BUCKET_PITCH_NAME = "project-pitches"; +const BUCKET_LOGO_NAME = "project-logo"; +const BUCKET_PHOTOS_NAME = "project-additional-photos"; + export default function ApplyProject() { const onSubmit: SubmitHandler = async (data) => { alert("มาแน้ววว"); console.table(data); }; + const sendApplication = async (recvData: any) => { + const { + data: { user }, + } = await supabase.auth.getUser(); + const pitchType = typeof recvData["businessPitchDeck"]; + if (pitchType === "object") { + if (user?.id) { + // const uploadSuccess = await uploadFile( + // recvData["businessPitchDeck"], + // user.id, + // BUCKET_PITCH_NAME + // ); + + // if (!uploadSuccess) { + // return; + // } + + console.log("file upload successful"); + } else { + console.error("user ID is undefined."); + return; + } + } + + const { data, error } = await supabase + .from("business_application") + .insert([ + { + user_id: user?.id, + business_name: recvData["companyName"], + business_type_id: recvData["industry"], + location: recvData["country"], + is_for_sale: recvData["isForSale"], + is_generating_revenue: recvData["isGenerating"], + is_in_us: recvData["isInUS"], + pitch_deck_url: + pitchType === "string" ? recvData["businessPitchDeck"] : "", + money_raised_to_date: recvData["totalRaised"], + community_size: recvData["communitySize"], + }, + ]) + .select(); + // console.table(data); + Swal.fire({ + icon: error == null ? "success" : "error", + title: error == null ? "success" : "Error: " + error.code, + text: + error == null ? "Your application has been submitted" : error.message, + confirmButtonColor: error == null ? "green" : "red", + }).then((result) => { + if (result.isConfirmed) { + window.location.href = "/"; + } + }); + }; return (
From a225189a244c2761dcbd90e2d8c6e8490df609e6 Mon Sep 17 00:00:00 2001 From: Pattadon Date: Tue, 22 Oct 2024 11:13:14 +0700 Subject: [PATCH 13/27] Refactor ApplyBusiness component to upload files to Supabase storage and update file upload path --- src/app/api/generalApi.ts | 54 ++++++++++++++++++++++ src/app/business/apply/page.tsx | 59 ++----------------------- src/types/schemas/application.schema.ts | 2 +- 3 files changed, 59 insertions(+), 56 deletions(-) create mode 100644 src/app/api/generalApi.ts diff --git a/src/app/api/generalApi.ts b/src/app/api/generalApi.ts new file mode 100644 index 0000000..70f5b6a --- /dev/null +++ b/src/app/api/generalApi.ts @@ -0,0 +1,54 @@ +import { createSupabaseClient } from "@/lib/supabase/clientComponentClient"; +import Swal from "sweetalert2"; + +export async function uploadFile(file: File, userID: string, bucketName: string, filePath: string) { + const supabase = createSupabaseClient(); + let errorMessages: string[] = []; + + // check if the folder exists + const { data: folderData, error: folderError } = await supabase.storage + .from(bucketName) + .list(`${userID}/`); + + if (folderError) { + errorMessages.push(`Error checking for folder: ${folderError.message}`); + } + + // if the folder exists, clear the folder + if (folderData && folderData.length > 0) { + // console.log("Folder exists. Clearing contents..."); + + for (const fileItem of folderData) { + const { error: removeError } = await supabase.storage + .from(bucketName) + .remove([`${userID}/${fileItem.name}`]); + + if (removeError) { + errorMessages.push( + `Error removing file (${fileItem.name}): ${removeError.message}` + ); + } + } + } + + // upload the new file to the folder (if no folderError) + if (errorMessages.length === 0) { + const { error: uploadError } = await supabase.storage + .from(bucketName) + .upload(filePath, file); + + if (uploadError) { + errorMessages.push(`Error uploading file: ${uploadError.message}`); + } + } + if (errorMessages.length > 0) { + Swal.fire({ + icon: "error", + title: "Errors occurred", + html: errorMessages.join("
"), + confirmButtonColor: "red", + }); + return false; + } + return true; +} diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index d269743..c7e90af 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -7,64 +7,12 @@ import BusinessForm from "@/components/BusinessForm"; import { businessFormSchema } from "@/types/schemas/application.schema"; import Swal from "sweetalert2"; import { getCurrentUserID } from "@/app/api/userApi"; +import { uploadFile } from "@/app/api/generalApi"; type businessSchema = z.infer; const BUCKET_PITCH_NAME = "business-pitches"; let supabase = createSupabaseClient(); -async function uploadFile(file: File, userID: string, bucketName: string) { - const folderPath = `${userID}/`; - const filePath = `${folderPath}${file.name}`; - let errorMessages: string[] = []; - - // check if the folder exists - const { data: folderData, error: folderError } = await supabase.storage - .from(bucketName) - .list(folderPath); - - if (folderError) { - errorMessages.push(`Error checking for folder: ${folderError.message}`); - } - - // if the folder exists, clear the folder - if (folderData && folderData.length > 0) { - // console.log("Folder exists. Clearing contents..."); - - for (const fileItem of folderData) { - const { error: removeError } = await supabase.storage - .from(bucketName) - .remove([`${folderPath}${fileItem.name}`]); - - if (removeError) { - errorMessages.push( - `Error removing file (${fileItem.name}): ${removeError.message}` - ); - } - } - } - - // upload the new file to the folder (if no folderError) - if (errorMessages.length === 0) { - const { error: uploadError } = await supabase.storage - .from(bucketName) - .upload(filePath, file); - - if (uploadError) { - errorMessages.push(`Error uploading file: ${uploadError.message}`); - } - } - if (errorMessages.length > 0) { - Swal.fire({ - icon: "error", - title: "Errors occurred", - html: errorMessages.join("
"), - confirmButtonColor: "red", - }); - return false; - } - return true; -} - export default function ApplyBusiness() { const [applyProject, setApplyProject] = useState(false); const alertShownRef = useRef(false); @@ -83,7 +31,8 @@ export default function ApplyBusiness() { const uploadSuccess = await uploadFile( recvData["businessPitchDeck"], user.id, - BUCKET_PITCH_NAME + BUCKET_PITCH_NAME, + `${user?.id}/${recvData["businessPitchDeck"].name}` ); if (!uploadSuccess) { @@ -196,7 +145,7 @@ export default function ApplyBusiness() { } }; - fetchUserData(); + // fetchUserData(); }, []); return ( diff --git a/src/types/schemas/application.schema.ts b/src/types/schemas/application.schema.ts index 509ab51..6e0c32b 100644 --- a/src/types/schemas/application.schema.ts +++ b/src/types/schemas/application.schema.ts @@ -151,7 +151,7 @@ const businessFormSchema = z.object({ .refine((file) => file.size < MAX_FILE_SIZE, { message: "File can't be bigger than 5MB.", }) - .refine((file) => file.name.endsWith(".md"), { + .refine((file) => file.name.toLowerCase().endsWith(".md"), { message: "File must be a markdown file (.md).", }), ]), From 4935225350285beff7b587638b7da3a19b2eceda Mon Sep 17 00:00:00 2001 From: Pattadon Date: Tue, 22 Oct 2024 11:15:27 +0700 Subject: [PATCH 14/27] Refactor ApplyBusiness component to fetch user data on page load --- src/app/business/apply/page.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index c7e90af..2dad32e 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -145,7 +145,7 @@ export default function ApplyBusiness() { } }; - // fetchUserData(); + fetchUserData(); }, []); return ( From 7764e4ea0be6d0f9aee70887a2dd1910e0d0cc4d Mon Sep 17 00:00:00 2001 From: Pattadon Date: Tue, 22 Oct 2024 12:55:17 +0700 Subject: [PATCH 15/27] Refactor ApplyBusiness component to add Lottie animation for loading --- package-lock.json | 86 + package.json | 4 + pnpm-lock.yaml | 86 +- src/app/business/apply/page.tsx | 5 + src/components/loading/loader.tsx | 39 + src/components/loading/loading.json | 2549 +++++++++++++++++++++++++++ src/components/loading/success.json | 2214 +++++++++++++++++++++++ src/components/ui/alert-dialog.tsx | 141 ++ src/components/ui/button.tsx | 2 +- 9 files changed, 5118 insertions(+), 8 deletions(-) create mode 100644 src/components/loading/loader.tsx create mode 100644 src/components/loading/loading.json create mode 100644 src/components/loading/success.json create mode 100644 src/components/ui/alert-dialog.tsx diff --git a/package-lock.json b/package-lock.json index 02852bc..24952b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -46,6 +46,7 @@ "react-dom": "^18", "react-hook-form": "^7.53.0", "react-hot-toast": "^2.4.1", + "react-lottie": "^1.2.4", "react-markdown": "^9.0.1", "recharts": "^2.12.7", "stripe": "^17.1.0", @@ -62,6 +63,8 @@ "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", + "@types/react-fade-in": "^2.0.2", + "@types/react-lottie": "^1.2.10", "@types/react-select-country-list": "^2.2.3", "eslint": "^8", "eslint-config-next": "14.2.5", @@ -2349,6 +2352,39 @@ "@types/react": "*" } }, + "node_modules/@types/react-fade-in": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@types/react-fade-in/-/react-fade-in-2.0.2.tgz", + "integrity": "sha512-JdyLYFtyvqDP7mqnKaAyuYD+VMtzAHbUf3kumNQV5QALxjBGmb95HXD0uug1bGol053dtV5yO3NNpGHOMj413g==", + "deprecated": "This is a stub types definition. react-fade-in provides its own type definitions, so you do not need this installed.", + "dev": true, + "dependencies": { + "react-fade-in": "*" + } + }, + "node_modules/@types/react-fade-in/node_modules/react": { + "version": "17.0.2", + "resolved": "https://registry.npmjs.org/react/-/react-17.0.2.tgz", + "integrity": "sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==", + "dev": true, + "peer": true, + "dependencies": { + "loose-envify": "^1.1.0", + "object-assign": "^4.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@types/react-fade-in/node_modules/react-fade-in": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/react-fade-in/-/react-fade-in-2.0.1.tgz", + "integrity": "sha512-oqS/WT4znaXEHmL+yo0IDUDY7uC9K4RP35j1SdRUEBspR09B2iIC0i8oJ28tPOr6Ez/L2aktF9p89j+DbsTVNw==", + "dev": true, + "peerDependencies": { + "react": "^16.8 || 17" + } + }, "node_modules/@types/react-loadable": { "version": "5.5.11", "resolved": "https://registry.npmjs.org/@types/react-loadable/-/react-loadable-5.5.11.tgz", @@ -2360,6 +2396,15 @@ "@types/webpack": "^4" } }, + "node_modules/@types/react-lottie": { + "version": "1.2.10", + "resolved": "https://registry.npmjs.org/@types/react-lottie/-/react-lottie-1.2.10.tgz", + "integrity": "sha512-rCd1p3US4ELKJlqwVnP0h5b24zt5p9OCvKUoNpYExLqwbFZMWEiJ6EGLMmH7nmq5V7KomBIbWO2X/XRFsL0vCA==", + "dev": true, + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/react-select-country-list": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/@types/react-select-country-list/-/react-select-country-list-2.2.3.tgz", @@ -2920,6 +2965,20 @@ "resolved": "", "link": true }, + "node_modules/babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha512-ITKNuq2wKlW1fJg9sSW52eepoYgZBggvOAHC0u/CYu/qxQ9EVzThCgR69BnSXLHjy2f7SY5zaQ4yt7H9ZVxY2g==", + "dependencies": { + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" + } + }, + "node_modules/babel-runtime/node_modules/regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, "node_modules/bail": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/bail/-/bail-2.0.2.tgz", @@ -3611,6 +3670,13 @@ "node": ">= 0.6" } }, + "node_modules/core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==", + "deprecated": "core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.", + "hasInstallScript": true + }, "node_modules/core-js-pure": { "version": "3.38.1", "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.38.1.tgz", @@ -6073,6 +6139,11 @@ "loose-envify": "cli.js" } }, + "node_modules/lottie-web": { + "version": "5.12.2", + "resolved": "https://registry.npmjs.org/lottie-web/-/lottie-web-5.12.2.tgz", + "integrity": "sha512-uvhvYPC8kGPjXT3MyKMrL3JitEAmDMp30lVkuq/590Mw9ok6pWcFCwXJveo0t5uqYw1UREQHofD+jVpdjBv8wg==" + }, "node_modules/lru-cache": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", @@ -7610,6 +7681,21 @@ "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" }, + "node_modules/react-lottie": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/react-lottie/-/react-lottie-1.2.4.tgz", + "integrity": "sha512-kBGxI+MIZGBf4wZhNCWwHkMcVP+kbpmrLWH/SkO0qCKc7D7eSPcxQbfpsmsCo8v2KCBYjuGSou+xTqK44D/jMg==", + "dependencies": { + "babel-runtime": "^6.26.0", + "lottie-web": "^5.1.3" + }, + "engines": { + "npm": "^3.0.0" + }, + "peerDependencies": { + "react": ">=15.0.0" + } + }, "node_modules/react-markdown": { "version": "9.0.1", "resolved": "https://registry.npmjs.org/react-markdown/-/react-markdown-9.0.1.tgz", diff --git a/package.json b/package.json index 6b372a0..80c2a9a 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@hookform/resolvers": "^3.9.0", + "@radix-ui/react-alert-dialog": "^1.1.2", "@radix-ui/react-avatar": "^1.1.0", "@radix-ui/react-dialog": "^1.1.2", "@radix-ui/react-dropdown-menu": "^2.1.1", @@ -47,6 +48,7 @@ "react-dom": "^18", "react-hook-form": "^7.53.0", "react-hot-toast": "^2.4.1", + "react-lottie": "^1.2.4", "react-markdown": "^9.0.1", "recharts": "^2.12.7", "stripe": "^17.1.0", @@ -63,6 +65,8 @@ "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", + "@types/react-fade-in": "^2.0.2", + "@types/react-lottie": "^1.2.10", "@types/react-select-country-list": "^2.2.3", "eslint": "^8", "eslint-config-next": "14.2.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b750070..02d4f63 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,13 +1,12 @@ lockfileVersion: '6.0' -settings: - autoInstallPeers: true - excludeLinksFromLockfile: false - dependencies: '@hookform/resolvers': specifier: ^3.9.0 version: 3.9.0(react-hook-form@7.53.0) + '@radix-ui/react-alert-dialog': + specifier: ^1.1.2 + version: 1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) '@radix-ui/react-avatar': specifier: ^1.1.0 version: 1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) @@ -116,6 +115,9 @@ dependencies: react-hot-toast: specifier: ^2.4.1 version: 2.4.1(csstype@3.1.3)(react-dom@18.3.1)(react@18.3.1) + react-lottie: + specifier: ^1.2.4 + version: 1.2.4(react@18.3.1) react-markdown: specifier: ^9.0.1 version: 9.0.1(@types/react@18.3.4)(react@18.3.1) @@ -160,6 +162,12 @@ devDependencies: '@types/react-dom': specifier: ^18 version: 18.3.0 + '@types/react-fade-in': + specifier: ^2.0.2 + version: 2.0.2(react@18.3.1) + '@types/react-lottie': + specifier: ^1.2.10 + version: 1.2.10 '@types/react-select-country-list': specifier: ^2.2.3 version: 2.2.3 @@ -643,6 +651,31 @@ packages: resolution: {integrity: sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA==} dev: false + /@radix-ui/react-alert-dialog@1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): + resolution: {integrity: sha512-eGSlLzPhKO+TErxkiGcCZGuvbVMnLA1MTnyBksGOeGRGkxHiiJUujsjmNTdWTm4iHVSRaUao9/4Ur671auMghQ==} + peerDependencies: + '@types/react': '*' + '@types/react-dom': '*' + react: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + react-dom: ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc + peerDependenciesMeta: + '@types/react': + optional: true + '@types/react-dom': + optional: true + dependencies: + '@radix-ui/primitive': 1.1.0 + '@radix-ui/react-compose-refs': 1.1.0(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-context': 1.1.1(@types/react@18.3.4)(react@18.3.1) + '@radix-ui/react-dialog': 1.1.2(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-primitive': 2.0.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1) + '@radix-ui/react-slot': 1.1.0(@types/react@18.3.4)(react@18.3.1) + '@types/react': 18.3.4 + '@types/react-dom': 18.3.0 + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + dev: false + /@radix-ui/react-arrow@1.1.0(@types/react-dom@18.3.0)(@types/react@18.3.4)(react-dom@18.3.1)(react@18.3.1): resolution: {integrity: sha512-FmlW1rCg7hBpEBwFbjHwCW6AmWLQM6g/v0Sn8XbP9NvmSZ2San1FpQeyPtufzOMSIx7Y4dzjlHoifhp+7NkZhw==} peerDependencies: @@ -2175,6 +2208,21 @@ packages: dependencies: '@types/react': 18.3.4 + /@types/react-fade-in@2.0.2(react@18.3.1): + resolution: {integrity: sha512-JdyLYFtyvqDP7mqnKaAyuYD+VMtzAHbUf3kumNQV5QALxjBGmb95HXD0uug1bGol053dtV5yO3NNpGHOMj413g==} + deprecated: This is a stub types definition. react-fade-in provides its own type definitions, so you do not need this installed. + dependencies: + react-fade-in: 2.0.1(react@18.3.1) + transitivePeerDependencies: + - react + dev: true + + /@types/react-lottie@1.2.10: + resolution: {integrity: sha512-rCd1p3US4ELKJlqwVnP0h5b24zt5p9OCvKUoNpYExLqwbFZMWEiJ6EGLMmH7nmq5V7KomBIbWO2X/XRFsL0vCA==} + dependencies: + '@types/react': 18.3.4 + dev: true + /@types/react-select-country-list@2.2.3: resolution: {integrity: sha512-nffcYOwuun+5B0EWqubK+amHpPdK9Xj20xkLYNqYrzmESd8FnpLwHsS79ClLAWA9y+icVA8gWPkbwBp1gpjSwA==} dev: true @@ -2496,7 +2544,6 @@ packages: dependencies: core-js: 2.6.12 regenerator-runtime: 0.11.1 - dev: true /babel-types@6.26.0: resolution: {integrity: sha512-zhe3V/26rCWsEZK8kZN+HaQj5yQ1CilTObixFzKW1UWjqG7618Twz6YEsCnjfg5gBcJh02DrpCkS9h98ZqDY+g==} @@ -2777,7 +2824,6 @@ packages: resolution: {integrity: sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==} deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. requiresBuild: true - dev: true /countup.js@2.8.0: resolution: {integrity: sha512-f7xEhX0awl4NOElHulrl4XRfKoNH3rB+qfNSZZyjSZhaAoUk6elvhH+MNxMmlmuUJ2/QNTWPSA7U4mNtIAKljQ==} @@ -4422,6 +4468,10 @@ packages: dependencies: js-tokens: 4.0.0 + /lottie-web@5.12.2: + resolution: {integrity: sha512-uvhvYPC8kGPjXT3MyKMrL3JitEAmDMp30lVkuq/590Mw9ok6pWcFCwXJveo0t5uqYw1UREQHofD+jVpdjBv8wg==} + dev: false + /lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} @@ -5348,6 +5398,14 @@ packages: react: 18.3.1 scheduler: 0.23.2 + /react-fade-in@2.0.1(react@18.3.1): + resolution: {integrity: sha512-oqS/WT4znaXEHmL+yo0IDUDY7uC9K4RP35j1SdRUEBspR09B2iIC0i8oJ28tPOr6Ez/L2aktF9p89j+DbsTVNw==} + peerDependencies: + react: ^16.8 || 17 + dependencies: + react: 18.3.1 + dev: true + /react-hook-form@7.53.0(react@18.3.1): resolution: {integrity: sha512-M1n3HhqCww6S2hxLxciEXy2oISPnAzxY7gvwVPrtlczTM/1dDadXgUxDpHMrMTblDOcm/AXtXxHwZ3jpg1mqKQ==} engines: {node: '>=18.0.0'} @@ -5378,6 +5436,17 @@ packages: resolution: {integrity: sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==} dev: true + /react-lottie@1.2.4(react@18.3.1): + resolution: {integrity: sha512-kBGxI+MIZGBf4wZhNCWwHkMcVP+kbpmrLWH/SkO0qCKc7D7eSPcxQbfpsmsCo8v2KCBYjuGSou+xTqK44D/jMg==} + engines: {npm: ^3.0.0} + peerDependencies: + react: '>=15.0.0' + dependencies: + babel-runtime: 6.26.0 + lottie-web: 5.12.2 + react: 18.3.1 + dev: false + /react-markdown@9.0.1(@types/react@18.3.4)(react@18.3.1): resolution: {integrity: sha512-186Gw/vF1uRkydbsOIkcGXw7aHq0sZOCRFFjGrr7b9+nVZg4UfA4enXCaxm4fUzecU38sWfrNDitGhshuU7rdg==} peerDependencies: @@ -5579,7 +5648,6 @@ packages: /regenerator-runtime@0.11.1: resolution: {integrity: sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==} - dev: true /regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} @@ -6556,3 +6624,7 @@ packages: /zwitch@2.0.4: resolution: {integrity: sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==} dev: false + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index 2dad32e..4959a42 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -8,6 +8,7 @@ import { businessFormSchema } from "@/types/schemas/application.schema"; import Swal from "sweetalert2"; import { getCurrentUserID } from "@/app/api/userApi"; import { uploadFile } from "@/app/api/generalApi"; +import { Loader } from "@/components/loading/loader"; type businessSchema = z.infer; const BUCKET_PITCH_NAME = "business-pitches"; @@ -16,6 +17,7 @@ let supabase = createSupabaseClient(); export default function ApplyBusiness() { const [applyProject, setApplyProject] = useState(false); const alertShownRef = useRef(false); + const [success, setSucess] = useState(false); const onSubmit: SubmitHandler = async (data) => { const transformedData = await transformChoice(data); @@ -119,9 +121,11 @@ export default function ApplyBusiness() { useEffect(() => { const fetchUserData = async () => { try { + setSucess(false); const userID = await getCurrentUserID(); if (userID) { const hasApplied = await hasUserApplied(userID); + setSucess(true); if (hasApplied && !alertShownRef.current) { alertShownRef.current = true; Swal.fire({ @@ -150,6 +154,7 @@ export default function ApplyBusiness() { return (
+

Apply to raise on B2DVentures diff --git a/src/components/loading/loader.tsx b/src/components/loading/loader.tsx new file mode 100644 index 0000000..4098107 --- /dev/null +++ b/src/components/loading/loader.tsx @@ -0,0 +1,39 @@ +import Lottie from "react-lottie"; +import * as loadingData from "./loading.json"; +import * as successData from "./success.json"; + +const loadingOption = { + loop: true, + autoplay: true, + animationData: loadingData, + rendererSettings: { + preserveAspectRatio: "xMidYMid slice", + }, +}; +const successOption = { + loop: false, + autoplay: true, + animationData: successData, + rendererSettings: { + preserveAspectRatio: "xMidYMid slice", + }, +}; + +interface LoaderProps { + isSuccess: boolean; +} + +export function Loader(props: LoaderProps) { + return ( +
+ {!props.isSuccess && ( + + )} + {/* {!props.isSuccess ? ( + + ) : ( + + )} */} +
+ ); +} diff --git a/src/components/loading/loading.json b/src/components/loading/loading.json new file mode 100644 index 0000000..c199f2a --- /dev/null +++ b/src/components/loading/loading.json @@ -0,0 +1,2549 @@ +{ + "v": "5.7.4", + "fr": 29.9700012207031, + "ip": 0, + "op": 30.0000012219251, + "w": 100, + "h": 100, + "nm": "loading", + "ddd": 0, + "assets": [], + "layers": [ + { + "ddd": 0, + "ind": 1, + "ty": 4, + "nm": "Layer 1 Outlines", + "sr": 1, + "ks": { + "o": { + "a": 0, + "k": 100, + "ix": 11 + }, + "r": { + "a": 0, + "k": 0, + "ix": 10 + }, + "p": { + "a": 0, + "k": [50, 50.029, 0], + "ix": 2, + "l": 2 + }, + "a": { + "a": 0, + "k": [48.861, 46.038, 0], + "ix": 1, + "l": 2 + }, + "s": { + "a": 0, + "k": [100, 100, 100], + "ix": 6, + "l": 2 + } + }, + "ao": 0, + "ef": [ + { + "ty": 21, + "nm": "Fill", + "np": 9, + "mn": "ADBE Fill", + "ix": 1, + "en": 1, + "ef": [ + { + "ty": 10, + "nm": "Fill Mask", + "mn": "ADBE Fill-0001", + "ix": 1, + "v": { + "a": 0, + "k": 0, + "ix": 1 + } + }, + { + "ty": 7, + "nm": "All Masks", + "mn": "ADBE Fill-0007", + "ix": 2, + "v": { + "a": 0, + "k": 0, + "ix": 2 + } + }, + { + "ty": 2, + "nm": "Color", + "mn": "ADBE Fill-0002", + "ix": 3, + "v": { + "a": 0, + "k": [0.623529434204, 0.415686279535, 1, 1], + "ix": 3 + } + }, + { + "ty": 7, + "nm": "Invert", + "mn": "ADBE Fill-0006", + "ix": 4, + "v": { + "a": 0, + "k": 0, + "ix": 4 + } + }, + { + "ty": 0, + "nm": "Horizontal Feather", + "mn": "ADBE Fill-0003", + "ix": 5, + "v": { + "a": 0, + "k": 0, + "ix": 5 + } + }, + { + "ty": 0, + "nm": "Vertical Feather", + "mn": "ADBE Fill-0004", + "ix": 6, + "v": { + "a": 0, + "k": 0, + "ix": 6 + } + }, + { + "ty": 0, + "nm": "Opacity", + "mn": "ADBE Fill-0005", + "ix": 7, + "v": { + "a": 0, + "k": 1, + "ix": 7 + } + } + ] + } + ], + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0] + ], + "o": [ + [0, 0], + [0, 0] + ], + "v": [ + [3, 48.649], + [19.787, 48.649] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [0, 0], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 2", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0], + [0, 3.292], + [0, 0], + [-2.902, 0], + [0, -2.902], + [0, 0] + ], + "o": [ + [0, 0], + [3.292, 0], + [0, 0], + [0, -2.902], + [2.901, 0], + [0, 0], + [0, 0] + ], + "v": [ + [-8.659, 10.089], + [-7.81, 10.089], + [-1.85, 4.13], + [-1.85, -4.836], + [3.405, -10.09], + [8.659, -4.836], + [8.659, 10.089] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [28.446, 38.56], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 4", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 2, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0], + [2.902, 0], + [0, 2.902], + [0, 0] + ], + "o": [ + [0, 0], + [0, 2.902], + [-2.902, 0], + [0, 0], + [0, 0] + ], + "v": [ + [5.254, -14.213], + [5.254, 8.959], + [0, 14.213], + [-5.254, 8.959], + [-5.254, -14.213] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [42.359, 62.862], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 5", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 3, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0], + [-2.902, 0], + [0, -2.902], + [0, 0] + ], + "o": [ + [0, 0], + [0, -2.902], + [2.902, 0], + [0, 0], + [0, 0] + ], + "v": [ + [-5.254, 16.824], + [-5.254, -11.57], + [0, -16.824], + [5.254, -11.57], + [5.254, 16.824] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [52.867, 31.825], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 6", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 4, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0], + [0, -3.385], + [0, 0], + [2.902, 0], + [0, 2.902], + [0, 0] + ], + "o": [ + [0, 0], + [-3.384, 0], + [0, 0], + [0, 2.902], + [-2.902, 0], + [0, 0], + [0, 0] + ], + "v": [ + [8.407, -9.019], + [8.407, -9.019], + [2.102, -2.891], + [2.102, 3.765], + [-3.153, 9.019], + [-8.406, 3.765], + [-8.406, -9.019] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [66.529, 57.668], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 3", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 5, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0] + ], + "o": [ + [0, 0], + [0, 0] + ], + "v": [ + [94.722, 48.649], + [74.935, 48.649] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [0, 0], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 6, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "tm", + "s": { + "a": 0, + "k": 26, + "ix": 1 + }, + "e": { + "a": 0, + "k": 60, + "ix": 2 + }, + "o": { + "a": 1, + "k": [ + { + "i": { + "x": [0.982], + "y": [1] + }, + "o": { + "x": [0.024], + "y": [0] + }, + "t": 0, + "s": [0] + }, + { + "i": { + "x": [0.667], + "y": [1] + }, + "o": { + "x": [0.333], + "y": [0] + }, + "t": 30, + "s": [360] + }, + { + "t": 60.0000024438501, + "s": [0] + } + ], + "ix": 3 + }, + "m": 1, + "ix": 7, + "nm": "Trim Paths 1", + "mn": "ADBE Vector Filter - Trim", + "hd": false + } + ], + "ip": 0, + "op": 30.0000012219251, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 2, + "ty": 4, + "nm": "Layer 1 Outlines 2", + "sr": 1, + "ks": { + "o": { + "a": 0, + "k": 100, + "ix": 11 + }, + "r": { + "a": 0, + "k": 0, + "ix": 10 + }, + "p": { + "a": 0, + "k": [50, 50.029, 0], + "ix": 2, + "l": 2 + }, + "a": { + "a": 0, + "k": [48.861, 46.038, 0], + "ix": 1, + "l": 2 + }, + "s": { + "a": 0, + "k": [100, 100, 100], + "ix": 6, + "l": 2 + } + }, + "ao": 0, + "ef": [ + { + "ty": 21, + "nm": "Fill", + "np": 9, + "mn": "ADBE Fill", + "ix": 1, + "en": 1, + "ef": [ + { + "ty": 10, + "nm": "Fill Mask", + "mn": "ADBE Fill-0001", + "ix": 1, + "v": { + "a": 0, + "k": 0, + "ix": 1 + } + }, + { + "ty": 7, + "nm": "All Masks", + "mn": "ADBE Fill-0007", + "ix": 2, + "v": { + "a": 0, + "k": 0, + "ix": 2 + } + }, + { + "ty": 2, + "nm": "Color", + "mn": "ADBE Fill-0002", + "ix": 3, + "v": { + "a": 0, + "k": [1, 0.415686279535, 0.827450990677, 1], + "ix": 3 + } + }, + { + "ty": 7, + "nm": "Invert", + "mn": "ADBE Fill-0006", + "ix": 4, + "v": { + "a": 0, + "k": 0, + "ix": 4 + } + }, + { + "ty": 0, + "nm": "Horizontal Feather", + "mn": "ADBE Fill-0003", + "ix": 5, + "v": { + "a": 0, + "k": 0, + "ix": 5 + } + }, + { + "ty": 0, + "nm": "Vertical Feather", + "mn": "ADBE Fill-0004", + "ix": 6, + "v": { + "a": 0, + "k": 0, + "ix": 6 + } + }, + { + "ty": 0, + "nm": "Opacity", + "mn": "ADBE Fill-0005", + "ix": 7, + "v": { + "a": 0, + "k": 1, + "ix": 7 + } + } + ] + } + ], + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0] + ], + "o": [ + [0, 0], + [0, 0] + ], + "v": [ + [3, 48.649], + [19.787, 48.649] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [0, 0], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 2", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0], + [0, 3.292], + [0, 0], + [-2.902, 0], + [0, -2.902], + [0, 0] + ], + "o": [ + [0, 0], + [3.292, 0], + [0, 0], + [0, -2.902], + [2.901, 0], + [0, 0], + [0, 0] + ], + "v": [ + [-8.659, 10.089], + [-7.81, 10.089], + [-1.85, 4.13], + [-1.85, -4.836], + [3.405, -10.09], + [8.659, -4.836], + [8.659, 10.089] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [28.446, 38.56], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 4", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 2, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0], + [2.902, 0], + [0, 2.902], + [0, 0] + ], + "o": [ + [0, 0], + [0, 2.902], + [-2.902, 0], + [0, 0], + [0, 0] + ], + "v": [ + [5.254, -14.213], + [5.254, 8.959], + [0, 14.213], + [-5.254, 8.959], + [-5.254, -14.213] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [42.359, 62.862], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 5", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 3, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0], + [-2.902, 0], + [0, -2.902], + [0, 0] + ], + "o": [ + [0, 0], + [0, -2.902], + [2.902, 0], + [0, 0], + [0, 0] + ], + "v": [ + [-5.254, 16.824], + [-5.254, -11.57], + [0, -16.824], + [5.254, -11.57], + [5.254, 16.824] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [52.867, 31.825], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 6", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 4, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0], + [0, -3.385], + [0, 0], + [2.902, 0], + [0, 2.902], + [0, 0] + ], + "o": [ + [0, 0], + [-3.384, 0], + [0, 0], + [0, 2.902], + [-2.902, 0], + [0, 0], + [0, 0] + ], + "v": [ + [8.407, -9.019], + [8.407, -9.019], + [2.102, -2.891], + [2.102, 3.765], + [-3.153, 9.019], + [-8.406, 3.765], + [-8.406, -9.019] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [66.529, 57.668], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 3", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 5, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0] + ], + "o": [ + [0, 0], + [0, 0] + ], + "v": [ + [94.722, 48.649], + [74.935, 48.649] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [0, 0], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 6, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "tm", + "s": { + "a": 0, + "k": 50, + "ix": 1 + }, + "e": { + "a": 0, + "k": 65, + "ix": 2 + }, + "o": { + "a": 1, + "k": [ + { + "i": { + "x": [0.982], + "y": [1] + }, + "o": { + "x": [0.024], + "y": [0] + }, + "t": 0, + "s": [40] + }, + { + "i": { + "x": [0.667], + "y": [1] + }, + "o": { + "x": [0.333], + "y": [0] + }, + "t": 30, + "s": [401] + }, + { + "t": 60.0000024438501, + "s": [40] + } + ], + "ix": 3 + }, + "m": 1, + "ix": 7, + "nm": "Trim Paths 1", + "mn": "ADBE Vector Filter - Trim", + "hd": false + } + ], + "ip": 0, + "op": 30.0000012219251, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 3, + "ty": 4, + "nm": "Layer 1 Outlines 3", + "sr": 1, + "ks": { + "o": { + "a": 0, + "k": 100, + "ix": 11 + }, + "r": { + "a": 0, + "k": 0, + "ix": 10 + }, + "p": { + "a": 0, + "k": [50, 50.029, 0], + "ix": 2, + "l": 2 + }, + "a": { + "a": 0, + "k": [48.861, 46.038, 0], + "ix": 1, + "l": 2 + }, + "s": { + "a": 0, + "k": [100, 100, 100], + "ix": 6, + "l": 2 + } + }, + "ao": 0, + "ef": [ + { + "ty": 21, + "nm": "Fill", + "np": 9, + "mn": "ADBE Fill", + "ix": 1, + "en": 1, + "ef": [ + { + "ty": 10, + "nm": "Fill Mask", + "mn": "ADBE Fill-0001", + "ix": 1, + "v": { + "a": 0, + "k": 0, + "ix": 1 + } + }, + { + "ty": 7, + "nm": "All Masks", + "mn": "ADBE Fill-0007", + "ix": 2, + "v": { + "a": 0, + "k": 0, + "ix": 2 + } + }, + { + "ty": 2, + "nm": "Color", + "mn": "ADBE Fill-0002", + "ix": 3, + "v": { + "a": 0, + "k": [1, 0.815686285496, 0.993494808674, 1], + "ix": 3 + } + }, + { + "ty": 7, + "nm": "Invert", + "mn": "ADBE Fill-0006", + "ix": 4, + "v": { + "a": 0, + "k": 0, + "ix": 4 + } + }, + { + "ty": 0, + "nm": "Horizontal Feather", + "mn": "ADBE Fill-0003", + "ix": 5, + "v": { + "a": 0, + "k": 0, + "ix": 5 + } + }, + { + "ty": 0, + "nm": "Vertical Feather", + "mn": "ADBE Fill-0004", + "ix": 6, + "v": { + "a": 0, + "k": 0, + "ix": 6 + } + }, + { + "ty": 0, + "nm": "Opacity", + "mn": "ADBE Fill-0005", + "ix": 7, + "v": { + "a": 0, + "k": 1, + "ix": 7 + } + } + ] + } + ], + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0] + ], + "o": [ + [0, 0], + [0, 0] + ], + "v": [ + [3, 48.649], + [19.787, 48.649] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [0, 0], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 2", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0], + [0, 3.292], + [0, 0], + [-2.902, 0], + [0, -2.902], + [0, 0] + ], + "o": [ + [0, 0], + [3.292, 0], + [0, 0], + [0, -2.902], + [2.901, 0], + [0, 0], + [0, 0] + ], + "v": [ + [-8.659, 10.089], + [-7.81, 10.089], + [-1.85, 4.13], + [-1.85, -4.836], + [3.405, -10.09], + [8.659, -4.836], + [8.659, 10.089] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [28.446, 38.56], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 4", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 2, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0], + [2.902, 0], + [0, 2.902], + [0, 0] + ], + "o": [ + [0, 0], + [0, 2.902], + [-2.902, 0], + [0, 0], + [0, 0] + ], + "v": [ + [5.254, -14.213], + [5.254, 8.959], + [0, 14.213], + [-5.254, 8.959], + [-5.254, -14.213] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [42.359, 62.862], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 5", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 3, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0], + [-2.902, 0], + [0, -2.902], + [0, 0] + ], + "o": [ + [0, 0], + [0, -2.902], + [2.902, 0], + [0, 0], + [0, 0] + ], + "v": [ + [-5.254, 16.824], + [-5.254, -11.57], + [0, -16.824], + [5.254, -11.57], + [5.254, 16.824] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [52.867, 31.825], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 6", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 4, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0], + [0, -3.385], + [0, 0], + [2.902, 0], + [0, 2.902], + [0, 0] + ], + "o": [ + [0, 0], + [-3.384, 0], + [0, 0], + [0, 2.902], + [-2.902, 0], + [0, 0], + [0, 0] + ], + "v": [ + [8.407, -9.019], + [8.407, -9.019], + [2.102, -2.891], + [2.102, 3.765], + [-3.153, 9.019], + [-8.406, 3.765], + [-8.406, -9.019] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [66.529, 57.668], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 3", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 5, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0] + ], + "o": [ + [0, 0], + [0, 0] + ], + "v": [ + [94.722, 48.649], + [74.935, 48.649] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.172549019608, 0.192156877705, 0.286274509804, 1], + "ix": 3 + }, + "o": { + "a": 0, + "k": 100, + "ix": 4 + }, + "w": { + "a": 0, + "k": 6, + "ix": 5 + }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { + "a": 0, + "k": [0, 0], + "ix": 2 + }, + "a": { + "a": 0, + "k": [0, 0], + "ix": 1 + }, + "s": { + "a": 0, + "k": [100, 100], + "ix": 3 + }, + "r": { + "a": 0, + "k": 0, + "ix": 6 + }, + "o": { + "a": 0, + "k": 100, + "ix": 7 + }, + "sk": { + "a": 0, + "k": 0, + "ix": 4 + }, + "sa": { + "a": 0, + "k": 0, + "ix": 5 + }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 6, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "tm", + "s": { + "a": 0, + "k": 50, + "ix": 1 + }, + "e": { + "a": 0, + "k": 66, + "ix": 2 + }, + "o": { + "a": 1, + "k": [ + { + "i": { + "x": [0.982], + "y": [1] + }, + "o": { + "x": [0.024], + "y": [0] + }, + "t": 0, + "s": [88] + }, + { + "i": { + "x": [0.667], + "y": [1] + }, + "o": { + "x": [0.333], + "y": [0] + }, + "t": 30, + "s": [448] + }, + { + "t": 60.0000024438501, + "s": [40] + } + ], + "ix": 3 + }, + "m": 1, + "ix": 7, + "nm": "Trim Paths 1", + "mn": "ADBE Vector Filter - Trim", + "hd": false + } + ], + "ip": 0, + "op": 30.0000012219251, + "st": 0, + "bm": 0 + } + ], + "markers": [] +} diff --git a/src/components/loading/success.json b/src/components/loading/success.json new file mode 100644 index 0000000..deb94ff --- /dev/null +++ b/src/components/loading/success.json @@ -0,0 +1,2214 @@ +{ + "v": "5.7.3", + "fr": 60, + "ip": 0, + "op": 180, + "w": 1920, + "h": 1920, + "nm": "animation", + "ddd": 0, + "assets": [], + "layers": [ + { + "ddd": 0, + "ind": 1, + "ty": 4, + "nm": "Tick", + "parent": 4, + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 0, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 3.115, + "s": [100] + }, + { "t": 20.796875, "s": [100] } + ], + "ix": 11 + }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "t": 12, + "s": [-165] + }, + { "t": 39, "s": [0] } + ], + "ix": 10 + }, + "p": { "a": 0, "k": [346.916, 346.917, 0], "ix": 2 }, + "a": { "a": 0, "k": [278.033, 227.218, 0], "ix": 1 }, + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667, 0.667], "y": [1, 1, 1] }, + "o": { "x": [0.333, 0.333, 0.333], "y": [0, 0, 0] }, + "t": 19.533, + "s": [20, 20, 100] + }, + { "t": 38.48046875, "s": [100, 100, 100] } + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [0, 0], + [0, 0] + ], + "o": [ + [0, 0], + [0, 0], + [0, 0] + ], + "v": [ + [-153.033, 0.588], + [-51.404, 102.218], + [153.032, -102.218] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { "a": 0, "k": [1, 1, 1, 1], "ix": 3 }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 55, "ix": 5 }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [278.033, 227.218], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + }, + { + "ty": "tm", + "s": { "a": 0, "k": 0, "ix": 1 }, + "e": { + "a": 1, + "k": [ + { + "i": { "x": [0.33], "y": [1] }, + "o": { "x": [0.67], "y": [0] }, + "t": 20.164, + "s": [0] + }, + { "t": 38.48046875, "s": [100] } + ], + "ix": 2 + }, + "o": { "a": 0, "k": 0, "ix": 3 }, + "m": 1, + "ix": 2, + "nm": "Trim Paths 1", + "mn": "ADBE Vector Filter - Trim", + "hd": false + } + ], + "ip": 0, + "op": 1800, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 2, + "ty": 4, + "nm": "Glow Mask", + "td": 1, + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 0, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 3.115, + "s": [100] + }, + { "t": 20.796875, "s": [100] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.783, "y": 0.48 }, + "o": { "x": 0.506, "y": 0 }, + "t": 0, + "s": [1099.01, 1187.835, 0], + "to": [-51.058, -20.951, 0], + "ti": [23.519, 29.424, 0] + }, + { + "i": { "x": 0.576, "y": 1 }, + "o": { "x": 0.337, "y": 0.496 }, + "t": 19.533, + "s": [989.155, 1114.015, 0], + "to": [-26.997, -33.775, 0], + "ti": [3.563, 56.649, 0] + }, + { "t": 32.1640625, "s": [947.01, 981.835, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [346.917, 346.917, 0], "ix": 1 }, + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667, 0.667], "y": [1, 1, 1] }, + "o": { "x": [0.333, 0.333, 0.333], "y": [0, 0, 0] }, + "t": 19.533, + "s": [20, 20, 100] + }, + { + "i": { "x": [0.833, 0.833, 0.833], "y": [1, 1, 1] }, + "o": { "x": [0.333, 0.333, 0.333], "y": [0, 0, 0] }, + "t": 38.48, + "s": [110, 110, 100] + }, + { + "i": { "x": [0.833, 0.833, 0.833], "y": [1, 1, 1] }, + "o": { "x": [0.167, 0.167, 0.167], "y": [0, 0, 0] }, + "t": 51.109, + "s": [95, 95, 100] + }, + { + "i": { "x": [0.833, 0.833, 0.833], "y": [1, 1, 1] }, + "o": { "x": [0.167, 0.167, 0.167], "y": [0, 0, 0] }, + "t": 58.688, + "s": [102, 102, 100] + }, + { + "i": { "x": [0.833, 0.833, 0.833], "y": [1, 1, 1] }, + "o": { "x": [0.167, 0.167, 0.167], "y": [0, 0, 0] }, + "t": 63.74, + "s": [98, 98, 100] + }, + { "t": 70.0546875, "s": [100, 100, 100] } + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, -191.459], + [191.459, 0], + [0, 191.458], + [-191.458, 0] + ], + "o": [ + [0, 191.458], + [-191.458, 0], + [0, -191.459], + [191.459, 0] + ], + "v": [ + [346.667, 0], + [0, 346.667], + [-346.667, 0], + [0, -346.666] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [0.118000000598, 0.442999985639, 0.929000016755, 1], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [346.916, 346.917], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 1800, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 3, + "ty": 4, + "nm": "Glow", + "tt": 1, + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 0, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 3.115, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.643] }, + "o": { "x": [0.72], "y": [0] }, + "t": 70.055, + "s": [100] + }, + { "t": 89, "s": [0] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.833, "y": 0.788 }, + "o": { "x": 0.72, "y": 0 }, + "t": 59.951, + "s": [56, 440, 0], + "to": [226.667, 131.333, 0], + "ti": [-226.667, -131.333, 0] + }, + { "t": 89, "s": [1416, 1228, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [0, 0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [348.655, 1.947], + [0, 0], + [35.647, 880.072] + ], + "o": [ + [0, 0], + [-8.868, -0.049], + [0, 0], + [-3.819, -94.283] + ], + "v": [ + [211.999, -440], + [-480, 280], + [-136, 648], + [483.999, -312] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [0.76862745098, 0.823067997951, 1, 1], + "ix": 4 + }, + "o": { "a": 0, "k": 30, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [0, 0], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Shape 1", + "np": 3, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 1800, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 4, + "ty": 4, + "nm": "Background Circle (Blue)", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 0, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 8, + "s": [100] + }, + { "t": 20.796875, "s": [100] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { "a": 0, "k": [960, 960, 0], "ix": 2 }, + "a": { "a": 0, "k": [346.917, 346.917, 0], "ix": 1 }, + "s": { + "a": 1, + "k": [ + { + "i": { "x": [0.667, 0.667, 0.667], "y": [1, 1, 1] }, + "o": { "x": [0.333, 0.333, 0.333], "y": [0, 0, 0] }, + "t": 19.533, + "s": [20, 20, 100] + }, + { + "i": { "x": [0.833, 0.833, 0.833], "y": [1, 1, 1] }, + "o": { "x": [0.333, 0.333, 0.333], "y": [0, 0, 0] }, + "t": 39, + "s": [110, 110, 100] + }, + { + "i": { "x": [0.833, 0.833, 0.833], "y": [1, 1, 1] }, + "o": { "x": [0.167, 0.167, 0.167], "y": [0, 0, 0] }, + "t": 51.109, + "s": [95, 95, 100] + }, + { + "i": { "x": [0.833, 0.833, 0.833], "y": [1, 1, 1] }, + "o": { "x": [0.167, 0.167, 0.167], "y": [0, 0, 0] }, + "t": 58.688, + "s": [102, 102, 100] + }, + { + "i": { "x": [0.833, 0.833, 0.833], "y": [1, 1, 1] }, + "o": { "x": [0.167, 0.167, 0.167], "y": [0, 0, 0] }, + "t": 63.74, + "s": [98, 98, 100] + }, + { "t": 70.0546875, "s": [100, 100, 100] } + ], + "ix": 6 + } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, -191.459], + [191.459, 0], + [0, 191.458], + [-191.458, 0] + ], + "o": [ + [0, 191.458], + [-191.458, 0], + [0, -191.459], + [191.459, 0] + ], + "v": [ + [346.667, 0], + [0, 346.667], + [-346.667, 0], + [0, -346.666] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [0.313725490196, 0.81568627451, 0.360784313725, 1], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [346.916, 346.917], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 0, + "op": 1800, + "st": 0, + "bm": 0 + }, + { + "ddd": 0, + "ind": 6, + "ty": 4, + "nm": "Element 11", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 10.793, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 12.871, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.601] }, + "o": { "x": [0.72], "y": [0] }, + "t": 27.42, + "s": [100] + }, + { "t": 56, "s": [0] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.33, "y": 1 }, + "o": { "x": 0.174, "y": 0 }, + "t": 15.99, + "s": [957.368, 957.581, 0], + "to": [-154.333, 61, 0], + "ti": [34.333, -69, 0] + }, + { "t": 32.615234375, "s": [774.545, 1455.048, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [88.379, 84.132, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [-17.539, 13.457], + [-12.743, -16.607], + [0, 0] + ], + "o": [ + [-12.743, -16.608], + [17.539, -13.458], + [0, 0], + [0, 0] + ], + "v": [ + [-25.635, 34.132], + [-16.894, -20.673], + [38.306, -14.931], + [38.379, -14.837] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.255000005984, 0.685999971278, 0.501999978458, 1], + "ix": 3 + }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 20, "ix": 5 }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [88.378, 84.131], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 15, + "op": 1815, + "st": 15, + "bm": 0 + }, + { + "ddd": 0, + "ind": 7, + "ty": 4, + "nm": "Element 10", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 10.793, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 12.871, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.601] }, + "o": { "x": [0.72], "y": [0] }, + "t": 27.42, + "s": [100] + }, + { "t": 56, "s": [0] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.33, "y": 1 }, + "o": { "x": 0.229, "y": 0 }, + "t": 15.99, + "s": [960, 960, 0], + "to": [59.019, 77.842, 0], + "ti": [-71.667, -48, 0] + }, + { "t": 34.6953125, "s": [1314.113, 1427.051, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [33.514, 41.664, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [3.281, -1.895], + [0, 0], + [1.894, 3.281], + [0, 0], + [-3.281, 1.894], + [0, 0], + [-1.894, -3.282], + [0, 0] + ], + "o": [ + [0, 0], + [-3.281, 1.894], + [0, 0], + [-1.894, -3.283], + [0, 0], + [3.281, -1.895], + [0, 0], + [1.894, 3.281] + ], + "v": [ + [28.859, 29.055], + [10.732, 39.52], + [1.361, 37.009], + [-31.37, -19.681], + [-28.859, -29.053], + [-10.732, -39.519], + [-1.361, -37.008], + [31.37, 19.683] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [0.275, 0.513999968884, 0.961000031116, 1], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [33.514, 41.664], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 15, + "op": 1815, + "st": 15, + "bm": 0 + }, + { + "ddd": 0, + "ind": 8, + "ty": 4, + "nm": "Element 9", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 10.793, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 12.871, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.601] }, + "o": { "x": [0.72], "y": [0] }, + "t": 27.42, + "s": [100] + }, + { "t": 56, "s": [0] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.33, "y": 1 }, + "o": { "x": 0.189, "y": 0 }, + "t": 15.99, + "s": [961.262, 961.213, 0], + "to": [70.333, -5.667, 0], + "ti": [-62.333, -30.333, 0] + }, + { "t": 33.134765625, "s": [1420.768, 1239.936, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [60.548, 78.82, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [2.886, -21.917], + [20.753, 2.734], + [0.039, 0.005] + ], + "o": [ + [20.754, 2.733], + [-2.886, 21.918], + [-0.04, -0.005], + [0, 0] + ], + "v": [ + [-12.409, -41.32], + [20.162, 3.615], + [-22.93, 38.586], + [-23.048, 38.571] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.972549019608, 0.149019607843, 0.505882352941, 1], + "ix": 3 + }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 15, "ix": 5 }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [60.548, 78.82], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 15, + "op": 1815, + "st": 15, + "bm": 0 + }, + { + "ddd": 0, + "ind": 9, + "ty": 4, + "nm": "Element 8", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 10.793, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 12.871, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.601] }, + "o": { "x": [0.72], "y": [0] }, + "t": 27.42, + "s": [100] + }, + { "t": 56, "s": [0] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.33, "y": 1 }, + "o": { "x": 0.263, "y": 0 }, + "t": 15.99, + "s": [959.692, 959.692, 0], + "to": [46.333, -81.667, 0], + "ti": [-98.333, 51.667, 0] + }, + { "t": 46.126953125, "s": [1397.413, 873.271, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [47.326, 47.325, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [-11.644, -3.948], + [0, 0], + [-3.912, 2.92], + [0, 0], + [0.157, -12.294], + [0, 0], + [-3.985, -2.819], + [0, 0], + [11.74, -3.65], + [0, 0], + [1.449, -4.662], + [0, 0], + [7.098, 10.038], + [0, 0], + [4.882, -0.063], + [0, 0], + [-7.354, 9.853], + [0, 0], + [1.569, 4.624], + [0, 0] + ], + "o": [ + [0, 0], + [4.623, 1.568], + [0, 0], + [9.854, -7.353], + [0, 0], + [-0.062, 4.882], + [0, 0], + [10.038, 7.099], + [0, 0], + [-4.662, 1.449], + [0, 0], + [-3.649, 11.74], + [0, 0], + [-2.82, -3.986], + [0, 0], + [-12.293, 0.156], + [0, 0], + [2.92, -3.913], + [0, 0], + [-3.948, -11.644] + ], + "v": [ + [-17.558, -36.37], + [-13.481, -34.987], + [0.154, -37.147], + [3.606, -39.722], + [27.31, -27.644], + [27.255, -23.339], + [33.522, -11.038], + [37.038, -8.552], + [32.877, 17.724], + [28.763, 19.002], + [19.003, 28.764], + [17.724, 32.876], + [-8.551, 37.037], + [-11.037, 33.522], + [-23.338, 27.255], + [-27.644, 27.31], + [-39.721, 3.606], + [-37.146, 0.155], + [-34.987, -13.481], + [-36.37, -17.558] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [1, 0.736999990426, 0.195999998205, 1], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [47.325, 47.325], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 15, + "op": 1815, + "st": 15, + "bm": 0 + }, + { + "ddd": 0, + "ind": 10, + "ty": 4, + "nm": "Element 7", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 10.793, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 12.871, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.601] }, + "o": { "x": [0.72], "y": [0] }, + "t": 27.42, + "s": [100] + }, + { "t": 56, "s": [0] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.33, "y": 1 }, + "o": { "x": 0.229, "y": 0 }, + "t": 15.99, + "s": [958.09, 958.244, 0], + "to": [18.333, -110, 0], + "ti": [-64.333, 76, 0] + }, + { "t": 34.6953125, "s": [1316.148, 645.839, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [77.856, 74.774, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, 0], + [-12.731, 9.768], + [-9.249, -12.055], + [-0.018, -0.022] + ], + "o": [ + [-9.249, -12.055], + [12.73, -9.768], + [0.018, 0.023], + [0, 0] + ], + "v": [ + [-18.607, 24.774], + [-12.262, -15.006], + [27.805, -10.838], + [27.857, -10.77] + ], + "c": false + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [0.972549019608, 0.149019607843, 0.505882352941, 1], + "ix": 3 + }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 20, "ix": 5 }, + "lc": 2, + "lj": 2, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [77.856, 74.774], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 15, + "op": 1815, + "st": 15, + "bm": 0 + }, + { + "ddd": 0, + "ind": 11, + "ty": 4, + "nm": "Element 6", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 10.793, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 12.871, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.601] }, + "o": { "x": [0.72], "y": [0] }, + "t": 27.42, + "s": [100] + }, + { "t": 56, "s": [0] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.33, "y": 1 }, + "o": { "x": 0.189, "y": 0 }, + "t": 15.99, + "s": [959.693, 959.693, 0], + "to": [-138, 24.333, 0], + "ti": [110, -64.333, 0] + }, + { "t": 33.134765625, "s": [529.471, 1363.811, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [47.326, 47.325, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [-11.644, -3.948], + [0, 0], + [-3.913, 2.92], + [0, 0], + [0.157, -12.294], + [0, 0], + [-3.986, -2.819], + [0, 0], + [11.74, -3.65], + [0, 0], + [1.449, -4.662], + [0, 0], + [7.099, 10.038], + [0, 0], + [4.881, -0.062], + [0, 0], + [-7.353, 9.853], + [0, 0], + [1.568, 4.624], + [0, 0] + ], + "o": [ + [0, 0], + [4.623, 1.567], + [0, 0], + [9.853, -7.352], + [0, 0], + [-0.063, 4.882], + [0, 0], + [10.038, 7.1], + [0, 0], + [-4.662, 1.449], + [0, 0], + [-3.649, 11.741], + [0, 0], + [-2.819, -3.987], + [0, 0], + [-12.293, 0.157], + [0, 0], + [2.92, -3.913], + [0, 0], + [-3.948, -11.644] + ], + "v": [ + [-17.558, -36.37], + [-13.481, -34.987], + [0.154, -37.147], + [3.605, -39.723], + [27.31, -27.644], + [27.255, -23.339], + [33.521, -11.038], + [37.037, -8.553], + [32.875, 17.724], + [28.763, 19.002], + [19.003, 28.764], + [17.724, 32.875], + [-8.552, 37.037], + [-11.039, 33.522], + [-23.339, 27.254], + [-27.645, 27.31], + [-39.722, 3.606], + [-37.146, 0.154], + [-34.987, -13.481], + [-36.37, -17.558] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [1, 0.737254901961, 0.196078446332, 1], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [47.325, 47.325], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 15, + "op": 1815, + "st": 15, + "bm": 0 + }, + { + "ddd": 0, + "ind": 12, + "ty": 4, + "nm": "Element 5", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 10.793, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 12.871, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.601] }, + "o": { "x": [0.72], "y": [0] }, + "t": 27.42, + "s": [100] + }, + { "t": 56, "s": [0] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.33, "y": 1 }, + "o": { "x": 0.283, "y": 0 }, + "t": 15.99, + "s": [960, 960, 0], + "to": [-178.333, 3, 0], + "ti": [124.333, -150, 0] + }, + { "t": 47.166015625, "s": [517.297, 1177.159, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [30.771, 30.771, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, -16.856], + [16.856, 0], + [0, 16.856], + [-16.857, 0] + ], + "o": [ + [0, 16.856], + [-16.857, 0], + [0, -16.856], + [16.856, 0] + ], + "v": [ + [30.521, 0], + [0, 30.521], + [-30.521, 0], + [0, -30.521] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [0.972549019608, 0.149019607843, 0.505882352941, 1], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [30.771, 30.771], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 15, + "op": 1815, + "st": 15, + "bm": 0 + }, + { + "ddd": 0, + "ind": 13, + "ty": 4, + "nm": "Element 4", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 10.793, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 12.871, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.601] }, + "o": { "x": [0.72], "y": [0] }, + "t": 27.42, + "s": [100] + }, + { "t": 56, "s": [0] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.33, "y": 1 }, + "o": { "x": 0.273, "y": 0 }, + "t": 15.99, + "s": [960, 960, 0], + "to": [-94.667, -86.667, 0], + "ti": [140.667, 20.667, 0] + }, + { "t": 46.64453125, "s": [446.624, 934.727, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [42, 25.144, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [-0.829, -3.697], + [0, 0], + [3.698, -0.828], + [0, 0], + [0.83, 3.697], + [0, 0], + [-3.697, 0.828], + [0, 0] + ], + "o": [ + [0, 0], + [0.829, 3.697], + [0, 0], + [-3.697, 0.828], + [0, 0], + [-0.828, -3.697], + [0, 0], + [3.697, -0.828] + ], + "v": [ + [36.343, -18.872], + [40.921, 1.552], + [35.727, 9.747], + [-28.148, 24.066], + [-36.344, 18.872], + [-40.922, -1.553], + [-35.728, -9.747], + [28.148, -24.066] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [0.313725490196, 0.81568627451, 0.360784313725, 1], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [42, 25.144], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 15, + "op": 1815, + "st": 15, + "bm": 0 + }, + { + "ddd": 0, + "ind": 14, + "ty": 4, + "nm": "Element 3", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 10.793, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 12.871, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.601] }, + "o": { "x": [0.72], "y": [0] }, + "t": 27.42, + "s": [100] + }, + { "t": 56, "s": [0] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.33, "y": 1 }, + "o": { "x": 0.174, "y": 0 }, + "t": 15.99, + "s": [959.693, 959.692, 0], + "to": [-113.667, -146, 0], + "ti": [119.667, 22.5, 0] + }, + { "t": 42.48828125, "s": [529.471, 736.071, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [47.326, 47.325, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [-11.644, -3.948], + [0, 0], + [-3.913, 2.92], + [0, 0], + [0.157, -12.294], + [0, 0], + [-3.986, -2.819], + [0, 0], + [11.74, -3.65], + [0, 0], + [1.449, -4.662], + [0, 0], + [7.099, 10.038], + [0, 0], + [4.881, -0.063], + [0, 0], + [-7.353, 9.854], + [0, 0], + [1.568, 4.624], + [0, 0] + ], + "o": [ + [0, 0], + [4.623, 1.568], + [0, 0], + [9.853, -7.353], + [0, 0], + [-0.063, 4.882], + [0, 0], + [10.038, 7.099], + [0, 0], + [-4.662, 1.449], + [0, 0], + [-3.649, 11.74], + [0, 0], + [-2.819, -3.986], + [0, 0], + [-12.293, 0.157], + [0, 0], + [2.92, -3.912], + [0, 0], + [-3.948, -11.644] + ], + "v": [ + [-17.558, -36.37], + [-13.481, -34.987], + [0.154, -37.147], + [3.605, -39.722], + [27.31, -27.644], + [27.255, -23.339], + [33.521, -11.038], + [37.037, -8.552], + [32.875, 17.724], + [28.763, 19.002], + [19.003, 28.764], + [17.724, 32.876], + [-8.552, 37.037], + [-11.039, 33.522], + [-23.339, 27.255], + [-27.645, 27.309], + [-39.722, 3.605], + [-37.146, 0.154], + [-34.987, -13.481], + [-36.37, -17.558] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [0.274509803922, 0.513725490196, 0.960784313725, 1], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [47.325, 47.325], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 15, + "op": 1815, + "st": 15, + "bm": 0 + }, + { + "ddd": 0, + "ind": 15, + "ty": 4, + "nm": "Element 2", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 10.793, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [1] }, + "o": { "x": [0.167], "y": [0] }, + "t": 12.871, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.601] }, + "o": { "x": [0.72], "y": [0] }, + "t": 27.42, + "s": [100] + }, + { "t": 56, "s": [0] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.33, "y": 1 }, + "o": { "x": 0.292, "y": 0 }, + "t": 15.99, + "s": [960, 960, 0], + "to": [-95.667, -127, 0], + "ti": [3.667, 95, 0] + }, + { "t": 47.6875, "s": [788.638, 547.457, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [33.515, 41.664, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [3.281, -1.895], + [0, 0], + [1.895, 3.281], + [0, 0], + [-3.281, 1.894], + [0, 0], + [-1.895, -3.281], + [0, 0] + ], + "o": [ + [0, 0], + [-3.282, 1.895], + [0, 0], + [-1.895, -3.281], + [0, 0], + [3.281, -1.894], + [0, 0], + [1.895, 3.282] + ], + "v": [ + [28.859, 29.054], + [10.733, 39.519], + [1.36, 37.008], + [-31.37, -19.683], + [-28.859, -29.054], + [-10.732, -39.52], + [-1.36, -37.009], + [31.37, 19.682] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [0.274509803922, 0.513725490196, 0.960784313725, 1], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [33.515, 41.664], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 15, + "op": 1815, + "st": 15, + "bm": 0 + }, + { + "ddd": 0, + "ind": 16, + "ty": 4, + "nm": "Element 1", + "sr": 1, + "ks": { + "o": { + "a": 1, + "k": [ + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 10.793, + "s": [0] + }, + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 12.871, + "s": [100] + }, + { + "i": { "x": [0.833], "y": [0.833] }, + "o": { "x": [0.167], "y": [0.167] }, + "t": 27.42, + "s": [100] + }, + { "t": 56, "s": [0] } + ], + "ix": 11 + }, + "r": { "a": 0, "k": 0, "ix": 10 }, + "p": { + "a": 1, + "k": [ + { + "i": { "x": 0.33, "y": 1 }, + "o": { "x": 0.252, "y": 0 }, + "t": 15.99, + "s": [960, 960, 0], + "to": [22, -151.667, 0], + "ti": [40, 75.667, 0] + }, + { "t": 45.607421875, "s": [1027.199, 504.507, 0] } + ], + "ix": 2 + }, + "a": { "a": 0, "k": [30.771, 30.771, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100, 100], "ix": 6 } + }, + "ao": 0, + "shapes": [ + { + "ty": "gr", + "it": [ + { + "ind": 0, + "ty": "sh", + "ix": 1, + "ks": { + "a": 0, + "k": { + "i": [ + [0, -16.856], + [16.856, 0], + [0, 16.857], + [-16.857, 0] + ], + "o": [ + [0, 16.857], + [-16.857, 0], + [0, -16.856], + [16.856, 0] + ], + "v": [ + [30.522, -0.001], + [0, 30.522], + [-30.522, -0.001], + [0, -30.522] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "fl", + "c": { + "a": 0, + "k": [0.255000005984, 0.685999971278, 0.501999978458, 1], + "ix": 4 + }, + "o": { "a": 0, "k": 100, "ix": 5 }, + "r": 1, + "bm": 0, + "nm": "Fill 1", + "mn": "ADBE Vector Graphic - Fill", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [30.771, 30.772], "ix": 2 }, + "a": { "a": 0, "k": [0, 0], "ix": 1 }, + "s": { "a": 0, "k": [100, 100], "ix": 3 }, + "r": { "a": 0, "k": 0, "ix": 6 }, + "o": { "a": 0, "k": 100, "ix": 7 }, + "sk": { "a": 0, "k": 0, "ix": 4 }, + "sa": { "a": 0, "k": 0, "ix": 5 }, + "nm": "Transform" + } + ], + "nm": "Group 1", + "np": 2, + "cix": 2, + "bm": 0, + "ix": 1, + "mn": "ADBE Vector Group", + "hd": false + } + ], + "ip": 15, + "op": 1815, + "st": 15, + "bm": 0 + } + ], + "markers": [] +} diff --git a/src/components/ui/alert-dialog.tsx b/src/components/ui/alert-dialog.tsx new file mode 100644 index 0000000..25e7b47 --- /dev/null +++ b/src/components/ui/alert-dialog.tsx @@ -0,0 +1,141 @@ +"use client" + +import * as React from "react" +import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" + +import { cn } from "@/lib/utils" +import { buttonVariants } from "@/components/ui/button" + +const AlertDialog = AlertDialogPrimitive.Root + +const AlertDialogTrigger = AlertDialogPrimitive.Trigger + +const AlertDialogPortal = AlertDialogPrimitive.Portal + +const AlertDialogOverlay = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName + +const AlertDialogContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + + + + +)) +AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName + +const AlertDialogHeader = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +AlertDialogHeader.displayName = "AlertDialogHeader" + +const AlertDialogFooter = ({ + className, + ...props +}: React.HTMLAttributes) => ( +
+) +AlertDialogFooter.displayName = "AlertDialogFooter" + +const AlertDialogTitle = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName + +const AlertDialogDescription = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogDescription.displayName = + AlertDialogPrimitive.Description.displayName + +const AlertDialogAction = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName + +const AlertDialogCancel = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) +AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName + +export { + AlertDialog, + AlertDialogPortal, + AlertDialogOverlay, + AlertDialogTrigger, + AlertDialogContent, + AlertDialogHeader, + AlertDialogFooter, + AlertDialogTitle, + AlertDialogDescription, + AlertDialogAction, + AlertDialogCancel, +} diff --git a/src/components/ui/button.tsx b/src/components/ui/button.tsx index 0ba4277..36496a2 100644 --- a/src/components/ui/button.tsx +++ b/src/components/ui/button.tsx @@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority" import { cn } from "@/lib/utils" const buttonVariants = cva( - "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", { variants: { variant: { From 94368983d62a9d63ec60349d50ee8c24b0fd9bac Mon Sep 17 00:00:00 2001 From: Pattadon Date: Tue, 22 Oct 2024 13:00:57 +0700 Subject: [PATCH 16/27] Refactor ApplyBusiness component to set success state and update loader component --- src/app/business/apply/page.tsx | 3 +++ src/components/loading/loader.tsx | 24 +++++++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index 4959a42..8d4c17d 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -24,6 +24,7 @@ export default function ApplyBusiness() { await sendApplication(transformedData); }; const sendApplication = async (recvData: any) => { + setSucess(false); const { data: { user }, } = await supabase.auth.getUser(); @@ -66,6 +67,7 @@ export default function ApplyBusiness() { }, ]) .select(); + setSucess(true); // console.table(data); Swal.fire({ icon: error == null ? "success" : "error", @@ -141,6 +143,7 @@ export default function ApplyBusiness() { } }); } + setSucess(false); } else { console.error("User ID is undefined."); } diff --git a/src/components/loading/loader.tsx b/src/components/loading/loader.tsx index 4098107..565cc61 100644 --- a/src/components/loading/loader.tsx +++ b/src/components/loading/loader.tsx @@ -10,14 +10,14 @@ const loadingOption = { preserveAspectRatio: "xMidYMid slice", }, }; -const successOption = { - loop: false, - autoplay: true, - animationData: successData, - rendererSettings: { - preserveAspectRatio: "xMidYMid slice", - }, -}; +// const successOption = { +// loop: false, +// autoplay: true, +// animationData: successData, +// rendererSettings: { +// preserveAspectRatio: "xMidYMid slice", +// }, +// }; interface LoaderProps { isSuccess: boolean; @@ -25,15 +25,17 @@ interface LoaderProps { export function Loader(props: LoaderProps) { return ( -
+ <> {!props.isSuccess && ( - +
+ +
)} {/* {!props.isSuccess ? ( ) : ( )} */} -
+ ); } From 6da89cc38bac8fc7b54f0ba8065799d64dc96b5d Mon Sep 17 00:00:00 2001 From: Pattadon Date: Tue, 22 Oct 2024 13:02:12 +0700 Subject: [PATCH 17/27] Refactor AlertDialog component to remove unused code and optimize imports --- src/components/ui/alert-dialog.tsx | 141 ----------------------------- 1 file changed, 141 deletions(-) delete mode 100644 src/components/ui/alert-dialog.tsx diff --git a/src/components/ui/alert-dialog.tsx b/src/components/ui/alert-dialog.tsx deleted file mode 100644 index 25e7b47..0000000 --- a/src/components/ui/alert-dialog.tsx +++ /dev/null @@ -1,141 +0,0 @@ -"use client" - -import * as React from "react" -import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog" - -import { cn } from "@/lib/utils" -import { buttonVariants } from "@/components/ui/button" - -const AlertDialog = AlertDialogPrimitive.Root - -const AlertDialogTrigger = AlertDialogPrimitive.Trigger - -const AlertDialogPortal = AlertDialogPrimitive.Portal - -const AlertDialogOverlay = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName - -const AlertDialogContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - - - - -)) -AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName - -const AlertDialogHeader = ({ - className, - ...props -}: React.HTMLAttributes) => ( -
-) -AlertDialogHeader.displayName = "AlertDialogHeader" - -const AlertDialogFooter = ({ - className, - ...props -}: React.HTMLAttributes) => ( -
-) -AlertDialogFooter.displayName = "AlertDialogFooter" - -const AlertDialogTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName - -const AlertDialogDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -AlertDialogDescription.displayName = - AlertDialogPrimitive.Description.displayName - -const AlertDialogAction = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName - -const AlertDialogCancel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef ->(({ className, ...props }, ref) => ( - -)) -AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName - -export { - AlertDialog, - AlertDialogPortal, - AlertDialogOverlay, - AlertDialogTrigger, - AlertDialogContent, - AlertDialogHeader, - AlertDialogFooter, - AlertDialogTitle, - AlertDialogDescription, - AlertDialogAction, - AlertDialogCancel, -} From 29be79f6e88a7720d1a9479fde667afa475072ae Mon Sep 17 00:00:00 2001 From: Pattadon Date: Tue, 22 Oct 2024 14:47:46 +0700 Subject: [PATCH 18/27] Refactor ApplyBusiness component to update file upload path --- src/app/business/apply/page.tsx | 1 + src/app/project/apply/page.tsx | 41 +++++++++++++++++---------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/src/app/business/apply/page.tsx b/src/app/business/apply/page.tsx index 8d4c17d..10969ec 100644 --- a/src/app/business/apply/page.tsx +++ b/src/app/business/apply/page.tsx @@ -35,6 +35,7 @@ export default function ApplyBusiness() { recvData["businessPitchDeck"], user.id, BUCKET_PITCH_NAME, + // file structure: userId/fileName `${user?.id}/${recvData["businessPitchDeck"].name}` ); diff --git a/src/app/project/apply/page.tsx b/src/app/project/apply/page.tsx index fa081a4..546c281 100644 --- a/src/app/project/apply/page.tsx +++ b/src/app/project/apply/page.tsx @@ -17,37 +17,20 @@ export default function ApplyProject() { const onSubmit: SubmitHandler = async (data) => { alert("มาแน้ววว"); console.table(data); + console.log(typeof data["projectPhotos"], data["projectPhotos"]); }; const sendApplication = async (recvData: any) => { const { data: { user }, } = await supabase.auth.getUser(); - const pitchType = typeof recvData["businessPitchDeck"]; - if (pitchType === "object") { - if (user?.id) { - // const uploadSuccess = await uploadFile( - // recvData["businessPitchDeck"], - // user.id, - // BUCKET_PITCH_NAME - // ); - - // if (!uploadSuccess) { - // return; - // } - - console.log("file upload successful"); - } else { - console.error("user ID is undefined."); - return; - } - } + const pitchType = typeof recvData["projectPitchDeck"]; const { data, error } = await supabase .from("business_application") .insert([ { user_id: user?.id, - business_name: recvData["companyName"], + business_name: recvData["projectName"], business_type_id: recvData["industry"], location: recvData["country"], is_for_sale: recvData["isForSale"], @@ -60,6 +43,24 @@ export default function ApplyProject() { }, ]) .select(); + if (pitchType === "object") { + if (user?.id) { + // const uploadSuccess = await uploadFile( + // recvData["businessPitchDeck"], + // user.id, + // BUCKET_PITCH_NAME + // ); + + // if (!uploadSuccess) { + // return; + // } + + console.log("file upload successful"); + } else { + console.error("user ID is undefined."); + return; + } + } // console.table(data); Swal.fire({ icon: error == null ? "success" : "error", From 4b5be4987464129a34131736d0105c67bcd96c6a Mon Sep 17 00:00:00 2001 From: Pattadon Date: Thu, 24 Oct 2024 15:14:09 +0700 Subject: [PATCH 19/27] Refactor package dependencies and update ApplyProject component --- package-lock.json | 28 +++++++++++++++ src/app/project/apply/page.tsx | 15 ++++---- src/components/ProjectForm.tsx | 48 ++++++++++++------------- src/components/projectCard.tsx | 6 ++-- src/types/schemas/application.schema.ts | 4 +-- 5 files changed, 63 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index 24952b6..0bc78fd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.0", "dependencies": { "@hookform/resolvers": "^3.9.0", + "@radix-ui/react-alert-dialog": "^1.1.2", "@radix-ui/react-avatar": "^1.1.0", "@radix-ui/react-dialog": "^1.1.2", "@radix-ui/react-dropdown-menu": "^2.1.1", @@ -940,6 +941,33 @@ "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.0.tgz", "integrity": "sha512-4Z8dn6Upk0qk4P74xBhZ6Hd/w0mPEzOOLxy4xiPXOXqjF7jZS0VAKk7/x/H6FyY2zCkYJqePf1G5KmkmNJ4RBA==" }, + "node_modules/@radix-ui/react-alert-dialog": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@radix-ui/react-alert-dialog/-/react-alert-dialog-1.1.2.tgz", + "integrity": "sha512-eGSlLzPhKO+TErxkiGcCZGuvbVMnLA1MTnyBksGOeGRGkxHiiJUujsjmNTdWTm4iHVSRaUao9/4Ur671auMghQ==", + "dependencies": { + "@radix-ui/primitive": "1.1.0", + "@radix-ui/react-compose-refs": "1.1.0", + "@radix-ui/react-context": "1.1.1", + "@radix-ui/react-dialog": "1.1.2", + "@radix-ui/react-primitive": "2.0.0", + "@radix-ui/react-slot": "1.1.0" + }, + "peerDependencies": { + "@types/react": "*", + "@types/react-dom": "*", + "react": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc", + "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/@radix-ui/react-arrow": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-arrow/-/react-arrow-1.1.0.tgz", diff --git a/src/app/project/apply/page.tsx b/src/app/project/apply/page.tsx index 546c281..c3b9518 100644 --- a/src/app/project/apply/page.tsx +++ b/src/app/project/apply/page.tsx @@ -16,6 +16,7 @@ const BUCKET_PHOTOS_NAME = "project-additional-photos"; export default function ApplyProject() { const onSubmit: SubmitHandler = async (data) => { alert("มาแน้ววว"); + console.table(data); console.log(typeof data["projectPhotos"], data["projectPhotos"]); }; @@ -26,20 +27,16 @@ export default function ApplyProject() { const pitchType = typeof recvData["projectPitchDeck"]; const { data, error } = await supabase - .from("business_application") + .from("project_application") .insert([ { user_id: user?.id, - business_name: recvData["projectName"], - business_type_id: recvData["industry"], - location: recvData["country"], - is_for_sale: recvData["isForSale"], - is_generating_revenue: recvData["isGenerating"], - is_in_us: recvData["isInUS"], pitch_deck_url: pitchType === "string" ? recvData["businessPitchDeck"] : "", - money_raised_to_date: recvData["totalRaised"], - community_size: recvData["communitySize"], + target_investment: recvData["targetInvest"], + deadline: recvData["deadline"], + project_name: recvData["projectName"], + }, ]) .select(); diff --git a/src/components/ProjectForm.tsx b/src/components/ProjectForm.tsx index f9699e8..9a0a81b 100644 --- a/src/components/ProjectForm.tsx +++ b/src/components/ProjectForm.tsx @@ -55,7 +55,9 @@ const ProjectForm = ({ const [projectPitchFile, setProjectPitchFile] = useState(""); const [tag, setTag] = useState<{ id: number; value: string }[]>([]); const [open, setOpen] = useState(false); - const [selectedTag, setSelectedTag] = useState([]); + const [selectedTag, setSelectedTag] = useState< + { id: number; value: string }[] + >([]); const handleFileChange = ( event: React.ChangeEvent, @@ -165,7 +167,7 @@ const ProjectForm = ({ fieldName="projectType" choices={projectType} handleFunction={(selectedValues: any) => { - field.onChange(selectedValues.name); + field.onChange(selectedValues.id); }} description={ <>Please specify the primary purpose of the funds @@ -492,7 +494,7 @@ const ProjectForm = ({ className="w-96 justify-between overflow-hidden text-ellipsis whitespace-nowrap" > {selectedTag.length > 0 - ? selectedTag.join(", ") + ? selectedTag.map((t) => t.value).join(", ") : "Select tags..."} @@ -505,19 +507,19 @@ const ProjectForm = ({ {tag.map((tag) => ( { + onSelect={() => { setSelectedTag((prev) => { - const updatedTags = prev.includes( - currentValue - ) - ? prev.filter( - (item) => item !== currentValue - ) - : [...prev, currentValue]; - field.onChange(updatedTags); - + const exists = prev.find( + (t) => t.id === tag.id + ); + const updatedTags = exists + ? prev.filter((t) => t.id !== tag.id) + : [...prev, tag]; + field.onChange( + updatedTags.map((t) => t.id) + ); return updatedTags; }); setOpen(false); @@ -526,7 +528,7 @@ const ProjectForm = ({ t.id === tag.id) ? "opacity-100" : "opacity-0" )} @@ -552,23 +554,21 @@ const ProjectForm = ({
{selectedTag.map((tag) => (
- {tag} + {tag.value}
diff --git a/src/components/projectCard.tsx b/src/components/projectCard.tsx index 5734f04..b29d726 100644 --- a/src/components/projectCard.tsx +++ b/src/components/projectCard.tsx @@ -25,7 +25,7 @@ export function ProjectCard(props: ProjectCardProps) { return (
@@ -58,7 +58,7 @@ export function ProjectCard(props: ProjectCardProps) { {/* Info 1 */}
-
+
@@ -79,7 +79,7 @@ export function ProjectCard(props: ProjectCardProps) {
{/* Info 2 */} -
+
{/* Info 2 (Visible on hover) */}

diff --git a/src/types/schemas/application.schema.ts b/src/types/schemas/application.schema.ts index 6e0c32b..f4472e4 100644 --- a/src/types/schemas/application.schema.ts +++ b/src/types/schemas/application.schema.ts @@ -21,7 +21,7 @@ const projectFormSchema = z.object({ projectName: z.string().min(5, { message: "Project name must be at least 5 characters.", }), - projectType: z.string({ + projectType: z.number({ required_error: "Please select one of the option", }), shortDescription: z @@ -91,7 +91,7 @@ const projectFormSchema = z.object({ message: "Deadline must be in the future.", }), tag: z - .array(z.string()) + .array(z.number()) .min(1, "Please provide at least one tag.") .max(5, "You can provide up to 5 tags."), }); From f9aa1c586f9509e7760768eb68ed62e3a8321b76 Mon Sep 17 00:00:00 2001 From: Pattadon Date: Thu, 24 Oct 2024 15:50:40 +0700 Subject: [PATCH 20/27] Refactor ApplyProject component to update file upload path and add Lottie animation for loading --- src/app/project/apply/page.tsx | 61 +++++++++++++++++++--------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/src/app/project/apply/page.tsx b/src/app/project/apply/page.tsx index c3b9518..f73c193 100644 --- a/src/app/project/apply/page.tsx +++ b/src/app/project/apply/page.tsx @@ -6,58 +6,65 @@ import { projectFormSchema } from "@/types/schemas/application.schema"; import { z } from "zod"; import { SubmitHandler } from "react-hook-form"; import Swal from "sweetalert2"; +import { uploadFile } from "@/app/api/generalApi"; type projectSchema = z.infer; let supabase = createSupabaseClient(); -const BUCKET_PITCH_NAME = "project-pitches"; -const BUCKET_LOGO_NAME = "project-logo"; -const BUCKET_PHOTOS_NAME = "project-additional-photos"; +const BUCKET_PITCH_APPLICATION_NAME = "project-pitches"; export default function ApplyProject() { const onSubmit: SubmitHandler = async (data) => { alert("มาแน้ววว"); - - console.table(data); - console.log(typeof data["projectPhotos"], data["projectPhotos"]); + await sendApplication(data); + // console.table(data); + // console.log(typeof data["projectPhotos"], data["projectPhotos"]); }; const sendApplication = async (recvData: any) => { const { data: { user }, } = await supabase.auth.getUser(); + let projectId = null; const pitchType = typeof recvData["projectPitchDeck"]; - - const { data, error } = await supabase + // save the general application data to project_application table + const { data: project_application, error } = await supabase .from("project_application") .insert([ { user_id: user?.id, pitch_deck_url: - pitchType === "string" ? recvData["businessPitchDeck"] : "", + pitchType === "string" ? recvData["projectPitchDeck"] : "", target_investment: recvData["targetInvest"], deadline: recvData["deadline"], project_name: recvData["projectName"], - + project_type_id: recvData["projectType"], + short_description: recvData["shortDescription"], + min_investment: recvData["minInvest"], }, ]) .select(); - if (pitchType === "object") { - if (user?.id) { - // const uploadSuccess = await uploadFile( - // recvData["businessPitchDeck"], - // user.id, - // BUCKET_PITCH_NAME - // ); + if (project_application) { + projectId = project_application[0].id; + } + // upload pitch file + if (pitchType === "object") { + if (user?.id) { + const uploadSuccess = await uploadFile( + recvData["businessPitchDeck"], + user.id, + BUCKET_PITCH_APPLICATION_NAME, + `${user?.id}/${projectId}/pitches/${recvData["projectPitchDeck"].name}` + ); - // if (!uploadSuccess) { - // return; - // } + if (!uploadSuccess) { + return; + } - console.log("file upload successful"); - } else { - console.error("user ID is undefined."); - return; - } - } + console.log("file upload successful"); + } else { + console.error("user ID is undefined."); + return; + } + } // console.table(data); Swal.fire({ icon: error == null ? "success" : "error", @@ -67,7 +74,7 @@ export default function ApplyProject() { confirmButtonColor: error == null ? "green" : "red", }).then((result) => { if (result.isConfirmed) { - window.location.href = "/"; + // window.location.href = "/"; } }); }; From 0cfb93efac6853821240d18d1c5d3aee6be52f9d Mon Sep 17 00:00:00 2001 From: THIS ONE IS A LITTLE BIT TRICKY KRUB Date: Sat, 26 Oct 2024 20:47:40 +0700 Subject: [PATCH 21/27] Refactor ApplyProject component to update file upload path and add Lottie animation for loading --- src/app/page.tsx | 93 +++++++++++++++++++++++++++--------- src/lib/data/projectQuery.ts | 44 ++++++++++------- 2 files changed, 99 insertions(+), 38 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 4e03c19..78f00bf 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,39 +1,63 @@ import Image from "next/image"; import { Button } from "@/components/ui/button"; import Link from "next/link"; -import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; +import { + Card, + CardContent, + CardDescription, + CardHeader, + CardTitle, +} from "@/components/ui/card"; import { Separator } from "@/components/ui/separator"; import { ProjectCard } from "@/components/projectCard"; import { getTopProjects } from "@/lib/data/projectQuery"; import { createSupabaseClient } from "@/lib/supabase/serverComponentClient"; import { Suspense } from "react"; +import { FC } from "react"; -const TopProjects = async () => { - const supabase = createSupabaseClient(); - const { data: topProjectsData, error: topProjectsError } = await getTopProjects(supabase); +interface Project { + id: number; + project_name: string; + project_short_description: string; + card_image_url: string; + published_time: string; + business: { location: string }[]; + project_tag: { tag: { id: number; value: string }[] }[]; + project_investment_detail: { + min_investment: number; + total_investment: number; + }[]; +} - if (topProjectsError) { - return
Error loading top projects: {topProjectsError}
; - } +interface TopProjectsProps { + projects: Project[]; +} - if (!topProjectsData || topProjectsData.length === 0) { +const TopProjects: FC = ({ projects }) => { + if (!projects || projects.length === 0) { return
No top projects available.
; } - return (
- {topProjectsData.map((project) => ( + {projects.map((project) => ( item.tag.value)} - minInvestment={project.project_investment_detail[0]?.min_investment || 0} + location={project.business[0]?.location || ""} + tags={project.project_tag.flatMap( + (item: { tag: { id: number; value: string }[] }) => + Array.isArray(item.tag) ? item.tag.map((tag) => tag.value) : [] + )} + minInvestment={ + project.project_investment_detail[0]?.min_investment || 0 + } totalInvestor={0} - totalRaised={project.project_investment_detail[0]?.total_investment || 0} + totalRaised={ + project.project_investment_detail[0]?.total_investment || 0 + } /> ))} @@ -44,12 +68,18 @@ const TopProjects = async () => { const ProjectsLoader = () => (
{[...Array(4)].map((_, index) => ( -
+
))}
); - export default async function Home() { + const supabase = createSupabaseClient(); + const { data: topProjectsData, error: topProjectsError } = + await getTopProjects(supabase); + return (
@@ -57,9 +87,14 @@ export default async function Home() {
-

Explore the world of ventures

+

+ Explore the world of ventures +

-

Unlock opportunities and connect with a community of passionate

+

+ Unlock opportunities and connect with a community of + passionate +

investors and innovators.

Together, we turn ideas into impact.

@@ -107,11 +142,23 @@ export default async function Home() { @@ -123,10 +170,12 @@ export default async function Home() {

Hottest Deals

-

The deals attracting the most interest right now

+

+ The deals attracting the most interest right now +

}> - +