diff --git a/.env b/.env index d466608671..14a18012aa 100644 --- a/.env +++ b/.env @@ -1,15 +1,15 @@ -NEXT_PUBLIC_API=https://api.guild.xyz/v1 -NEXT_PUBLIC_DISCORD_CLIENT_ID=868172385000509460 +NEXT_PUBLIC_API=https://api.dev.guild-api.xyz/v1 +NEXT_PUBLIC_DISCORD_CLIENT_ID=1118173473676722258 NEXT_PUBLIC_IPFS_GATEWAY=https://guild-xyz.mypinata.cloud/ipfs/ NEXT_PUBLIC_PINATA_API=https://api.pinata.cloud NEXT_PUBLIC_BALANCY_API=https://balancy.guild.xyz/api -NEXT_PUBLIC_TG_BOT_USERNAME=guildxyz_bot -NEXT_PUBLIC_GOOGLE_CLIENT_ID=639132320574-9v9b8d9mq7rjctmjmolsjeklkl2rlcsh.apps.googleusercontent.com -NEXT_PUBLIC_GOOGLE_SERVICE_ACCOUNT_EMAIL=guild-xyz@guildxyz.iam.gserviceaccount.com +NEXT_PUBLIC_TG_BOT_USERNAME=Guildxyz_dev_gcp_bot +NEXT_PUBLIC_GOOGLE_CLIENT_ID=829004986756-f5b265m0hscpaa0ah9cgqht02o8qea15.apps.googleusercontent.com +NEXT_PUBLIC_GOOGLE_SERVICE_ACCOUNT_EMAIL=bvz-test-service-account@bvz-test-project.iam.gserviceaccount.com NEXT_PUBLIC_POSTHOG_KEY=phc_Pu6Xv72B95fHVTAKT5Xs2FPgNxrsNP4LecBqPiVAAxi NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID=d851f25304d67fc8e2dd3b354223e4fa NEXT_PUBLIC_EDGE_CONFIG_ID=ecfg_buc5l6124c4koymyvseasbd1k3hs NEXT_PUBLIC_EDGE_CONFIG_READ_ACCESS_TOKEN=8b337e65-3aa6-4949-97b8-c7eab7151128 -NEXT_PUBLIC_RECAPTCHA_SITE_KEY=6LcQm4onAAAAAOcoqkw9A5txg5SbuddONchMZKrF +NEXT_PUBLIC_RECAPTCHA_SITE_KEY=6LcMe3knAAAAAJjUyeMh1LbUcrh5k0aG0fJIZaJR NEXT_PUBLIC_POLYGONID_API=https://guild-privacy.s.guild.xyz -NEXT_PUBLIC_BUGSNAG_KEY=4bd5799ac2cb4a34887513b80b845554 \ No newline at end of file +NEXT_PUBLIC_BUGSNAG_KEY=4bd5799ac2cb4a34887513b80b845554 diff --git a/next.config.js b/next.config.js index 6c4d6263f9..2c81b7ba80 100644 --- a/next.config.js +++ b/next.config.js @@ -88,6 +88,9 @@ const nextConfig = { { hostname: "og.link3.to", }, + { + hostname: "imagedelivery.net" + } ], contentSecurityPolicy: "default-src 'self'; script-src 'none'; sandbox;", }, diff --git a/package-lock.json b/package-lock.json index c595a4bb34..562a94fbe2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,7 +19,7 @@ "@emotion/styled": "^11.11.0", "@fuels/connectors": "^0.5.0", "@fuels/react": "^0.20.0", - "@guildxyz/types": "^1.9.38", + "@guildxyz/types": "^1.9.39", "@hcaptcha/react-hcaptcha": "^1.4.4", "@hookform/resolvers": "^3.3.4", "@lexical/code": "^0.12.0", @@ -41,6 +41,7 @@ "@radix-ui/react-focus-scope": "^1.1.0", "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-popover": "^1.1.1", + "@radix-ui/react-progress": "^1.1.0", "@radix-ui/react-select": "^2.1.1", "@radix-ui/react-separator": "^1.1.0", "@radix-ui/react-slot": "^1.1.0", @@ -48,11 +49,14 @@ "@radix-ui/react-toggle": "^1.1.0", "@radix-ui/react-toggle-group": "^1.1.0", "@radix-ui/react-tooltip": "^1.1.2", + "@react-three/drei": "^9.108.4", + "@react-three/fiber": "^8.16.8", "@snyk/protect": "latest", "@t3-oss/env-nextjs": "^0.10.1", "@tanstack/react-query": "^5.26.3", "@tanstack/react-table": "^8.13.2", "@tanstack/react-virtual": "^3.5.0", + "@types/three": "^0.166.0", "@vercel/kv": "^1.0.1", "@visx/curve": "^3.3.0", "@visx/xychart": "^3.10.2", @@ -65,6 +69,8 @@ "clsx": "^2.1.1", "color": "^4.2.3", "colorthief": "^2.3.2", + "embla-carousel-autoplay": "^8.1.6", + "embla-carousel-react": "^8.1.6", "events": "^3.3.0", "framer-motion": "^7.10.3", "fuels": "^0.89.1", @@ -82,6 +88,7 @@ "qrcode.react": "^3.1.0", "randombytes": "^2.1.0", "react": "^18.2.0", + "react-canvas-confetti": "^2.0.7", "react-device-detect": "^2.2.2", "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", @@ -97,6 +104,7 @@ "swr": "^2.2.4", "tailwind-merge": "^2.3.0", "tailwindcss-animate": "^1.0.7", + "three": "^0.166.1", "usehooks-ts": "^3.1.0", "uuidv7": "^0.6.3", "viem": "^2.17.0", @@ -5467,10 +5475,9 @@ } }, "node_modules/@guildxyz/types": { - "version": "1.9.38", - "resolved": "https://registry.npmjs.org/@guildxyz/types/-/types-1.9.38.tgz", - "integrity": "sha512-cyGwit9QVnjoqQXf/XhiSOnevjDWnu4qeQQEVK319P1vvXxF/0zKDUBqYdgp62gkLG3wENDTKOaE5O4AB9dDMQ==", - "license": "ISC", + "version": "1.9.39", + "resolved": "https://registry.npmjs.org/@guildxyz/types/-/types-1.9.39.tgz", + "integrity": "sha512-7tKwioSR6cTEYBbkqS0Q6QFR+nlk5Y0yIweMnPu/lJM9B9DzUlTgnMzR/2AydYKHXxUXrWZT7sLipdIqnJPJcg==", "dependencies": { "zod": "^3.22.4" } @@ -6476,6 +6483,11 @@ "react": ">=16" } }, + "node_modules/@mediapipe/tasks-vision": { + "version": "0.10.8", + "resolved": "https://registry.npmjs.org/@mediapipe/tasks-vision/-/tasks-vision-0.10.8.tgz", + "integrity": "sha512-Rp7ll8BHrKB3wXaRFKhrltwZl1CiXGdibPxuWXvqGnKTnv8fqa/nvftYNuSbf+pbJWKYCXdBtYTITdAUTGGh0Q==" + }, "node_modules/@metamask/eth-json-rpc-provider": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@metamask/eth-json-rpc-provider/-/eth-json-rpc-provider-1.0.1.tgz", @@ -7059,6 +7071,17 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/@monogrid/gainmap-js": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/@monogrid/gainmap-js/-/gainmap-js-3.0.5.tgz", + "integrity": "sha512-53sCTG4FaJBaAq/tcufARtVYDMDGqyBT9i7F453pWGhZ5LqubDHDWtYoHo9VhQqMcHTEexdJqSsR58y+9HVmQA==", + "dependencies": { + "promise-worker-transferable": "^1.0.4" + }, + "peerDependencies": { + "three": ">= 0.159.0" + } + }, "node_modules/@motionone/animation": { "version": "10.18.0", "resolved": "https://registry.npmjs.org/@motionone/animation/-/animation-10.18.0.tgz", @@ -8398,6 +8421,29 @@ } } }, + "node_modules/@radix-ui/react-progress": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@radix-ui/react-progress/-/react-progress-1.1.0.tgz", + "integrity": "sha512-aSzvnYpP725CROcxAOEBVZZSIQVQdHgBr2QQFKySsaD14u8dNT0batuXI+AAGDdAHfXH8rbnHmjYFqVJ21KkRg==", + "dependencies": { + "@radix-ui/react-context": "1.1.0", + "@radix-ui/react-primitive": "2.0.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-roving-focus": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@radix-ui/react-roving-focus/-/react-roving-focus-1.1.0.tgz", @@ -10532,6 +10578,11 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/@react-spring/rafz": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@react-spring/rafz/-/rafz-9.6.1.tgz", + "integrity": "sha512-v6qbgNRpztJFFfSE3e2W1Uz+g8KnIBs6SmzCzcVVF61GdGfGOuBrbjIcp+nUz301awVmREKi4eMQb2Ab2gGgyQ==" + }, "node_modules/@react-spring/shared": { "version": "9.7.3", "resolved": "https://registry.npmjs.org/@react-spring/shared/-/shared-9.7.3.tgz", @@ -10544,6 +10595,69 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/@react-spring/three": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@react-spring/three/-/three-9.6.1.tgz", + "integrity": "sha512-Tyw2YhZPKJAX3t2FcqvpLRb71CyTe1GvT3V+i+xJzfALgpk10uPGdGaQQ5Xrzmok1340DAeg2pR/MCfaW7b8AA==", + "dependencies": { + "@react-spring/animated": "~9.6.1", + "@react-spring/core": "~9.6.1", + "@react-spring/shared": "~9.6.1", + "@react-spring/types": "~9.6.1" + }, + "peerDependencies": { + "@react-three/fiber": ">=6.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0", + "three": ">=0.126" + } + }, + "node_modules/@react-spring/three/node_modules/@react-spring/animated": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@react-spring/animated/-/animated-9.6.1.tgz", + "integrity": "sha512-ls/rJBrAqiAYozjLo5EPPLLOb1LM0lNVQcXODTC1SMtS6DbuBCPaKco5svFUQFMP2dso3O+qcC4k9FsKc0KxMQ==", + "dependencies": { + "@react-spring/shared": "~9.6.1", + "@react-spring/types": "~9.6.1" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@react-spring/three/node_modules/@react-spring/core": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@react-spring/core/-/core-9.6.1.tgz", + "integrity": "sha512-3HAAinAyCPessyQNNXe5W0OHzRfa8Yo5P748paPcmMowZ/4sMfaZ2ZB6e5x5khQI8NusOHj8nquoutd6FRY5WQ==", + "dependencies": { + "@react-spring/animated": "~9.6.1", + "@react-spring/rafz": "~9.6.1", + "@react-spring/shared": "~9.6.1", + "@react-spring/types": "~9.6.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/react-spring/donate" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@react-spring/three/node_modules/@react-spring/shared": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@react-spring/shared/-/shared-9.6.1.tgz", + "integrity": "sha512-PBFBXabxFEuF8enNLkVqMC9h5uLRBo6GQhRMQT/nRTnemVENimgRd+0ZT4yFnAQ0AxWNiJfX3qux+bW2LbG6Bw==", + "dependencies": { + "@react-spring/rafz": "~9.6.1", + "@react-spring/types": "~9.6.1" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0" + } + }, + "node_modules/@react-spring/three/node_modules/@react-spring/types": { + "version": "9.6.1", + "resolved": "https://registry.npmjs.org/@react-spring/types/-/types-9.6.1.tgz", + "integrity": "sha512-POu8Mk0hIU3lRXB3bGIGe4VHIwwDsQyoD1F394OK7STTiX9w4dG3cTLljjYswkQN+hDSHRrj4O36kuVa7KPU8Q==" + }, "node_modules/@react-spring/types": { "version": "9.7.3", "resolved": "https://registry.npmjs.org/@react-spring/types/-/types-9.7.3.tgz", @@ -10566,6 +10680,147 @@ "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0" } }, + "node_modules/@react-three/drei": { + "version": "9.109.1", + "resolved": "https://registry.npmjs.org/@react-three/drei/-/drei-9.109.1.tgz", + "integrity": "sha512-tkZW1lpkGW0jg4bb3yiaQgM9gkpf6b2osleQnQu55VC8UFDDMIX+fNB8TTQ9fqhA/lpQ7UszM7XSUGak1xYjvg==", + "dependencies": { + "@babel/runtime": "^7.11.2", + "@mediapipe/tasks-vision": "0.10.8", + "@monogrid/gainmap-js": "^3.0.5", + "@react-spring/three": "~9.6.1", + "@use-gesture/react": "^10.2.24", + "camera-controls": "^2.4.2", + "cross-env": "^7.0.3", + "detect-gpu": "^5.0.28", + "glsl-noise": "^0.0.0", + "hls.js": "1.3.5", + "maath": "^0.10.7", + "meshline": "^3.1.6", + "react-composer": "^5.0.3", + "stats-gl": "^2.0.0", + "stats.js": "^0.17.0", + "suspend-react": "^0.1.3", + "three-mesh-bvh": "^0.7.0", + "three-stdlib": "^2.29.9", + "troika-three-text": "^0.49.0", + "tunnel-rat": "^0.1.2", + "utility-types": "^3.10.0", + "uuid": "^9.0.1", + "zustand": "^3.7.1" + }, + "peerDependencies": { + "@react-three/fiber": ">=8.0", + "react": ">=18.0", + "react-dom": ">=18.0", + "three": ">=0.137" + }, + "peerDependenciesMeta": { + "react-dom": { + "optional": true + } + } + }, + "node_modules/@react-three/drei/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@react-three/drei/node_modules/zustand": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", + "integrity": "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==", + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, + "node_modules/@react-three/fiber": { + "version": "8.16.8", + "resolved": "https://registry.npmjs.org/@react-three/fiber/-/fiber-8.16.8.tgz", + "integrity": "sha512-Lc8fjATtvQEfSd8d5iKdbpHtRm/aPMeFj7jQvp6TNHfpo8IQTW3wwcE1ZMrGGoUH+w2mnyS+0MK1NLPLnuzGkQ==", + "dependencies": { + "@babel/runtime": "^7.17.8", + "@types/react-reconciler": "^0.26.7", + "@types/webxr": "*", + "base64-js": "^1.5.1", + "buffer": "^6.0.3", + "its-fine": "^1.0.6", + "react-reconciler": "^0.27.0", + "react-use-measure": "^2.1.1", + "scheduler": "^0.21.0", + "suspend-react": "^0.1.3", + "zustand": "^3.7.1" + }, + "peerDependencies": { + "expo": ">=43.0", + "expo-asset": ">=8.4", + "expo-file-system": ">=11.0", + "expo-gl": ">=11.0", + "react": ">=18.0", + "react-dom": ">=18.0", + "react-native": ">=0.64", + "three": ">=0.133" + }, + "peerDependenciesMeta": { + "expo": { + "optional": true + }, + "expo-asset": { + "optional": true + }, + "expo-file-system": { + "optional": true + }, + "expo-gl": { + "optional": true + }, + "react-dom": { + "optional": true + }, + "react-native": { + "optional": true + } + } + }, + "node_modules/@react-three/fiber/node_modules/scheduler": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.21.0.tgz", + "integrity": "sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ==", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, + "node_modules/@react-three/fiber/node_modules/zustand": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/zustand/-/zustand-3.7.2.tgz", + "integrity": "sha512-PIJDIZKtokhof+9+60cpockVOq05sJzHCriyvaLBmEJixseQ1a5Kdov6fWZfWOu5SK9c+FhH1jU0tntLxRJYMA==", + "engines": { + "node": ">=12.7.0" + }, + "peerDependencies": { + "react": ">=16.8" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + } + } + }, "node_modules/@rgba-image/common": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/@rgba-image/common/-/common-0.1.13.tgz", @@ -12496,6 +12751,11 @@ "node": ">=10.13.0" } }, + "node_modules/@tweenjs/tween.js": { + "version": "23.1.2", + "resolved": "https://registry.npmjs.org/@tweenjs/tween.js/-/tween.js-23.1.2.tgz", + "integrity": "sha512-kMCNaZCJugWI86xiEHaY338CU5JpD0B97p1j1IKNn/Zto8PgACjQx0UxbHjmOcLl/dDOBnItwD07KmCs75pxtQ==" + }, "node_modules/@types/aria-query": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", @@ -12561,6 +12821,11 @@ "@types/node": "*" } }, + "node_modules/@types/canvas-confetti": { + "version": "1.6.4", + "resolved": "https://registry.npmjs.org/@types/canvas-confetti/-/canvas-confetti-1.6.4.tgz", + "integrity": "sha512-fNyZ/Fdw/Y92X0vv7B+BD6ysHL4xVU5dJcgzgxLdGbn8O3PezZNIJpml44lKM0nsGur+o/6+NZbZeNTt00U1uA==" + }, "node_modules/@types/color": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/@types/color/-/color-3.0.6.tgz", @@ -12694,6 +12959,11 @@ "resolved": "https://registry.npmjs.org/@types/dom-screen-wake-lock/-/dom-screen-wake-lock-1.0.3.tgz", "integrity": "sha512-3Iten7X3Zgwvk6kh6/NRdwN7WbZ760YgFCsF5AxDifltUQzW1RaW+WRmcVtgwFzLjaNu64H+0MPJ13yRa8g3Dw==" }, + "node_modules/@types/draco3d": { + "version": "1.4.10", + "resolved": "https://registry.npmjs.org/@types/draco3d/-/draco3d-1.4.10.tgz", + "integrity": "sha512-AX22jp8Y7wwaBgAixaSvkoG4M/+PlAcm3Qs4OW8yT9DM4xUpWKeFhLueTAyZF39pviAdcDdeJoACapiAceqNcw==" + }, "node_modules/@types/emscripten": { "version": "1.39.13", "resolved": "https://registry.npmjs.org/@types/emscripten/-/emscripten-1.39.13.tgz", @@ -12883,6 +13153,11 @@ "integrity": "sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==", "dev": true }, + "node_modules/@types/offscreencanvas": { + "version": "2019.7.3", + "resolved": "https://registry.npmjs.org/@types/offscreencanvas/-/offscreencanvas-2019.7.3.tgz", + "integrity": "sha512-ieXiYmgSRXUDeOntE1InxjWyvEelZGP63M+cGuquuRLuIKKT1osnkXjxev9B7d1nXSug5vpunx+gNlbVxMlC9A==" + }, "node_modules/@types/papaparse": { "version": "5.3.14", "resolved": "https://registry.npmjs.org/@types/papaparse/-/papaparse-5.3.14.tgz", @@ -12939,6 +13214,14 @@ "@types/react": "*" } }, + "node_modules/@types/react-reconciler": { + "version": "0.26.7", + "resolved": "https://registry.npmjs.org/@types/react-reconciler/-/react-reconciler-0.26.7.tgz", + "integrity": "sha512-mBDYl8x+oyPX/VBb3E638N0B7xG+SPk/EAMcVPeexqus/5aTpTphQi0curhhshOqRrc9t6OPoJfEUkbymse/lQ==", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/@types/react-transition-group": { "version": "4.4.10", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz", @@ -12994,6 +13277,23 @@ "integrity": "sha512-9aEbYZ3TbYMznPdcdr3SmIrLXwC/AKZXQeCf9Pgao5CKb8CyHuEX5jzWPTkvregvhRJHcpRO6BFoGW9ycaOkYw==", "peer": true }, + "node_modules/@types/stats.js": { + "version": "0.17.3", + "resolved": "https://registry.npmjs.org/@types/stats.js/-/stats.js-0.17.3.tgz", + "integrity": "sha512-pXNfAD3KHOdif9EQXZ9deK82HVNaXP5ZIF5RP2QG6OQFNTaY2YIetfrE9t528vEreGQvEPRDDc8muaoYeK0SxQ==" + }, + "node_modules/@types/three": { + "version": "0.166.0", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.166.0.tgz", + "integrity": "sha512-FHMnpcdhdbdOOIYbfkTkUVpYMW53odxbTRwd0/xJpYnTzEsjnVnondGAvHZb4z06UW0vo6WPVuvH0/9qrxKx7g==", + "dependencies": { + "@tweenjs/tween.js": "~23.1.2", + "@types/stats.js": "*", + "@types/webxr": "*", + "fflate": "~0.8.2", + "meshoptimizer": "~0.18.1" + } + }, "node_modules/@types/trusted-types": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", @@ -13010,6 +13310,11 @@ "integrity": "sha512-jg+97EGIcY9AGHJJRaaPVgetKDsrTgbRjQ5Msgjh/DQKEFl0DtyRr/VCOyD1T2R1MNeWPK/u7JoGhlDZnKBAfA==", "dev": true }, + "node_modules/@types/webxr": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/@types/webxr/-/webxr-0.5.19.tgz", + "integrity": "sha512-4hxA+NwohSgImdTSlPXEqDqqFktNgmTXQ05ff1uWam05tNGroCMp4G+4XVl6qWm1p7GQ/9oD41kAYsSssF6Mzw==" + }, "node_modules/@types/yargs": { "version": "17.0.32", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", @@ -13039,6 +13344,22 @@ "crypto-js": "^4.2.0" } }, + "node_modules/@use-gesture/core": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/@use-gesture/core/-/core-10.3.1.tgz", + "integrity": "sha512-WcINiDt8WjqBdUXye25anHiNxPc0VOrlT8F6LLkU6cycrOGUDyY/yyFmsg3k8i5OLvv25llc0QC45GhR/C8llw==" + }, + "node_modules/@use-gesture/react": { + "version": "10.3.1", + "resolved": "https://registry.npmjs.org/@use-gesture/react/-/react-10.3.1.tgz", + "integrity": "sha512-Yy19y6O2GJq8f7CHf7L0nxL8bf4PZCPaVOCgJrusOeFHY1LvHgYXnmnXg6N5iwAnbgbZCDjo60SiM6IPJi9C5g==", + "dependencies": { + "@use-gesture/core": "10.3.1" + }, + "peerDependencies": { + "react": ">= 16.8.0" + } + }, "node_modules/@vercel/kv": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@vercel/kv/-/kv-1.0.1.tgz", @@ -16023,6 +16344,14 @@ "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==" }, + "node_modules/bidi-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/bidi-js/-/bidi-js-1.0.3.tgz", + "integrity": "sha512-RKshQI1R3YQ+n9YJz2QQ147P66ELpa1FQEg20Dk8oW9t2KgLbpDLLp9aGZ7y8WHSshDknG0bknqGw5/tyCs5tw==", + "dependencies": { + "require-from-string": "^2.0.2" + } + }, "node_modules/big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -16703,6 +17032,14 @@ "node": ">=6" } }, + "node_modules/camera-controls": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/camera-controls/-/camera-controls-2.8.5.tgz", + "integrity": "sha512-7VTwRk7Nu1nRKsY7bEt9HVBfKt8DETvzyYhLN4OW26OByBayMDB5fUaNcPI+z++vG23RH5yqn6ZRhZcgLQy2rA==", + "peerDependencies": { + "three": ">=0.126.1" + } + }, "node_modules/caniuse-lite": { "version": "1.0.30001642", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001642.tgz", @@ -16722,6 +17059,15 @@ } ] }, + "node_modules/canvas-confetti": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/canvas-confetti/-/canvas-confetti-1.9.3.tgz", + "integrity": "sha512-rFfTURMvmVEX1gyXFgn5QMn81bYk70qa0HLzcIOSVEyl57n6o9ItHeBtUSWdvKAPY0xlvBHno4/v3QPrT83q9g==", + "funding": { + "type": "donate", + "url": "https://www.paypal.me/kirilvatev" + } + }, "node_modules/case-sensitive-paths-webpack-plugin": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/case-sensitive-paths-webpack-plugin/-/case-sensitive-paths-webpack-plugin-2.4.0.tgz", @@ -17812,6 +18158,23 @@ "sha.js": "^2.4.8" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-fetch": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-4.0.0.tgz", @@ -18441,6 +18804,14 @@ "resolved": "https://registry.npmjs.org/detect-browser/-/detect-browser-5.3.0.tgz", "integrity": "sha512-53rsFbGdwMwlF7qvCt0ypLM5V5/Mbl0szB7GPN8y9NCcbknYOeVVXdrXEq+90IwAfrrzt6Hd+u2E2ntakICU8w==" }, + "node_modules/detect-gpu": { + "version": "5.0.40", + "resolved": "https://registry.npmjs.org/detect-gpu/-/detect-gpu-5.0.40.tgz", + "integrity": "sha512-5v4jDN/ERdZZitD29UiLjV9Q9+lDfw2OhEJACIqnvdWulVZCy2K6EwonZ/VKyo4YMqvSIzGIDmojX3jGL3dLpA==", + "dependencies": { + "webgl-constants": "^1.1.1" + } + }, "node_modules/detect-indent": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.1.0.tgz", @@ -18752,6 +19123,11 @@ "node": ">=8" } }, + "node_modules/draco3d": { + "version": "1.5.7", + "resolved": "https://registry.npmjs.org/draco3d/-/draco3d-1.5.7.tgz", + "integrity": "sha512-m6WCKt/erDXcw+70IJXnG7M3awwQPAsZvJGX5zY7beBqpELw6RDGkYVU0W43AFxye4pDZ5i2Lbyc/NNGqwjUVQ==" + }, "node_modules/duplexer": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", @@ -18822,6 +19198,39 @@ "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" }, + "node_modules/embla-carousel": { + "version": "8.1.6", + "resolved": "https://registry.npmjs.org/embla-carousel/-/embla-carousel-8.1.6.tgz", + "integrity": "sha512-9n7FVsbPAs1KD+JmO84DnEDOZMXPBQbLujjMQqvsBRN2CDWwgZ9hRSNapztdPnyJfzOIxowGmj0BUQ8ACYAPkA==" + }, + "node_modules/embla-carousel-autoplay": { + "version": "8.1.6", + "resolved": "https://registry.npmjs.org/embla-carousel-autoplay/-/embla-carousel-autoplay-8.1.6.tgz", + "integrity": "sha512-e5n9f4q+DVeBPiPPT3gwzqpiqfae8aP8fQACS4OZkPFvFLdsVhnWcw+cwtewryP7snWJGKPXEMA1GOjieEKv+w==", + "peerDependencies": { + "embla-carousel": "8.1.6" + } + }, + "node_modules/embla-carousel-react": { + "version": "8.1.6", + "resolved": "https://registry.npmjs.org/embla-carousel-react/-/embla-carousel-react-8.1.6.tgz", + "integrity": "sha512-DHxwFzF63yVrU95Eo58E9Xr5b6Y9ul6TTsqb/rtwMi+jXudAmIqN1i9iBxQ73i8jKuUVxll/ziNYMmnWvrdQJQ==", + "dependencies": { + "embla-carousel": "8.1.6", + "embla-carousel-reactive-utils": "8.1.6" + }, + "peerDependencies": { + "react": "^16.8.0 || ^17.0.1 || ^18.0.0" + } + }, + "node_modules/embla-carousel-reactive-utils": { + "version": "8.1.6", + "resolved": "https://registry.npmjs.org/embla-carousel-reactive-utils/-/embla-carousel-reactive-utils-8.1.6.tgz", + "integrity": "sha512-Wg+J2YoqLqkaqsXi7fTJaLmXm6BpgDRJ0EfTdvQ4KE/ip5OsUuKGpJsEQDTt4waGXSDyZhIBlfoQtgGJeyYQ1Q==", + "peerDependencies": { + "embla-carousel": "8.1.6" + } + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -20433,6 +20842,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/glsl-noise": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/glsl-noise/-/glsl-noise-0.0.0.tgz", + "integrity": "sha512-b/ZCF6amfAUb7dJM/MxRs7AetQEahYzJ8PtgfrmEdtw6uyGOr+ZSGtgjFm6mfsBkxJ4d2W7kg+Nlqzqvn3Bc0w==" + }, "node_modules/gopd": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", @@ -20794,6 +21208,11 @@ "resolved": "https://registry.npmjs.org/hey-listen/-/hey-listen-1.0.8.tgz", "integrity": "sha512-COpmrF2NOg4TBWUJ5UVyaCU2A88wEMkUPK4hNqyCkqHbxT92BbvfjoSozkAIIm6XhicGlJHhFdullInrdhwU8Q==" }, + "node_modules/hls.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/hls.js/-/hls.js-1.3.5.tgz", + "integrity": "sha512-uybAvKS6uDe0MnWNEPnO0krWVr+8m2R0hJ/viql8H3MVK+itq8gGQuIYoFHL3rECkIpNH98Lw8YuuWMKZxp3Ew==" + }, "node_modules/hmac-drbg": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", @@ -21088,6 +21507,11 @@ "node": ">=16.x" } }, + "node_modules/immediate": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", + "integrity": "sha512-XXOFtyqDjNDAQxVfYxuF7g9Il/IbWmmlQg2MYKOH8ExIT1qg6xc4zyS3HaEEATgs1btfzxq15ciUiY7gjSXRGQ==" + }, "node_modules/import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -21407,6 +21831,11 @@ "node": ">=0.10.0" } }, + "node_modules/is-promise": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz", + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==" + }, "node_modules/is-stream": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", @@ -21534,6 +21963,25 @@ "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==" }, + "node_modules/its-fine": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/its-fine/-/its-fine-1.2.5.tgz", + "integrity": "sha512-fXtDA0X0t0eBYAGLVM5YsgJGsJ5jEmqZEPrGbzdf5awjv0xE7nqv3TVnvtUF060Tkes15DbDAKW/I48vsb6SyA==", + "dependencies": { + "@types/react-reconciler": "^0.28.0" + }, + "peerDependencies": { + "react": ">=18.0" + } + }, + "node_modules/its-fine/node_modules/@types/react-reconciler": { + "version": "0.28.8", + "resolved": "https://registry.npmjs.org/@types/react-reconciler/-/react-reconciler-0.28.8.tgz", + "integrity": "sha512-SN9c4kxXZonFhbX4hJrZy37yw9e7EIxcpHCxQv5JUS18wDE5ovkQKlqQEkufdJCCMfuI9BnjUJvhYeJ9x5Ra7g==", + "dependencies": { + "@types/react": "*" + } + }, "node_modules/jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", @@ -22278,6 +22726,14 @@ "url": "https://github.com/sponsors/dmonad" } }, + "node_modules/lie": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", + "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "dependencies": { + "immediate": "~3.0.5" + } + }, "node_modules/lighthouse-logger": { "version": "1.4.2", "resolved": "https://registry.npmjs.org/lighthouse-logger/-/lighthouse-logger-1.4.2.tgz", @@ -23162,6 +23618,15 @@ "lz-string": "bin/bin.js" } }, + "node_modules/maath": { + "version": "0.10.8", + "resolved": "https://registry.npmjs.org/maath/-/maath-0.10.8.tgz", + "integrity": "sha512-tRvbDF0Pgqz+9XUa4jjfgAQ8/aPKmQdWXilFu2tMy4GWj4NOsx99HlULO4IeREfbO3a0sA145DZYyvXPkybm0g==", + "peerDependencies": { + "@types/three": ">=0.134.0", + "three": ">=0.134.0" + } + }, "node_modules/magic-string": { "version": "0.30.10", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.10.tgz", @@ -23704,6 +24169,19 @@ "node": ">= 8" } }, + "node_modules/meshline": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/meshline/-/meshline-3.3.1.tgz", + "integrity": "sha512-/TQj+JdZkeSUOl5Mk2J7eLcYTLiQm2IDzmlSvYm7ov15anEcDJ92GHqqazxTSreeNgfnYu24kiEvvv0WlbCdFQ==", + "peerDependencies": { + "three": ">=0.137" + } + }, + "node_modules/meshoptimizer": { + "version": "0.18.1", + "resolved": "https://registry.npmjs.org/meshoptimizer/-/meshoptimizer-0.18.1.tgz", + "integrity": "sha512-ZhoIoL7TNV4s5B6+rx5mC//fw8/POGyNxS/DZyCJeiZ12ScLfVwRE/GfsxwiTkMYYD5DmK2/JXnEVXqL4rF+Sw==" + }, "node_modules/methods": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", @@ -26765,6 +27243,11 @@ "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz", "integrity": "sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==" }, + "node_modules/potpack": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/potpack/-/potpack-1.0.2.tgz", + "integrity": "sha512-choctRBIV9EMT9WGAZHn3V7t0Z2pMQyl0EZE6pFc/6ml3ssw7Dlf/oAOvFwjm1HVsqfQN8GfeFyJ+d8tRzqueQ==" + }, "node_modules/preact": { "version": "10.22.1", "resolved": "https://registry.npmjs.org/preact/-/preact-10.22.1.tgz", @@ -26958,6 +27441,15 @@ "asap": "~2.0.6" } }, + "node_modules/promise-worker-transferable": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/promise-worker-transferable/-/promise-worker-transferable-1.0.4.tgz", + "integrity": "sha512-bN+0ehEnrXfxV2ZQvU2PetO0n4gqBD4ulq3MI1WOPLgr7/Mg9yRQkX5+0v1vagr74ZTsl7XtzlaYDo2EuCeYJw==", + "dependencies": { + "is-promise": "^2.1.0", + "lie": "^3.0.2" + } + }, "node_modules/prompts": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", @@ -27398,6 +27890,18 @@ "react": ">=16.4.1" } }, + "node_modules/react-canvas-confetti": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/react-canvas-confetti/-/react-canvas-confetti-2.0.7.tgz", + "integrity": "sha512-DIj44O35TPAwJkUSIZqWdVsgAMHtVf8h7YNmnr3jF3bn5mG+d7Rh9gEcRmdJfYgRzh6K+MAGujwUoIqQyLnMJw==", + "dependencies": { + "@types/canvas-confetti": "^1.6.4", + "canvas-confetti": "^1.9.2" + }, + "peerDependencies": { + "react": "*" + } + }, "node_modules/react-clientside-effect": { "version": "1.2.6", "resolved": "https://registry.npmjs.org/react-clientside-effect/-/react-clientside-effect-1.2.6.tgz", @@ -27419,6 +27923,17 @@ "react-dom": ">=16.8.0" } }, + "node_modules/react-composer": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/react-composer/-/react-composer-5.0.3.tgz", + "integrity": "sha512-1uWd07EME6XZvMfapwZmc7NgCZqDemcvicRi3wMJzXsQLvZ3L7fTHVyPy1bZdnWXM4iPjYuNE+uJ41MLKeTtnA==", + "dependencies": { + "prop-types": "^15.6.0" + }, + "peerDependencies": { + "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0" + } + }, "node_modules/react-confetti": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/react-confetti/-/react-confetti-6.1.0.tgz", @@ -27701,6 +28216,29 @@ "npm": ">=5" } }, + "node_modules/react-reconciler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/react-reconciler/-/react-reconciler-0.27.0.tgz", + "integrity": "sha512-HmMDKciQjYmBRGuuhIaKA1ba/7a+UsM5FzOZsMO2JYHt9Jh8reCb7j1eDC95NOyUlKM9KRyvdx0flBuDvYSBoA==", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.21.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "react": "^18.0.0" + } + }, + "node_modules/react-reconciler/node_modules/scheduler": { + "version": "0.21.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.21.0.tgz", + "integrity": "sha512-1r87x5fz9MXqswA2ERLo0EbOAU74DpIUO090gIasYTqlVoJeMcl+Z1Rg7WHz+qtPujhS/hGIt9kxZOYBV3faRQ==", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, "node_modules/react-refresh": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", @@ -29063,7 +29601,6 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -30006,6 +30543,31 @@ "node": ">=8" } }, + "node_modules/stats-gl": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/stats-gl/-/stats-gl-2.2.8.tgz", + "integrity": "sha512-94G5nZvduDmzxBS7K0lYnynYwreZpkknD8g5dZmU6mpwIhy3caCrjAm11Qm1cbyx7mqix7Fp00RkbsonzKWnoQ==", + "dependencies": { + "@types/three": "^0.163.0" + } + }, + "node_modules/stats-gl/node_modules/@types/three": { + "version": "0.163.0", + "resolved": "https://registry.npmjs.org/@types/three/-/three-0.163.0.tgz", + "integrity": "sha512-uIdDhsXRpQiBUkflBS/i1l3JX14fW6Ot9csed60nfbZNXHDTRsnV2xnTVwXcgbvTiboAR4IW+t+lTL5f1rqIqA==", + "dependencies": { + "@tweenjs/tween.js": "~23.1.1", + "@types/stats.js": "*", + "@types/webxr": "*", + "fflate": "~0.8.2", + "meshoptimizer": "~0.18.1" + } + }, + "node_modules/stats.js": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/stats.js/-/stats.js-0.17.0.tgz", + "integrity": "sha512-hNKz8phvYLPEcRkeG1rsGmV5ChMjKDAWU7/OJJdDErPBNChQXxCo3WZurGpnWc6gZhAzEPFad1aVgyOANH1sMw==" + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -30494,6 +31056,14 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/suspend-react": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/suspend-react/-/suspend-react-0.1.3.tgz", + "integrity": "sha512-aqldKgX9aZqpoDp3e8/BZ8Dm7x1pJl+qI3ZKxDN0i/IQTWUwBx/ManmlVJ3wowqbno6c2bmiIfs+Um6LbsjJyQ==", + "peerDependencies": { + "react": ">=17.0" + } + }, "node_modules/svg-parser": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/svg-parser/-/svg-parser-2.0.4.tgz", @@ -30894,6 +31464,40 @@ "real-require": "^0.1.0" } }, + "node_modules/three": { + "version": "0.166.1", + "resolved": "https://registry.npmjs.org/three/-/three-0.166.1.tgz", + "integrity": "sha512-LtuafkKHHzm61AQA1be2MAYIw1IjmhOUxhBa0prrLpEMWbV7ijvxCRHjSgHPGp2493wLBzwKV46tA9nivLEgKg==" + }, + "node_modules/three-mesh-bvh": { + "version": "0.7.6", + "resolved": "https://registry.npmjs.org/three-mesh-bvh/-/three-mesh-bvh-0.7.6.tgz", + "integrity": "sha512-rCjsnxEqR9r1/C/lCqzGLS67NDty/S/eT6rAJfDvsanrIctTWdNoR4ZOGWewCB13h1QkVo2BpmC0wakj1+0m8A==", + "peerDependencies": { + "three": ">= 0.151.0" + } + }, + "node_modules/three-stdlib": { + "version": "2.30.4", + "resolved": "https://registry.npmjs.org/three-stdlib/-/three-stdlib-2.30.4.tgz", + "integrity": "sha512-E7sN8UkaorSq2uRZU14AE7wXkdCBa2oFwPkPt92zaecuzrgd98BXkTt+2tFQVF1tPJRvfs7aMZV5dSOq4/vNVg==", + "dependencies": { + "@types/draco3d": "^1.4.0", + "@types/offscreencanvas": "^2019.6.4", + "@types/webxr": "^0.5.2", + "draco3d": "^1.4.1", + "fflate": "^0.6.9", + "potpack": "^1.0.1" + }, + "peerDependencies": { + "three": ">=0.128.0" + } + }, + "node_modules/three-stdlib/node_modules/fflate": { + "version": "0.6.10", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.6.10.tgz", + "integrity": "sha512-IQrh3lEPM93wVCEczc9SaAOvkmcoQn/G8Bo1e8ZPlY3X3bnAxWaBdvTdvM1hP62iZp0BXWDy4vTAy4fF0+Dlpg==" + }, "node_modules/throat": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", @@ -31046,6 +31650,33 @@ "node": ">=8" } }, + "node_modules/troika-three-text": { + "version": "0.49.1", + "resolved": "https://registry.npmjs.org/troika-three-text/-/troika-three-text-0.49.1.tgz", + "integrity": "sha512-lXGWxgjJP9kw4i4Wh+0k0Q/7cRfS6iOME4knKht/KozPu9GcFA9NnNpRvehIhrUawq9B0ZRw+0oiFHgRO+4Wig==", + "dependencies": { + "bidi-js": "^1.0.2", + "troika-three-utils": "^0.49.0", + "troika-worker-utils": "^0.49.0", + "webgl-sdf-generator": "1.1.1" + }, + "peerDependencies": { + "three": ">=0.125.0" + } + }, + "node_modules/troika-three-utils": { + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/troika-three-utils/-/troika-three-utils-0.49.0.tgz", + "integrity": "sha512-umitFL4cT+Fm/uONmaQEq4oZlyRHWwVClaS6ZrdcueRvwc2w+cpNQ47LlJKJswpqtMFWbEhOLy0TekmcPZOdYA==", + "peerDependencies": { + "three": ">=0.125.0" + } + }, + "node_modules/troika-worker-utils": { + "version": "0.49.0", + "resolved": "https://registry.npmjs.org/troika-worker-utils/-/troika-worker-utils-0.49.0.tgz", + "integrity": "sha512-1xZHoJrG0HFfCvT/iyN41DvI/nRykiBtHqFkGaGgJwq5iXfIZFBiPPEHFpPpgyKM3Oo5ITHXP5wM2TNQszYdVg==" + }, "node_modules/trough": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/trough/-/trough-2.2.0.tgz", @@ -31185,6 +31816,14 @@ "node": "*" } }, + "node_modules/tunnel-rat": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/tunnel-rat/-/tunnel-rat-0.1.2.tgz", + "integrity": "sha512-lR5VHmkPhzdhrM092lI2nACsLO4QubF0/yoOhzX7c+wIpbN1GjHNzCc91QlpxBi+cnx8vVJ+Ur6vL5cEoQPFpQ==", + "dependencies": { + "zustand": "^4.3.2" + } + }, "node_modules/tween-functions": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/tween-functions/-/tween-functions-1.2.0.tgz", @@ -31822,6 +32461,14 @@ "integrity": "sha512-Z0DbgELS9/L/75wZbro8xAnT50pBVFQZ+hUEueGDU5FN51YSCYM+jdxsfCiHjwNP/4LCDD0i/graKpeBnOXKRA==", "dev": true }, + "node_modules/utility-types": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/utility-types/-/utility-types-3.11.0.tgz", + "integrity": "sha512-6Z7Ma2aVEWisaL6TvBCy7P8rm2LQoPv6dJ7ecIaIixHcwfbJ0x7mWdbcwlIM5IGQxPZSFYeqRCqlOOeKoJYMkw==", + "engines": { + "node": ">= 4" + } + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -32190,6 +32837,16 @@ "resolved": "https://registry.npmjs.org/webextension-polyfill/-/webextension-polyfill-0.10.0.tgz", "integrity": "sha512-c5s35LgVa5tFaHhrZDnr3FpQpjj1BB+RXhLTYUxGqBVN460HkbM8TBtEqdXWbpTKfzwCcjAZVF7zXCYSKtcp9g==" }, + "node_modules/webgl-constants": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/webgl-constants/-/webgl-constants-1.1.1.tgz", + "integrity": "sha512-LkBXKjU5r9vAW7Gcu3T5u+5cvSvh5WwINdr0C+9jpzVB41cjQAP5ePArDtk/WHYdVj0GefCgM73BA7FlIiNtdg==" + }, + "node_modules/webgl-sdf-generator": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/webgl-sdf-generator/-/webgl-sdf-generator-1.1.1.tgz", + "integrity": "sha512-9Z0JcMTFxeE+b2x1LJTdnaT8rT8aEp7MVxkNwoycNmJWwPdzoXzMh0BjJSh/AEFP+KPYZUli814h8bJZFIZ2jA==" + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", diff --git a/package.json b/package.json index 165e62362e..4659c8df4f 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@emotion/styled": "^11.11.0", "@fuels/connectors": "^0.5.0", "@fuels/react": "^0.20.0", - "@guildxyz/types": "^1.9.38", + "@guildxyz/types": "^1.9.39", "@hcaptcha/react-hcaptcha": "^1.4.4", "@hookform/resolvers": "^3.3.4", "@lexical/code": "^0.12.0", @@ -53,6 +53,7 @@ "@radix-ui/react-focus-scope": "^1.1.0", "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-popover": "^1.1.1", + "@radix-ui/react-progress": "^1.1.0", "@radix-ui/react-select": "^2.1.1", "@radix-ui/react-separator": "^1.1.0", "@radix-ui/react-slot": "^1.1.0", @@ -60,11 +61,14 @@ "@radix-ui/react-toggle": "^1.1.0", "@radix-ui/react-toggle-group": "^1.1.0", "@radix-ui/react-tooltip": "^1.1.2", + "@react-three/drei": "^9.108.4", + "@react-three/fiber": "^8.16.8", "@snyk/protect": "latest", "@t3-oss/env-nextjs": "^0.10.1", "@tanstack/react-query": "^5.26.3", "@tanstack/react-table": "^8.13.2", "@tanstack/react-virtual": "^3.5.0", + "@types/three": "^0.166.0", "@vercel/kv": "^1.0.1", "@visx/curve": "^3.3.0", "@visx/xychart": "^3.10.2", @@ -77,6 +81,8 @@ "clsx": "^2.1.1", "color": "^4.2.3", "colorthief": "^2.3.2", + "embla-carousel-autoplay": "^8.1.6", + "embla-carousel-react": "^8.1.6", "events": "^3.3.0", "framer-motion": "^7.10.3", "fuels": "^0.89.1", @@ -94,6 +100,7 @@ "qrcode.react": "^3.1.0", "randombytes": "^2.1.0", "react": "^18.2.0", + "react-canvas-confetti": "^2.0.7", "react-device-detect": "^2.2.2", "react-dom": "^18.2.0", "react-dropzone": "^14.2.3", @@ -109,6 +116,7 @@ "swr": "^2.2.4", "tailwind-merge": "^2.3.0", "tailwindcss-animate": "^1.0.7", + "three": "^0.166.1", "usehooks-ts": "^3.1.0", "uuidv7": "^0.6.3", "viem": "^2.17.0", diff --git a/public/apple_emojis/bust-in-silhouette.png b/public/apple_emojis/bust-in-silhouette.png new file mode 100644 index 0000000000..40607d093a Binary files /dev/null and b/public/apple_emojis/bust-in-silhouette.png differ diff --git a/public/apple_emojis/compass.png b/public/apple_emojis/compass.png new file mode 100644 index 0000000000..e182becd9b Binary files /dev/null and b/public/apple_emojis/compass.png differ diff --git a/public/apple_emojis/people-with-bunny-ears.png b/public/apple_emojis/people-with-bunny-ears.png new file mode 100644 index 0000000000..d1d62261ba Binary files /dev/null and b/public/apple_emojis/people-with-bunny-ears.png differ diff --git a/public/apple_emojis/sparkles.png b/public/apple_emojis/sparkles.png new file mode 100644 index 0000000000..532afeea06 Binary files /dev/null and b/public/apple_emojis/sparkles.png differ diff --git a/public/apple_emojis/speech-balloon.png b/public/apple_emojis/speech-balloon.png new file mode 100644 index 0000000000..4fca65a66e Binary files /dev/null and b/public/apple_emojis/speech-balloon.png differ diff --git a/public/apple_emojis/star.png b/public/apple_emojis/star.png new file mode 100644 index 0000000000..04196162d3 Binary files /dev/null and b/public/apple_emojis/star.png differ diff --git a/public/apple_emojis/technologist.png b/public/apple_emojis/technologist.png new file mode 100644 index 0000000000..fb9f2f4739 Binary files /dev/null and b/public/apple_emojis/technologist.png differ diff --git a/public/apple_emojis/unlocked.png b/public/apple_emojis/unlocked.png new file mode 100644 index 0000000000..3ef4ff6f32 Binary files /dev/null and b/public/apple_emojis/unlocked.png differ diff --git a/public/models/basic_guild_pass-transformed.glb b/public/models/basic_guild_pass-transformed.glb new file mode 100644 index 0000000000..294dde942f Binary files /dev/null and b/public/models/basic_guild_pass-transformed.glb differ diff --git a/public/models/gold_guild_pass-transformed.glb b/public/models/gold_guild_pass-transformed.glb new file mode 100644 index 0000000000..93e317701e Binary files /dev/null and b/public/models/gold_guild_pass-transformed.glb differ diff --git a/public/sfx/CREDITS.md b/public/sfx/CREDITS.md new file mode 100644 index 0000000000..4360cc7535 --- /dev/null +++ b/public/sfx/CREDITS.md @@ -0,0 +1 @@ +"./confetti-party-popper.mp3" : Attribution 4.0 International (CC BY 4.0) - Vilkas Sound diff --git a/public/sfx/confetti-party-popper.mp3 b/public/sfx/confetti-party-popper.mp3 new file mode 100644 index 0000000000..068fae791f Binary files /dev/null and b/public/sfx/confetti-party-popper.mp3 differ diff --git a/src/app/(marketing)/create-profile/(onboarding)/_components/AuthWall.tsx b/src/app/(marketing)/create-profile/(onboarding)/_components/AuthWall.tsx new file mode 100644 index 0000000000..1e25b6e95e --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/_components/AuthWall.tsx @@ -0,0 +1,25 @@ +"use client" + +import { useWeb3ConnectionManager } from "@/components/Web3ConnectionManager/hooks/useWeb3ConnectionManager" +import { useRouter, useSearchParams } from "next/navigation" +import { PropsWithChildren, useEffect } from "react" +import { CreateProfileSkeleton } from "./CreateProfileSkeleton" + +export const AuthWall = ({ children }: PropsWithChildren) => { + const { isWeb3Connected } = useWeb3ConnectionManager() + const router = useRouter() + const searchParams = useSearchParams() + + useEffect(() => { + if (isWeb3Connected === false) + router.replace( + ["/create-profile", searchParams].filter(Boolean).map(String).join("?") + ) + }, [isWeb3Connected, router.replace, searchParams]) + + if (!isWeb3Connected) { + return + } + + return children +} diff --git a/src/app/(marketing)/create-profile/(onboarding)/_components/BasicGuildPass.tsx b/src/app/(marketing)/create-profile/(onboarding)/_components/BasicGuildPass.tsx new file mode 100644 index 0000000000..82c7b4c070 --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/_components/BasicGuildPass.tsx @@ -0,0 +1,52 @@ +/* +Auto-generated by: https://github.com/pmndrs/gltfjsx +Command: npx gltfjsx@6.5.0 basic_guild_pass.glb --transform --types +Files: basic_guild_pass.glb [10.27MB] > /home/senkora/projects/guild.xyz/public/models/basic_guild_pass-transformed.glb [551.1KB] (95%) +*/ + +import { useGLTF } from "@react-three/drei" +import * as THREE from "three" +import { GLTF } from "three-stdlib" + +type GLTFResult = GLTF & { + nodes: { + Curve: THREE.Mesh + Curve001: THREE.Mesh + Curve003: THREE.Mesh + } + materials: { + SVGMat: THREE.MeshStandardMaterial + "Material.001": THREE.MeshStandardMaterial + "Material.002": THREE.MeshStandardMaterial + } + // animations: GLTFAction[] +} + +export function Model(props: JSX.IntrinsicElements["group"]) { + const { nodes, materials } = useGLTF( + "/models/basic_guild_pass-transformed.glb" + ) as GLTFResult + return ( + + + + + + ) +} + +useGLTF.preload("/models/basic_guild_pass-transformed.glb") diff --git a/src/app/(marketing)/create-profile/(onboarding)/_components/Benefits.tsx b/src/app/(marketing)/create-profile/(onboarding)/_components/Benefits.tsx new file mode 100644 index 0000000000..4442ea7acc --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/_components/Benefits.tsx @@ -0,0 +1,52 @@ +import { Card } from "@/components/ui/Card" +import { cn } from "@/lib/utils" +import Image from "next/image" +import { BENEFITS } from "../constants" + +export const Benefits = () => { + return ( + <> +

+ Benefits +

+

+ All passes provide the same benefits +

+
+ {BENEFITS.map(({ title, description, isAvailable, image }) => ( + + {isAvailable || ( +
+ Soon +
+ )} +
+ +
+
+

{title}

+

{description}

+
+
+ ))} +
+

+ Prices are subject to change in the future +

+ + ) +} diff --git a/src/app/(marketing)/create-profile/(onboarding)/_components/ChoosePass.tsx b/src/app/(marketing)/create-profile/(onboarding)/_components/ChoosePass.tsx new file mode 100644 index 0000000000..59966f5a91 --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/_components/ChoosePass.tsx @@ -0,0 +1,123 @@ +"use client" + +import { Button } from "@/components/ui/Button" +import { + Carousel, + CarouselApi, + CarouselContent, + CarouselDotButton, + CarouselItem, + useCarouselDotButton, +} from "@/components/ui/Carousel" +import { Separator } from "@/components/ui/Separator" +import { ToggleGroup, ToggleGroupItem } from "@radix-ui/react-toggle-group" +import { useEffect, useState } from "react" +import { SUBSCRIPTIONS } from "../constants" +import { CreateProfileStep } from "../types" +import { Benefits } from "./Benefits" +import { GuildPassScene } from "./GuildPassScene" + +export const ChoosePass: CreateProfileStep = ({ dispatchAction }) => { + const [api, setApi] = useState() + const [subscriptionIndex, setSubscriptionIndex] = useState() + const { selectedIndex, scrollSnaps, onCarouselDotButtonClick } = + useCarouselDotButton(api) + useEffect(() => { + if (subscriptionIndex === undefined) return + dispatchAction({ + action: "next", + data: { + chosenSubscription: SUBSCRIPTIONS[subscriptionIndex], + }, + }) + }, [subscriptionIndex, dispatchAction]) + + return ( +
+

+ Choose your pass +

+ + + {SUBSCRIPTIONS.map(({ title, description, pricing }, i) => ( + +
+
+ +
+
+

{title}

+ + {pricing} + +

+ {description} +

+ +
+
+
+ ))} +
+
+
+ {scrollSnaps.map((_, i) => ( + onCarouselDotButtonClick(i)} + isActive={i === selectedIndex} + /> + ))} +
+ + + {SUBSCRIPTIONS.map(({ title, description, pricing }, i) => ( + setSubscriptionIndex(i)} + className={ + "relative w-full select-none from-accent outline-none hover:bg-gradient-to-t focus-visible:bg-gradient-to-t focus-visible:ring-4 focus-visible:ring-ring" + } + key={title} + > +
+
+ +
+
+

{title}

+ + {pricing} + +

+ {description} +

+
+ {i < SUBSCRIPTIONS.length - 1 && ( + + )} +
+
+ ))} +
+
+ +
+
+ ) +} diff --git a/src/app/(marketing)/create-profile/(onboarding)/_components/ClaimPass.tsx b/src/app/(marketing)/create-profile/(onboarding)/_components/ClaimPass.tsx new file mode 100644 index 0000000000..2500287dd6 --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/_components/ClaimPass.tsx @@ -0,0 +1,107 @@ +import { Button } from "@/components/ui/Button" +import { + FormControl, + FormDescription, + FormErrorMessage, + FormField, + FormItem, + FormLabel, +} from "@/components/ui/Form" +import { Input } from "@/components/ui/Input" +import { Schemas, schemas } from "@guildxyz/types" +import { zodResolver } from "@hookform/resolvers/zod" +import { ArrowRight } from "@phosphor-icons/react" +import { useEffect, useState } from "react" +import { FormProvider, useForm } from "react-hook-form" +import useSWRImmutable from "swr/immutable" +import { z } from "zod" +import { CreateProfileStep } from "../types" +import { GuildPassScene } from "./GuildPassScene" + +const formSchema = schemas.ProfileCreationSchema.pick({ username: true }) + +export const ClaimPass: CreateProfileStep = ({ dispatchAction, data }) => { + const form = useForm>({ + resolver: zodResolver(formSchema), + defaultValues: { + username: data.referrerProfile?.username ?? "", + }, + mode: "onTouched", + }) + + const [username, setUsername] = useState() + const referrer = useSWRImmutable( + username ? `/v2/profiles/${username}` : null + ) + const finalReferrer = + (!form.getFieldState("username").isDirty && data.referrerProfile) || + referrer.data + + useEffect(() => { + if (referrer.error) { + form.setError("username", { message: referrer.error.error }) + return + } + }, [referrer.error, form.setError]) + + function onSubmit(_: z.infer) { + if (!finalReferrer) { + throw new Error("Failed to resolve referrer profile") + } + dispatchAction({ action: "next", data: { referrerProfile: finalReferrer } }) + } + + return ( +
+
+ +
+

+ Claim your Guild Pass and begin an epic adventure! +

+ + +
+ ( + + Referrer username + + { + setUsername(field.value) + field.onBlur() + }} + /> + + + + To claim your Guild Pass you must provide an existing profile + username + + + )} + /> + + +
+
+ ) +} diff --git a/src/app/(marketing)/create-profile/(onboarding)/_components/CreateProfileSkeleton.tsx b/src/app/(marketing)/create-profile/(onboarding)/_components/CreateProfileSkeleton.tsx new file mode 100644 index 0000000000..c6567d44e6 --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/_components/CreateProfileSkeleton.tsx @@ -0,0 +1,5 @@ +import { Skeleton } from "@/components/ui/Skeleton" + +export const CreateProfileSkeleton = () => { + return +} diff --git a/src/app/(marketing)/create-profile/(onboarding)/_components/GoldGuildPass.tsx b/src/app/(marketing)/create-profile/(onboarding)/_components/GoldGuildPass.tsx new file mode 100644 index 0000000000..4b6da9d898 --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/_components/GoldGuildPass.tsx @@ -0,0 +1,52 @@ +/* +Auto-generated by: https://github.com/pmndrs/gltfjsx +Command: npx gltfjsx@6.5.0 gold_guild_pass.glb --transform --types +Files: gold_guild_pass.glb [10.27MB] > /home/senkora/projects/guild.xyz/public/models/gold_guild_pass-transformed.glb [551.06KB] (95%) +*/ + +import { useGLTF } from "@react-three/drei" +import * as THREE from "three" +import { GLTF } from "three-stdlib" + +type GLTFResult = GLTF & { + nodes: { + Curve: THREE.Mesh + Curve001: THREE.Mesh + Curve003: THREE.Mesh + } + materials: { + "Material.003": THREE.MeshStandardMaterial + "Material.001": THREE.MeshStandardMaterial + "Material.004": THREE.MeshStandardMaterial + } + // animations: GLTFAction[]nimations: GLTFAction[] +} + +export function Model(props: JSX.IntrinsicElements["group"]) { + const { nodes, materials } = useGLTF( + "/models/gold_guild_pass-transformed.glb" + ) as GLTFResult + return ( + + + + + + ) +} + +useGLTF.preload("/models/gold_guild_pass-transformed.glb") diff --git a/src/app/(marketing)/create-profile/(onboarding)/_components/GuildPassScene.tsx b/src/app/(marketing)/create-profile/(onboarding)/_components/GuildPassScene.tsx new file mode 100644 index 0000000000..cf7be14d71 --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/_components/GuildPassScene.tsx @@ -0,0 +1,50 @@ +"use client" + +import { Environment, Float } from "@react-three/drei" +import { Canvas } from "@react-three/fiber" +import { FunctionComponent } from "react" +import * as THREE from "three" +import { SUBSCRIPTIONS } from "../constants" +import { Model as BasicModel } from "./BasicGuildPass" +import { Model as GoldModel } from "./GoldGuildPass" + +type SceneVariant = (typeof SUBSCRIPTIONS)[number]["title"] + +function SinglePass() { + return +} + +function BundlePass() { + return +} + +function LifetimePass() { + return +} + +const Variants: Record = { + "Single Pass": SinglePass, + "Bundle Pass": BundlePass, + "Lifetime Pass": LifetimePass, +} + +export const GuildPassScene = ({ sceneVariant }: { sceneVariant: SceneVariant }) => { + const Variant = Variants[sceneVariant] + return ( + + + + + + + + + + ) +} diff --git a/src/app/(marketing)/create-profile/(onboarding)/_components/PurchasePass.tsx b/src/app/(marketing)/create-profile/(onboarding)/_components/PurchasePass.tsx new file mode 100644 index 0000000000..ce2a74d137 --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/_components/PurchasePass.tsx @@ -0,0 +1,106 @@ +"use client" + +import { Button } from "@/components/ui/Button" +import { Separator } from "@/components/ui/Separator" +import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/Tooltip" +import { DotLottiePlayer } from "@dotlottie/react-player" +import { ArrowLeft, Info } from "@phosphor-icons/react" +import { useEffect, useState } from "react" +import { CreateProfileStep } from "../types" +import { GuildPassScene } from "./GuildPassScene" + +export const PurchasePass: CreateProfileStep = ({ dispatchAction, data }) => { + const [didUserPurchase, setDidUserPurchase] = useState(false) + if (!data.chosenSubscription) throw new Error("Subscription data was not provided") + + const { title, pricingShort } = data.chosenSubscription + + useEffect(() => { + if (didUserPurchase) dispatchAction({ action: "next" }) + }, [didUserPurchase]) + + return ( +
+
+ +
+
+
+ {didUserPurchase ? ( + + ) : ( + + )} +
+
+

{title}

+ + {pricingShort} + +
+
+
+
+
+
+ 1. Verification + + + + + + We have to collect your personal details for legal reasons. They + won’t be shared anywhere on the website + + +
+ +
+ + + {title === "Lifetime Pass" ? ( +
+
2. Complete payment
+
+
Gas fee
+
0.03 ETH
+
+
+
Total
+
---
+
+ + +
+ ) : ( +
+ 2. Complete payment + +
+ )} +
+
+
+ ) +} diff --git a/src/app/(marketing)/create-profile/(onboarding)/_components/StartProfile.tsx b/src/app/(marketing)/create-profile/(onboarding)/_components/StartProfile.tsx new file mode 100644 index 0000000000..2a5488083d --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/_components/StartProfile.tsx @@ -0,0 +1,227 @@ +"use client" + +import FarcasterImage from "@/../static/socialIcons/farcaster.svg" +import { ConnectFarcasterButton } from "@/components/Account/components/AccountModal/components/FarcasterProfile" +import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/Avatar" +import { Button } from "@/components/ui/Button" +import { + FormControl, + FormErrorMessage, + FormField, + FormItem, + FormLabel, +} from "@/components/ui/Form" +import { Input } from "@/components/ui/Input" +import { useToast } from "@/components/ui/hooks/useToast" +import { cn } from "@/lib/utils" +import { Schemas, schemas } from "@guildxyz/types" +import { zodResolver } from "@hookform/resolvers/zod" +import { Spinner, UploadSimple, User } from "@phosphor-icons/react" +import { ArrowRight } from "@phosphor-icons/react/dist/ssr" +import useUser from "components/[guild]/hooks/useUser" +import useDropzone from "hooks/useDropzone" +import usePinata from "hooks/usePinata" +import { useEffect, useState } from "react" +import { FormProvider, useForm } from "react-hook-form" +import { useCreateProfile } from "../_hooks/useCreateProfile" +import { CreateProfileStep } from "../types" + +enum CreateMethod { + FillByFarcaster, + FromBlank, +} + +export const StartProfile: CreateProfileStep = ({ data: chainData }) => { + const { farcasterProfiles = [] } = useUser() + const farcasterProfile = farcasterProfiles.at(0) + const [method, setMethod] = useState( + farcasterProfile ? CreateMethod.FillByFarcaster : undefined + ) + const { toast } = useToast() + + useEffect(() => { + if (!farcasterProfile) return + setMethod(CreateMethod.FillByFarcaster) + form.setValue( + "name", + farcasterProfile.username ?? form.getValues()?.name ?? "", + { shouldValidate: true } + ) + form.setValue("profileImageUrl", farcasterProfile.avatar, { + shouldValidate: true, + }) + }, [farcasterProfile]) + + const form = useForm({ + resolver: zodResolver( + schemas.ProfileCreationSchema.omit({ referrerUserId: true }) + ), + defaultValues: { + name: "", + username: "", + }, + mode: "onTouched", + }) + + const createProfile = useCreateProfile() + async function onSubmit(values: Schemas["ProfileCreation"]) { + if (!chainData.referrerProfile?.userId) { + throw new Error("Tried to create profile with empty referrer profile") + } + createProfile.onSubmit({ + ...values, + referrerUserId: chainData.referrerProfile.userId, + }) + } + + const { isUploading, onUpload } = usePinata({ + control: form.control, + fieldToSetOnSuccess: "profileImageUrl", + onError: (error) => { + toast({ + variant: "error", + title: "Failed to upload file", + description: error, + }) + }, + }) + + const [uploadProgress, setUploadProgress] = useState(0) + const { isDragActive, getRootProps } = useDropzone({ + multiple: false, + noClick: false, + onDrop: (acceptedFiles) => { + if (!acceptedFiles[0]) return + onUpload({ + data: [acceptedFiles[0]], + onProgress: setUploadProgress, + }) + }, + onError: (error) => { + toast({ + variant: "error", + title: `Failed to upload file`, + description: error.message, + }) + }, + }) + + let avatarFallBackIcon = + if (isDragActive) { + avatarFallBackIcon = + } else if (isUploading || (uploadProgress !== 0 && uploadProgress !== 1)) { + avatarFallBackIcon = + } + + return ( +
+

+ Start your Guild Profile! +

+ + +
+ ( + + )} + /> + + {method === undefined ? ( + <> + +
+ +
+ Connect farcaster +
+ + + ) : ( + <> + ( + + Name + + + + + + )} + /> + ( + + Username + + + + + + )} + /> + + + )} + +
+
+ ) +} diff --git a/src/app/(marketing)/create-profile/(onboarding)/_hooks/useCreateProfile.ts b/src/app/(marketing)/create-profile/(onboarding)/_hooks/useCreateProfile.ts new file mode 100644 index 0000000000..b25c7b3f19 --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/_hooks/useCreateProfile.ts @@ -0,0 +1,42 @@ +import { useConfetti } from "@/components/Confetti" +import { useToast } from "@/components/ui/hooks/useToast" +import { Schemas } from "@guildxyz/types" +import { SignedValidation, useSubmitWithSign } from "hooks/useSubmit" +import { useRouter } from "next/navigation" +import fetcher from "utils/fetcher" + +export const useCreateProfile = () => { + const router = useRouter() + const { toast } = useToast() + const { confettiPlayer } = useConfetti() + + const createProfile = async (signedValidation: SignedValidation) => + fetcher(`/v2/profiles`, { + method: "POST", + ...signedValidation, + }) + + const submitWithSign = useSubmitWithSign(createProfile, { + onSuccess: (response) => { + toast({ + variant: "success", + title: "Successfully created profile", + }) + // TODO: maybe we should move this logic into page.tsx? + confettiPlayer.current("Confetti from left and right") + router.replace(`/profile/${response.username}`) + }, + onError: (response) => { + toast({ + variant: "error", + title: "Failed to create profile", + description: response.error, + }) + }, + }) + return { + ...submitWithSign, + onSubmit: (payload: Schemas["ProfileCreation"]) => + submitWithSign.onSubmit(payload), + } +} diff --git a/src/app/(marketing)/create-profile/(onboarding)/atoms.ts b/src/app/(marketing)/create-profile/(onboarding)/atoms.ts new file mode 100644 index 0000000000..fab307677f --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/atoms.ts @@ -0,0 +1,8 @@ +import { atom } from "jotai" +import { SUBSCRIPTIONS } from "./constants" +import { CreateProfileData } from "./types" + +export const createProfileDataAtom = atom>({ + chosenSubscription: SUBSCRIPTIONS[0], + subscription: true, +}) diff --git a/src/app/(marketing)/create-profile/(onboarding)/choose-pass/page.tsx b/src/app/(marketing)/create-profile/(onboarding)/choose-pass/page.tsx new file mode 100644 index 0000000000..72d283b1b4 --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/choose-pass/page.tsx @@ -0,0 +1,31 @@ +"use client" + +import { useSetAtom } from "jotai" +import { useRouter } from "next/navigation" +import { ChoosePass } from "../_components/ChoosePass" +import { createProfileDataAtom } from "../atoms" + +const Page = () => { + const router = useRouter() + const setData = useSetAtom(createProfileDataAtom) + + return ( + { + if (action === "next") { + if (!data?.chosenSubscription) { + throw new Error("Tried to resolve choose pass without value") + } + setData((prev) => ({ ...prev, ...data })) + router.push("purchase-pass") + } + if (action === "previous") { + router.back() + } + }} + /> + ) +} + +export default Page diff --git a/src/app/(marketing)/create-profile/(onboarding)/claim-pass/page.tsx b/src/app/(marketing)/create-profile/(onboarding)/claim-pass/page.tsx new file mode 100644 index 0000000000..04fa961544 --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/claim-pass/page.tsx @@ -0,0 +1,60 @@ +"use client" + +import { useToast } from "@/components/ui/hooks/useToast" +import { Schemas } from "@guildxyz/types" +import { useSetAtom } from "jotai" +import { useRouter, useSearchParams } from "next/navigation" +import { useEffect, useRef } from "react" +import useSWRImmutable from "swr/immutable" +import { ClaimPass } from "../_components/ClaimPass" +import { CreateProfileSkeleton } from "../_components/CreateProfileSkeleton" +import { createProfileDataAtom } from "../atoms" +import { REFERRER_USER_SEARCH_PARAM_KEY } from "../constants" + +const Page = () => { + const router = useRouter() + const { toast } = useToast() + const referrerUsername = useSearchParams()?.get(REFERRER_USER_SEARCH_PARAM_KEY) + const didReferrerValidate = useRef(false) + const referrer = useSWRImmutable( + referrerUsername ? `/v2/profiles/${referrerUsername}` : null, + { shouldRetryOnError: false } + ) + const setData = useSetAtom(createProfileDataAtom) + + useEffect(() => { + if (!referrerUsername || didReferrerValidate.current) return + if (referrer.error) { + didReferrerValidate.current = true + toast({ + variant: "error", + title: "Failed to identify referrer profile", + description: "Enter the username below and make sure the profile exists", + }) + } + }, [referrer.error, referrerUsername, toast]) + + if (referrer.isLoading) { + return + } + + return ( + { + if (action === "next") { + if (!data?.referrerProfile) { + throw new Error("Tried to resolve referrer profile without value") + } + setData((prev) => ({ + ...prev, + referrerProfile: data.referrerProfile, + })) + router.push("choose-pass") + } + }} + /> + ) +} + +export default Page diff --git a/src/app/(marketing)/create-profile/(onboarding)/constants.ts b/src/app/(marketing)/create-profile/(onboarding)/constants.ts new file mode 100644 index 0000000000..df3da5e04b --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/constants.ts @@ -0,0 +1,99 @@ +import bustInSilhouette from "@public/apple_emojis/bust-in-silhouette.png" +import compass from "@public/apple_emojis/compass.png" +import peopleWithBunnyEars from "@public/apple_emojis/people-with-bunny-ears.png" +import sparkles from "@public/apple_emojis/sparkles.png" +import speechBalloon from "@public/apple_emojis/speech-balloon.png" +import star from "@public/apple_emojis/star.png" +import technologist from "@public/apple_emojis/technologist.png" +import unlocked from "@public/apple_emojis/unlocked.png" +import { StaticImageData } from "next/image" + +export const SUBSCRIPTIONS = [ + { + title: "Single Pass", + pricing: "$6 / month", + pricingShort: "$6 / month", + description: "For the curious, who want to try Guild’s new features", + }, + { + title: "Bundle Pass", + pricing: "$60 / year", + pricingShort: "$60 / year", + description: "For the professionals, who would benefit from Guild continuously", + }, + { + title: "Lifetime Pass", + pricing: "0.1 ETH one time", + pricingShort: "0.1 ETH", + description: + "For Guild’s biggest supporters, who are excited for the future of Guild", + }, +] as const satisfies { + title: string + pricing: string + description: string + pricingShort: string +}[] + +export const BENEFITS = [ + { + title: "Launch your Guild Profile", + description: "Your onchain profile with achievements and XP level ", + isAvailable: true, + image: star, + }, + { + title: "Unlock exclusive rewards", + description: "Pass holders can access unique and one-off rewards from guilds", + isAvailable: true, + image: bustInSilhouette, + }, + { + title: "Get early access to Guild features", + description: "Be the first to unlock and experience our newest features", + isAvailable: true, + image: unlocked, + }, + { + title: "Priority support", + description: + "Get help within hours — even our CEO is answering priority tickets", + isAvailable: true, + image: speechBalloon, + }, + { + title: "Manage your personal Guild", + description: + "Special access to gamified features to help creators engage their audience", + isAvailable: false, + image: technologist, + }, + { + title: "Alpha Explorer", + description: + "Unlock secret guilds and earn exclusive rewards before they become popular", + isAvailable: false, + image: compass, + }, + { + title: "Be part of Gold community", + description: + "Shape Guild's future — your ideas drive what we build and when we build it", + isAvailable: false, + image: peopleWithBunnyEars, + }, + { + title: "Very top secret stuff", + description: + "There are things we can't tell you just yet — you'll have to see them for yourself", + isAvailable: false, + image: sparkles, + }, +] as const satisfies { + title: string + description: string + isAvailable: boolean + image: StaticImageData +}[] + +export const REFERRER_USER_SEARCH_PARAM_KEY = "referrer-username" diff --git a/src/app/(marketing)/create-profile/(onboarding)/layout.tsx b/src/app/(marketing)/create-profile/(onboarding)/layout.tsx new file mode 100644 index 0000000000..c11c8bda1c --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/layout.tsx @@ -0,0 +1,8 @@ +import { PropsWithChildren } from "react" +import { AuthWall } from "./_components/AuthWall" + +const Layout = ({ children }: PropsWithChildren) => { + return {children} +} + +export default Layout diff --git a/src/app/(marketing)/create-profile/(onboarding)/purchase-pass/page.tsx b/src/app/(marketing)/create-profile/(onboarding)/purchase-pass/page.tsx new file mode 100644 index 0000000000..75b0884dfd --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/purchase-pass/page.tsx @@ -0,0 +1,42 @@ +"use client" + +import { useAtom } from "jotai" +import { useRouter } from "next/navigation" +import { useEffect } from "react" +import { CreateProfileSkeleton } from "../_components/CreateProfileSkeleton" +import { PurchasePass } from "../_components/PurchasePass" +import { createProfileDataAtom } from "../atoms" + +const Page = () => { + const [data] = useAtom(createProfileDataAtom) + const router = useRouter() + + useEffect(() => { + if (!data.chosenSubscription) { + router.replace("choose-pass") + } + if (!data.referrerProfile) { + router.replace("claim-pass") + } + }, [data, router.replace]) + + if (!data.chosenSubscription || !data.referrerProfile) { + return + } + + return ( + { + if (action === "next") { + router.push("start-profile") + } + if (action === "previous") { + router.back() + } + }} + /> + ) +} + +export default Page diff --git a/src/app/(marketing)/create-profile/(onboarding)/start-profile/page.tsx b/src/app/(marketing)/create-profile/(onboarding)/start-profile/page.tsx new file mode 100644 index 0000000000..01b7a15da0 --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/start-profile/page.tsx @@ -0,0 +1,41 @@ +"use client" +import { useAtom } from "jotai" +import { useRouter } from "next/navigation" +import { useEffect } from "react" +import { CreateProfileSkeleton } from "../_components/CreateProfileSkeleton" +import { StartProfile } from "../_components/StartProfile" +import { createProfileDataAtom } from "../atoms" + +const Page = () => { + const [data] = useAtom(createProfileDataAtom) + const router = useRouter() + + useEffect(() => { + if (!data.referrerProfile) { + router.replace("claim-pass") + } + if (!data.subscription) { + router.replace("choose-pass") + } + }, [data, router.replace]) + + if (!data.subscription || !data.referrerProfile) { + return + } + + return ( + { + if (action === "next") { + // router.push("") + } + if (action === "previous") { + router.back() + } + }} + /> + ) +} + +export default Page diff --git a/src/app/(marketing)/create-profile/(onboarding)/types.ts b/src/app/(marketing)/create-profile/(onboarding)/types.ts new file mode 100644 index 0000000000..6acc3f2c38 --- /dev/null +++ b/src/app/(marketing)/create-profile/(onboarding)/types.ts @@ -0,0 +1,21 @@ +import { Schemas } from "@guildxyz/types" +import { FunctionComponent } from "react" +import { SUBSCRIPTIONS } from "./constants" + +export type CreateProfileAction = "next" | "previous" + +export interface CreateProfileData { + chosenSubscription: (typeof SUBSCRIPTIONS)[number] + referrerProfile: Schemas["Profile"] + createdProfile: Schemas["Profile"] + subscription: boolean +} +export type DispatchAction = (args: { + action: CreateProfileAction + data?: Partial +}) => void + +export type CreateProfileStep = FunctionComponent<{ + dispatchAction: DispatchAction + data: Partial +}> diff --git a/src/app/(marketing)/create-profile/layout.tsx b/src/app/(marketing)/create-profile/layout.tsx new file mode 100644 index 0000000000..fff6857dbb --- /dev/null +++ b/src/app/(marketing)/create-profile/layout.tsx @@ -0,0 +1,40 @@ +import { Header } from "@/components/Header" +import { Layout, LayoutBanner, LayoutHero, LayoutMain } from "@/components/Layout" +import { Card } from "@/components/ui/Card" +import svgToTinyDataUri from "mini-svg-data-uri" +import { PropsWithChildren, Suspense } from "react" + +const CreateProfile = ({ children }: PropsWithChildren) => { + return ( + +
` + )}")`, + }} + /> + +
+ +
+
+ + + + + {children} + + + + ) +} + +export default CreateProfile diff --git a/src/app/(marketing)/create-profile/page.tsx b/src/app/(marketing)/create-profile/page.tsx new file mode 100644 index 0000000000..c331fa5706 --- /dev/null +++ b/src/app/(marketing)/create-profile/page.tsx @@ -0,0 +1,68 @@ +"use client" + +import { walletSelectorModalAtom } from "@/components/Providers/atoms" +import { useWeb3ConnectionManager } from "@/components/Web3ConnectionManager/hooks/useWeb3ConnectionManager" +import { Anchor } from "@/components/ui/Anchor" +import { Button, buttonVariants } from "@/components/ui/Button" +import { SignIn } from "@phosphor-icons/react" +import { useSetAtom } from "jotai" +import { useRouter, useSearchParams } from "next/navigation" +import { useEffect } from "react" + +const Page = () => { + const { isWeb3Connected } = useWeb3ConnectionManager() + const setIsWalletSelectorModalOpen = useSetAtom(walletSelectorModalAtom) + const router = useRouter() + const searchParams = useSearchParams() + + useEffect(() => { + if (isWeb3Connected) { + router.replace( + ["/create-profile/claim-pass", searchParams] + .filter(Boolean) + .map(String) + .join("?") + ) + } + }, [isWeb3Connected, router.replace, searchParams]) + + return ( +
+
+

+ Sign in to create your profile +

+

+ Start your new profile adventure by signing in: earn experience, display + achievements and explore new rewards! +

+
+
+ + Back to home + + +
+
+ ) +} + +export default Page diff --git a/src/app/(marketing)/layout.tsx b/src/app/(marketing)/layout.tsx new file mode 100644 index 0000000000..e3f8a256f3 --- /dev/null +++ b/src/app/(marketing)/layout.tsx @@ -0,0 +1,13 @@ +import { ConfettiProvider } from "@/components/Confetti" +import type { Metadata } from "next" +import { PropsWithChildren } from "react" + +export const metadata: Metadata = { + title: "Create profile", +} + +const Layout = ({ children }: PropsWithChildren) => { + return {children} +} + +export default Layout diff --git a/src/app/(marketing)/profile/[username]/not-found.tsx b/src/app/(marketing)/profile/[username]/not-found.tsx new file mode 100644 index 0000000000..9fd2f43c83 --- /dev/null +++ b/src/app/(marketing)/profile/[username]/not-found.tsx @@ -0,0 +1,26 @@ +import { Button } from "@/components/ui/Button" +import { House } from "@phosphor-icons/react/dist/ssr" +import GuildGhost from "static/avatars/58.svg" + +const NotFound = () => { + return ( +
+ + +

Profile not found

+ +

+ + +
+ ) +} + +export default NotFound diff --git a/src/app/(marketing)/profile/[username]/page.tsx b/src/app/(marketing)/profile/[username]/page.tsx new file mode 100644 index 0000000000..c73bc6c504 --- /dev/null +++ b/src/app/(marketing)/profile/[username]/page.tsx @@ -0,0 +1,154 @@ +import { Header } from "@/components/Header" +import { + Layout, + LayoutBanner, + LayoutFooter, + LayoutHero, + LayoutMain, +} from "@/components/Layout" +import { SWRProvider } from "@/components/SWRProvider" +import { Anchor } from "@/components/ui/Anchor" +import { Guild, Role, Schemas } from "@guildxyz/types" +import { ArrowRight } from "@phosphor-icons/react/dist/ssr" +import { env } from "env" +import Image from "next/image" +import { notFound, redirect } from "next/navigation" +import { Profile } from "../_components/Profile" +import { ProfileColorBanner } from "../_components/ProfileColorBanner" +import { ProfileHero } from "../_components/ProfileHero" + +const api = env.NEXT_PUBLIC_API + +async function ssrFetcher(...args: Parameters) { + return (await fetch(...args)).json() as T +} + +const fetchPublicProfileData = async ({ username }: { username: string }) => { + const contributionsRequest = new URL(`v2/profiles/${username}/contributions`, api) + const profileRequest = new URL(`v2/profiles/${username}`, api) + const profileResponse = await fetch(profileRequest, { + next: { + tags: ["profile"], + revalidate: 3600, + }, + }) + + if (profileResponse.status === 404) notFound() + if (!profileResponse.ok) redirect("/error") + + const profile = (await profileResponse.json()) as Schemas["Profile"] + const contributions = await ssrFetcher( + contributionsRequest, + { + next: { + tags: ["contributions"], + revalidate: 3600, + }, + } + ) + const roleRequests = contributions.map( + ({ roleId, guildId }) => new URL(`v2/guilds/${guildId}/roles/${roleId}`, api) + ) + const guildRequests = contributions.map( + ({ guildId }) => new URL(`v2/guilds/${guildId}`, api) + ) + const guilds = await Promise.all( + guildRequests.map((req) => + ssrFetcher(req, { + next: { + revalidate: 3 * 3600, + }, + }) + ) + ) + const roles = await Promise.all( + roleRequests.map((req) => + ssrFetcher(req, { + next: { + revalidate: 3 * 3600, + }, + }) + ) + ) + const guildsZipped = Object.fromEntries( + guildRequests.map(({ pathname }, i) => [pathname, guilds[i]]) + ) + const rolesZipped = Object.fromEntries( + roleRequests.map(({ pathname }, i) => [pathname, roles[i]]) + ) + return { + profile, + fallback: { + [profileRequest.pathname]: profile, + [contributionsRequest.pathname]: contributions, + ...guildsZipped, + ...rolesZipped, + }, + } +} + +const Page = async ({ params: { username } }: { params: { username: string } }) => { + const { fallback, profile } = await fetchPublicProfileData({ username }) + + const isBgColor = profile.backgroundImageUrl?.startsWith("#") + + return ( + + + +
+ + {isBgColor ? ( + + ) : ( + profile.backgroundImageUrl && ( + profile background image + ) + )} +
+ + + + + + + +

+ Guild Profiles are currently in invite only early access, only available + to{" "} + + Subscribers + + +

+
+ + + ) +} + +// biome-ignore lint/style/noDefaultExport: page route +export default Page diff --git a/src/app/(marketing)/profile/_components/CardWithGuildLabel.tsx b/src/app/(marketing)/profile/_components/CardWithGuildLabel.tsx new file mode 100644 index 0000000000..3f070e8022 --- /dev/null +++ b/src/app/(marketing)/profile/_components/CardWithGuildLabel.tsx @@ -0,0 +1,54 @@ +import { CheckMark } from "@/components/CheckMark" +import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/Avatar" +import { Card } from "@/components/ui/Card" +import { cn } from "@/lib/utils" +import { Guild } from "@guildxyz/types" +import Color from "color" +import { PropsWithChildren } from "react" + +export const CardWithGuildLabel = ({ + guild, + children, +}: PropsWithChildren<{ guild: Guild }>) => { + const color = guild.theme.color && Color(guild.theme.color) + + return ( + +
+
+ + + + +
+ {guild.name} +
+ +
+
+
+ {children} +
+
+ ) +} diff --git a/src/app/(marketing)/profile/_components/ContributionCard.tsx b/src/app/(marketing)/profile/_components/ContributionCard.tsx new file mode 100644 index 0000000000..08347d0bde --- /dev/null +++ b/src/app/(marketing)/profile/_components/ContributionCard.tsx @@ -0,0 +1,16 @@ +"use client" + +import { Guild, Role, Schemas } from "@guildxyz/types" +import useSWRImmutable from "swr/immutable" +import { ContributionCardView } from "./ContributionCardView" + +export const ContributionCard = ({ + contribution, +}: { contribution: Schemas["Contribution"] }) => { + const guild = useSWRImmutable(`/v2/guilds/${contribution.guildId}`) + const role = useSWRImmutable( + `/v2/guilds/${contribution.guildId}/roles/${contribution.roleId}` + ) + if (!role.data || !guild.data) return + return +} diff --git a/src/app/(marketing)/profile/_components/ContributionCardView.tsx b/src/app/(marketing)/profile/_components/ContributionCardView.tsx new file mode 100644 index 0000000000..b3660e4b6d --- /dev/null +++ b/src/app/(marketing)/profile/_components/ContributionCardView.tsx @@ -0,0 +1,44 @@ +import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/Avatar" +import { AvatarGroup } from "@/components/ui/AvatarGroup" +import { Separator } from "@/components/ui/Separator" +import { Guild, Role } from "@guildxyz/types" +import { Users } from "@phosphor-icons/react/dist/ssr" +import { CardWithGuildLabel } from "./CardWithGuildLabel" + +export const ContributionCardView = ({ + guild, + role, +}: { guild: Guild; role: Role }) => { + return ( + +
+ + + + +
+
+ TOP ROLE +
+

+ {role.name} +

+
+ +

+ Only {((role.memberCount / guild.memberCount || 0) * 100).toFixed(1)}% + of members have this role +

+
+
+
+ +
+ COLLECTION: +
+ +
+
+
+ ) +} diff --git a/src/app/(marketing)/profile/_components/EditContributions.tsx b/src/app/(marketing)/profile/_components/EditContributions.tsx new file mode 100644 index 0000000000..cdd64eae56 --- /dev/null +++ b/src/app/(marketing)/profile/_components/EditContributions.tsx @@ -0,0 +1,258 @@ +"use client" + +import { Avatar, AvatarImage } from "@/components/ui/Avatar" +import { Button } from "@/components/ui/Button" +import { Card } from "@/components/ui/Card" +import { + Dialog, + DialogBody, + DialogCloseButton, + DialogContent, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/Dialog" +import { Label } from "@/components/ui/Label" +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/Select" +import { useToast } from "@/components/ui/hooks/useToast" +import { useYourGuilds } from "@/hooks/useYourGuilds" +import { Guild, MembershipResult, Role, Schemas } from "@guildxyz/types" +import { WarningCircle, X } from "@phosphor-icons/react" +import { PencilSimple } from "@phosphor-icons/react" +import { AvatarFallback } from "@radix-ui/react-avatar" +import { DialogDescription } from "@radix-ui/react-dialog" +import { useState } from "react" +import useSWRImmutable from "swr/immutable" +import { useContributions } from "../_hooks/useContributions" +import { useCreateContribution } from "../_hooks/useCreateContribution" +import { useDeleteContribution } from "../_hooks/useDeleteContribution" +import { useMemberships } from "../_hooks/useMemberships" +import { useUpdateContribution } from "../_hooks/useUpdateContribution" +import { CardWithGuildLabel } from "./CardWithGuildLabel" + +const EditContributionCard = ({ + contribution, +}: { contribution: Schemas["Contribution"] }) => { + const { data: guild } = useSWRImmutable( + `/v2/guilds/${contribution.guildId}` + ) + const memberships = useMemberships() + const editContribution = useUpdateContribution({ contributionId: contribution.id }) + const deleteContribution = useDeleteContribution({ + contributionId: contribution.id, + }) + if (!guild || !memberships.data) return + const roleIds = memberships.data.find( + (membership) => membership.guildId === guild.id + )?.roleIds + + return ( + +
+ + + +
+
+ ) +} + +export const EditContributions = () => { + const contributions = useContributions() + const memberships = useMemberships() + const [guildId, setGuildId] = useState("") + const [roleId, setRoleId] = useState("") + const { toast } = useToast() + + const { data: baseGuilds } = useYourGuilds() + const guilds = baseGuilds?.filter(({ tags }) => tags.includes("VERIFIED")) + + const roleIds = memberships.data?.find( + (membership) => membership.guildId.toString() === guildId + )?.roleIds + const createContribution = useCreateContribution() + + return ( + + + + + + + Edit top contributions + + + + +
+ {guilds?.length === 0 && ( + + +

+ You have no verified guild membership to select from +

+
+ )} + {contributions.data?.slice(0, 3).map((contribution) => ( + + ))} +
+
+

+ Add contribution +

+ +
+ + +
+
+ + +
+ +
+
+
+
+
+ ) +} + +const GuildSelectItem = ({ guildId }: Pick) => { + const { data } = useSWRImmutable(`/v2/guilds/${guildId}`) + if (!data) return + return ( + +
+ + + + + {data.name} +
+
+ ) +} + +const RoleSelectItem = ({ + roleId, + guildId, +}: Pick & { + roleId: MembershipResult["roleIds"][number] +}) => { + const { data: data } = useSWRImmutable( + `/v2/guilds/${guildId}/roles/${roleId}` + ) + if (!data) return + return ( + +
+ + + + + {data.name} +
+
+ ) +} diff --git a/src/app/(marketing)/profile/_components/EditProfile/EditProfile.tsx b/src/app/(marketing)/profile/_components/EditProfile/EditProfile.tsx new file mode 100644 index 0000000000..0a720d30df --- /dev/null +++ b/src/app/(marketing)/profile/_components/EditProfile/EditProfile.tsx @@ -0,0 +1,211 @@ +"use client" + +import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/Avatar" +import { Button } from "@/components/ui/Button" +import { + Dialog, + DialogBody, + DialogCloseButton, + DialogContent, + DialogFooter, + DialogHeader, + DialogTitle, + DialogTrigger, +} from "@/components/ui/Dialog" +import { + FormControl, + FormErrorMessage, + FormField, + FormItem, + FormLabel, +} from "@/components/ui/Form" +import { Input } from "@/components/ui/Input" +import { Separator } from "@/components/ui/Separator" +import { Textarea } from "@/components/ui/Textarea" +import { toast } from "@/components/ui/hooks/useToast" +import { useDisclosure } from "@/hooks/useDisclosure" +import { cn } from "@/lib/utils" +import { Schemas, schemas } from "@guildxyz/types" +import { zodResolver } from "@hookform/resolvers/zod" +import { User } from "@phosphor-icons/react" +import useDropzone from "hooks/useDropzone" +import usePinata from "hooks/usePinata" +import { PropsWithChildren, useState } from "react" +import { FormProvider, useForm } from "react-hook-form" +import { useDeleteProfile } from "../../_hooks/useDeleteProfile" +import { useProfile } from "../../_hooks/useProfile" +import { useUpdateProfile } from "../../_hooks/useUpdateProfile" +import { EditProfileBanner } from "./EditProfileBanner" + +export const EditProfile = ({ children }: PropsWithChildren) => { + const { data: profile } = useProfile() + const form = useForm({ + resolver: zodResolver(schemas.ProfileUpdateSchema), + defaultValues: { + ...schemas.ProfileUpdateSchema.parse(profile), + }, + mode: "onTouched", + }) + const disclosure = useDisclosure() + const editProfile = useUpdateProfile() + + async function onSubmit(values: Schemas["Profile"]) { + await editProfile.onSubmit(schemas.ProfileUpdateSchema.parse(values)) + if (editProfile.error) return + disclosure.onClose() + } + + const { isUploading, onUpload } = usePinata({ + control: form.control, + fieldToSetOnSuccess: "profileImageUrl", + onError: (error) => { + toast({ + variant: "error", + title: "Failed to upload file", + description: error, + }) + }, + }) + + const [uploadProgress, setUploadProgress] = useState(0) + const { isDragActive, getRootProps } = useDropzone({ + multiple: false, + noClick: false, + onDrop: (acceptedFiles) => { + if (!acceptedFiles[0]) return + onUpload({ + data: [acceptedFiles[0]], + onProgress: setUploadProgress, + }) + }, + onError: (error) => { + toast({ + variant: "error", + title: `Failed to upload file`, + description: error.message, + }) + }, + }) + + const deleteProfile = useDeleteProfile() + + return ( + + {children} + + + + Edit profile + + + +
+ + ( + + )} + /> +
+ + ( + + Name + + + + + + )} + /> + ( + + Username + + + + + + )} + /> + ( + + Bio + +