diff --git a/.eslintrc b/.eslintrc index 95523ba685..7dec6ac728 100644 --- a/.eslintrc +++ b/.eslintrc @@ -6,7 +6,7 @@ "extends": [ "next/core-web-vitals", "plugin:@next/next/recommended", - "plugin:prettier/recommended", + "plugin:prettier/recommended" ], "rules": { "react/no-unescaped-entities": "warn", diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..1ab1ebffa2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: BUG +labels: bug +assignees: MoeNick + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/user-story.md b/.github/ISSUE_TEMPLATE/user-story.md new file mode 100644 index 0000000000..c71cc7a053 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/user-story.md @@ -0,0 +1,22 @@ +--- +name: User Story +about: 'Smallest unit of work. It''s an end goal, expressed from the software user''s + perspective. ' +title: User Story +labels: User Story +assignees: '' + +--- + +**As a [_persona_], I [_want to_], [_so that_].** + +Breaking this down: + +"As a [persona]": Who are we building this for? We’re not just after a job title, we’re after the persona of the person. Max. Our team should have a shared understanding of who Max is. We’ve hopefully interviewed plenty of Max’s. We understand how that person works, how they think and what they feel. We have empathy for Max. +“Wants to”: Here we’re describing their intent — not the features they use. What is it they’re actually trying to achieve? This statement should be implementation free — if you’re describing any part of the UI and not what the user goal is you're missing the point. +“So that”: how does their immediate desire to do something this fit into their bigger picture? What’s the overall benefit they’re trying to achieve? What is the big problem that needs solving? + +For example, user stories might look like: +As Max, I want to invite my friends, so we can enjoy this service together. +As Sascha, I want to organize my work, so I can feel more in control. +As a manager, I want to be able to understand my colleagues progress, so I can better report our sucess and failures. diff --git a/package.json b/package.json index ae5e93c204..4af9376426 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "givethdapp", - "version": "2.1.1", + "version": "2.2.0", "private": true, "scripts": { "build": "next build", @@ -10,7 +10,9 @@ "start": "next start" }, "resolutions": { - "styled-components": "^5" + "styled-components": "^5", + "@types/react": "^18.0.15", + "@types/react-dom": "^18.0.6" }, "dependencies": { "@apollo/client": "^3.4.16", @@ -22,7 +24,7 @@ "@reduxjs/toolkit": "^1.8.1", "@sentry/nextjs": "^6.19.3", "@toruslabs/torus-embed": "^1.20.2", - "@uniswap/v3-sdk": "^3.6.2-optimism-regenesis", + "@uniswap/v3-sdk": "3.9.0", "@web3-react/core": "^6.1.9", "@web3-react/injected-connector": "^6.0.7", "@web3-react/walletconnect-connector": "^6.2.13", @@ -34,19 +36,19 @@ "framer-motion": "^6.2.8", "graphql": "^16.0.1", "human-standard-token-abi": "^2.0.0", - "lodash.debounce": "^4.0.8", "lodash.isequal": "^4.5.0", - "next": "^12.1.6", + "next": "^12.2.3", "nprogress": "^0.2.0", "quill": "^1.3.7", "quill-emoji": "^0.2.0", - "quill-image-drop-and-paste": "^1.2.10", + "quill-image-drop-and-paste": "^1.2.11", "quill-image-resize-module": "^3.0.0", - "quill-magic-url": "4.1.4", - "react": "^18.0.0", + "quill-magic-url": "^4.1.7", + "react": "^18.2.0", "react-custom-scrollbars": "^4.2.1", - "react-dom": "^18.0.0", - "react-dropzone": "^11.5.3", + "react-datepicker": "^4.8.0", + "react-dom": "^18.2.0", + "react-dropzone": "^14.2.2", "react-google-maps": "^9.4.5", "react-hook-form": "^7.32.2", "react-hot-toast": "^2.1.1", @@ -56,7 +58,7 @@ "react-redux": "^8.0.1", "react-select": "^5.2.1", "react-share": "^4.4.0", - "sharp": "^0.30.3", + "sharp": "^0.30.5", "siwe": "^1.1.6", "styled-components": "^5.3.0", "unsplash-js": "^7.0.15" @@ -64,14 +66,13 @@ "devDependencies": { "@next/bundle-analyzer": "^12.1.4", "@types/apollo-upload-client": "^14.1.0", - "@types/axios": "^0.14.0", - "@types/lodash.debounce": "^4.0.6", "@types/lodash.isequal": "^4.5.5", "@types/node": "16.11.6", "@types/nprogress": "^0.2.0", - "@types/react": "17.0.34", + "@types/react": "^18.0.15", "@types/react-custom-scrollbars": "^4.0.9", - "@types/react-dom": "^17.0.11", + "@types/react-datepicker": "^4.4.1", + "@types/react-dom": "^18.0.6", "@types/react-html-parser": "^2.0.2", "@types/react-lottie": "^1.2.6", "@types/react-modal": "^3.13.1", diff --git a/pages/project/[projectIdSlug]/index.tsx b/pages/project/[projectIdSlug]/index.tsx index 2fe181304c..a51e9a1404 100644 --- a/pages/project/[projectIdSlug]/index.tsx +++ b/pages/project/[projectIdSlug]/index.tsx @@ -1,11 +1,12 @@ +import { FC } from 'react'; import { client } from '@/apollo/apolloClient'; import { FETCH_PROJECT_BY_SLUG } from '@/apollo/gql/gqlProjects'; -import { IProject } from '@/apollo/types/types'; import ProjectIndex from '@/components/views/project/ProjectIndex'; +import { IProjectBySlug } from '@/apollo/types/gqlTypes'; -const ProjectRoute = (props: { project?: IProject }) => { - return ; +const ProjectRoute: FC = ({ project }) => { + return ; }; export async function getServerSideProps(props: { diff --git a/pages/user/[address].tsx b/pages/user/[address].tsx index 175d2561ee..8bde19e5fa 100644 --- a/pages/user/[address].tsx +++ b/pages/user/[address].tsx @@ -1,8 +1,5 @@ import { GetServerSideProps } from 'next'; import { FC } from 'react'; -import styled from 'styled-components'; -import { H3 } from '@giveth/ui-design-system'; -import { Container } from '@/components/Grid'; import { client } from '@/apollo/apolloClient'; import { GET_USER_BY_ADDRESS } from '@/apollo/gql/gqlUser'; @@ -10,18 +7,16 @@ import { IUser } from '@/apollo/types/types'; import UserPublicProfileView from '@/components/views/userPublicProfile/UserPublicProfile.view'; import { GeneralMetatags } from '@/components/Metatag'; import { transformGraphQLErrorsToStatusCode } from '@/helpers/requests'; +import ErrorsIndex from '@/components/views/Errors/ErrorsIndex'; interface IUserRouteProps { user?: IUser; } const UserRoute: FC = ({ user }) => { + // When user is not found, GQL doesn't return any error. After backend is fixed, this can be deleted. if (!user) { - return ( - - User not found - - ); + return ; } return ( @@ -42,10 +37,6 @@ const UserRoute: FC = ({ user }) => { ); }; -const NotFound = styled(H3)` - margin: 200px 0; -`; - export const getServerSideProps: GetServerSideProps = async context => { try { const { query } = context; diff --git a/pages/verification/[slug]/[token].tsx b/pages/verification/[slug]/[token].tsx new file mode 100644 index 0000000000..149ba10299 --- /dev/null +++ b/pages/verification/[slug]/[token].tsx @@ -0,0 +1,15 @@ +import React, { useEffect } from 'react'; + +import { setShowFooter } from '@/features/general/general.slice'; +import EmailVerificationIndex from '@/components/views/verification/EmailVerificationIndex'; +import { useAppDispatch } from '@/features/hooks'; + +export default function Token() { + const dispatch = useAppDispatch(); + + useEffect(() => { + dispatch(setShowFooter(false)); + }, []); + + return ; +} diff --git a/pages/verification/[slug]/index.tsx b/pages/verification/[slug]/index.tsx new file mode 100644 index 0000000000..6d434b8f1b --- /dev/null +++ b/pages/verification/[slug]/index.tsx @@ -0,0 +1,25 @@ +import Head from 'next/head'; +import { useEffect } from 'react'; +import VerificationIndex from '@/components/views/verification/VerificationIndex'; +import { setShowFooter } from '@/features/general/general.slice'; +import { VerificationProvider } from '@/context/verification.context'; +import { useAppDispatch } from '@/features/hooks'; + +const VerificationRoute = () => { + const dispatch = useAppDispatch(); + + useEffect(() => { + dispatch(setShowFooter(false)); + }, []); + + return ( + + + Verify a Project | Giveth + + + + ); +}; + +export default VerificationRoute; diff --git a/public/images/$nice.svg b/public/images/$nice.svg index 53016d47c7..38c94102d1 100644 --- a/public/images/$nice.svg +++ b/public/images/$nice.svg @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/public/images/backgrounds/Verification_GIV.svg b/public/images/backgrounds/Verification_GIV.svg new file mode 100644 index 0000000000..3a5a73ff89 --- /dev/null +++ b/public/images/backgrounds/Verification_GIV.svg @@ -0,0 +1,100 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/images/backgrounds/email-verification-bg-colored.svg b/public/images/backgrounds/email-verification-bg-colored.svg new file mode 100644 index 0000000000..5460fb6a21 --- /dev/null +++ b/public/images/backgrounds/email-verification-bg-colored.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/public/images/backgrounds/email-verification-bg-dark.svg b/public/images/backgrounds/email-verification-bg-dark.svg new file mode 100644 index 0000000000..7e2693bb2c --- /dev/null +++ b/public/images/backgrounds/email-verification-bg-dark.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/public/images/icons/bullet_icon.svg b/public/images/bullets/bullet_orange.svg similarity index 100% rename from public/images/icons/bullet_icon.svg rename to public/images/bullets/bullet_orange.svg diff --git a/public/images/bullet_tiny.svg b/public/images/bullets/bullet_purple.svg similarity index 100% rename from public/images/bullet_tiny.svg rename to public/images/bullets/bullet_purple.svg diff --git a/public/images/checkmark-2.svg b/public/images/checkmark-2.svg deleted file mode 100644 index 3550bdc8e2..0000000000 --- a/public/images/checkmark-2.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/public/images/extensions/adobe-illustrator.png b/public/images/extensions/adobe-illustrator.png new file mode 100644 index 0000000000..3128438ccf Binary files /dev/null and b/public/images/extensions/adobe-illustrator.png differ diff --git a/public/images/extensions/apk.png b/public/images/extensions/apk.png new file mode 100644 index 0000000000..b8bc8cb498 Binary files /dev/null and b/public/images/extensions/apk.png differ diff --git a/public/images/extensions/disc.png b/public/images/extensions/disc.png new file mode 100644 index 0000000000..c0e121d3f2 Binary files /dev/null and b/public/images/extensions/disc.png differ diff --git a/public/images/extensions/doc.png b/public/images/extensions/doc.png new file mode 100644 index 0000000000..39dcfe4a1e Binary files /dev/null and b/public/images/extensions/doc.png differ diff --git a/public/images/extensions/docx.png b/public/images/extensions/docx.png new file mode 100644 index 0000000000..def0879780 Binary files /dev/null and b/public/images/extensions/docx.png differ diff --git a/public/images/extensions/excel.png b/public/images/extensions/excel.png new file mode 100644 index 0000000000..470e1be525 Binary files /dev/null and b/public/images/extensions/excel.png differ diff --git a/public/images/extensions/image.png b/public/images/extensions/image.png new file mode 100644 index 0000000000..9f475918bb Binary files /dev/null and b/public/images/extensions/image.png differ diff --git a/public/images/extensions/js.png b/public/images/extensions/js.png new file mode 100644 index 0000000000..9d53b6913e Binary files /dev/null and b/public/images/extensions/js.png differ diff --git a/public/images/extensions/mail-1.png b/public/images/extensions/mail-1.png new file mode 100644 index 0000000000..af820b9754 Binary files /dev/null and b/public/images/extensions/mail-1.png differ diff --git a/public/images/extensions/mail.png b/public/images/extensions/mail.png new file mode 100644 index 0000000000..5a1085dcd9 Binary files /dev/null and b/public/images/extensions/mail.png differ diff --git a/public/images/extensions/music.png b/public/images/extensions/music.png new file mode 100644 index 0000000000..e882781781 Binary files /dev/null and b/public/images/extensions/music.png differ diff --git a/public/images/extensions/pdf.png b/public/images/extensions/pdf.png new file mode 100644 index 0000000000..0f12ae535a Binary files /dev/null and b/public/images/extensions/pdf.png differ diff --git a/public/images/extensions/php.png b/public/images/extensions/php.png new file mode 100644 index 0000000000..0ed64c3f9a Binary files /dev/null and b/public/images/extensions/php.png differ diff --git a/public/images/extensions/ppt.png b/public/images/extensions/ppt.png new file mode 100644 index 0000000000..89a4610d1a Binary files /dev/null and b/public/images/extensions/ppt.png differ diff --git a/public/images/extensions/pptx.png b/public/images/extensions/pptx.png new file mode 100644 index 0000000000..a7f408aaa1 Binary files /dev/null and b/public/images/extensions/pptx.png differ diff --git a/public/images/extensions/psd.png b/public/images/extensions/psd.png new file mode 100644 index 0000000000..10f606b01e Binary files /dev/null and b/public/images/extensions/psd.png differ diff --git a/public/images/extensions/record.png b/public/images/extensions/record.png new file mode 100644 index 0000000000..48e398e7bd Binary files /dev/null and b/public/images/extensions/record.png differ diff --git a/public/images/extensions/svg.png b/public/images/extensions/svg.png new file mode 100644 index 0000000000..77bbdb30b8 Binary files /dev/null and b/public/images/extensions/svg.png differ diff --git a/public/images/extensions/text.png b/public/images/extensions/text.png new file mode 100644 index 0000000000..cc73aae8d4 Binary files /dev/null and b/public/images/extensions/text.png differ diff --git a/public/images/extensions/ttf.png b/public/images/extensions/ttf.png new file mode 100644 index 0000000000..454e2c8743 Binary files /dev/null and b/public/images/extensions/ttf.png differ diff --git a/public/images/extensions/txt.png b/public/images/extensions/txt.png new file mode 100644 index 0000000000..2c40bf3e88 Binary files /dev/null and b/public/images/extensions/txt.png differ diff --git a/public/images/extensions/unknown.png b/public/images/extensions/unknown.png new file mode 100644 index 0000000000..0ed64c3f9a Binary files /dev/null and b/public/images/extensions/unknown.png differ diff --git a/public/images/extensions/vector.png b/public/images/extensions/vector.png new file mode 100644 index 0000000000..6eef151406 Binary files /dev/null and b/public/images/extensions/vector.png differ diff --git a/public/images/extensions/video (1).png b/public/images/extensions/video (1).png new file mode 100644 index 0000000000..91234b36b6 Binary files /dev/null and b/public/images/extensions/video (1).png differ diff --git a/public/images/extensions/video.png b/public/images/extensions/video.png new file mode 100644 index 0000000000..be7eb53a21 Binary files /dev/null and b/public/images/extensions/video.png differ diff --git a/public/images/extensions/xls.png b/public/images/extensions/xls.png new file mode 100644 index 0000000000..c16aec019a Binary files /dev/null and b/public/images/extensions/xls.png differ diff --git a/public/images/extensions/zip.png b/public/images/extensions/zip.png new file mode 100644 index 0000000000..4553177507 Binary files /dev/null and b/public/images/extensions/zip.png differ diff --git a/public/images/icons/archive.svg b/public/images/icons/archive.svg deleted file mode 100644 index 20be073735..0000000000 --- a/public/images/icons/archive.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/public/images/icons/archive_deep.svg b/public/images/icons/archive_deep.svg deleted file mode 100644 index 7abce8525e..0000000000 --- a/public/images/icons/archive_deep.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/public/images/icons/check_stars.svg b/public/images/icons/check_stars.svg new file mode 100644 index 0000000000..9601faf194 --- /dev/null +++ b/public/images/icons/check_stars.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/public/images/icons/donate.svg b/public/images/icons/donate.svg deleted file mode 100644 index 67d9f5cc71..0000000000 --- a/public/images/icons/donate.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/public/images/icons/failed_stars.svg b/public/images/icons/failed_stars.svg new file mode 100644 index 0000000000..1796beebaa --- /dev/null +++ b/public/images/icons/failed_stars.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/public/images/icons/social/discord.svg b/public/images/icons/social/discord.svg new file mode 100644 index 0000000000..133af28c16 --- /dev/null +++ b/public/images/icons/social/discord.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/images/icons/social/facebook.svg b/public/images/icons/social/facebook.svg new file mode 100644 index 0000000000..4be5fdad72 --- /dev/null +++ b/public/images/icons/social/facebook.svg @@ -0,0 +1,3 @@ + + + diff --git a/public/images/icons/social/instagram.svg b/public/images/icons/social/instagram.svg new file mode 100644 index 0000000000..3287f8ef46 --- /dev/null +++ b/public/images/icons/social/instagram.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/images/icons/social/linkedin.svg b/public/images/icons/social/linkedin.svg new file mode 100644 index 0000000000..319fdbbfa8 --- /dev/null +++ b/public/images/icons/social/linkedin.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/images/icons/social/youtube.svg b/public/images/icons/social/youtube.svg new file mode 100644 index 0000000000..453c6b8e72 --- /dev/null +++ b/public/images/icons/social/youtube.svg @@ -0,0 +1,4 @@ + + + + diff --git a/public/images/icons/warning_filled.svg b/public/images/icons/warning_filled.svg deleted file mode 100644 index e389869a99..0000000000 --- a/public/images/icons/warning_filled.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/public/images/menu/drawer_menu_black.svg b/public/images/menu/drawer_menu_black.svg new file mode 100644 index 0000000000..6019ec24b8 --- /dev/null +++ b/public/images/menu/drawer_menu_black.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/public/images/drawer_menu_purple.svg b/public/images/menu/drawer_menu_purple.svg similarity index 100% rename from public/images/drawer_menu_purple.svg rename to public/images/menu/drawer_menu_purple.svg diff --git a/public/images/drawer_menu_white.svg b/public/images/menu/drawer_menu_white.svg similarity index 100% rename from public/images/drawer_menu_white.svg rename to public/images/menu/drawer_menu_white.svg diff --git a/public/images/spark.svg b/public/images/spark.svg index 732a92df74..433c9cdd60 100644 --- a/public/images/spark.svg +++ b/public/images/spark.svg @@ -2,4 +2,4 @@ - \ No newline at end of file + diff --git a/src/animations/loading_giv.json b/src/animations/loading_giv.json new file mode 100644 index 0000000000..093eada007 --- /dev/null +++ b/src/animations/loading_giv.json @@ -0,0 +1,302 @@ +{ + "v": "5.5.5", + "fr": 25, + "ip": 0, + "op": 75, + "w": 300, + "h": 150, + "nm": "Loading-2", + "ddd": 0, + "assets": [], + "layers": [ + { + "ddd": 0, + "ind": 1, + "ty": 4, + "nm": "icon 2", + "sr": 1, + "ks": { + "o": { "a": 0, "k": 100, "ix": 11 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "t": 39, + "s": [-90] + }, + { "t": 79, "s": [270] } + ], + "ix": 10 + }, + "p": { "a": 0, "k": [150, 75, 0], "ix": 2 }, + "a": { "a": 0, "k": [53, 53, 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, -15.464], + [15.464, 0], + [0, 15.464], + [-15.464, 0] + ], + "o": [ + [0, 15.464], + [-15.464, 0], + [0, -15.464], + [15.464, 0] + ], + "v": [ + [28, 0], + [0, 28], + [-28, 0], + [0, -28] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [ + 0.3254901960784314, 0.14901960784313725, + 0.9254901960784314, 1 + ], + "ix": 3 + }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 10, "ix": 5 }, + "lc": 2, + "lj": 1, + "ml": 10, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [53, 53], "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": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "t": 51, + "s": [0] + }, + { "t": 79, "s": [100] } + ], + "ix": 1 + }, + "e": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "t": 39, + "s": [0] + }, + { "t": 64, "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": 39, + "op": 79, + "st": 39, + "bm": 0 + }, + { + "ddd": 0, + "ind": 2, + "ty": 4, + "nm": "icon", + "sr": 1, + "ks": { + "o": { "a": 0, "k": 100, "ix": 11 }, + "r": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "t": 0, + "s": [-90] + }, + { "t": 40, "s": [270] } + ], + "ix": 10 + }, + "p": { "a": 0, "k": [150, 75, 0], "ix": 2 }, + "a": { "a": 0, "k": [53, 53, 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, -15.464], + [15.464, 0], + [0, 15.464], + [-15.464, 0] + ], + "o": [ + [0, 15.464], + [-15.464, 0], + [0, -15.464], + [15.464, 0] + ], + "v": [ + [28, 0], + [0, 28], + [-28, 0], + [0, -28] + ], + "c": true + }, + "ix": 2 + }, + "nm": "Path 1", + "mn": "ADBE Vector Shape - Group", + "hd": false + }, + { + "ty": "st", + "c": { + "a": 0, + "k": [ + 0.3254901960784314, 0.14901960784313725, + 0.9254901960784314, 1 + ], + "ix": 3 + }, + "o": { "a": 0, "k": 100, "ix": 4 }, + "w": { "a": 0, "k": 10, "ix": 5 }, + "lc": 2, + "lj": 1, + "ml": 10, + "bm": 0, + "nm": "Stroke 1", + "mn": "ADBE Vector Graphic - Stroke", + "hd": false + }, + { + "ty": "tr", + "p": { "a": 0, "k": [53, 53], "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": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "t": 12, + "s": [0] + }, + { "t": 40, "s": [100] } + ], + "ix": 1 + }, + "e": { + "a": 1, + "k": [ + { + "i": { "x": [0.667], "y": [1] }, + "o": { "x": [0.333], "y": [0] }, + "t": 0, + "s": [0] + }, + { "t": 25, "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": 40, + "st": 0, + "bm": 0 + } + ], + "markers": [] +} diff --git a/src/animations/loading_giv_600.json b/src/animations/loading_giv_600.json new file mode 100644 index 0000000000..203e98863a --- /dev/null +++ b/src/animations/loading_giv_600.json @@ -0,0 +1 @@ +{"v":"5.5.5","fr":25,"ip":0,"op":75,"w":300,"h":150,"nm":"Loading-2","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"icon 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":39,"s":[-90]},{"t":79,"s":[270]}],"ix":10},"p":{"a":0,"k":[150,75,0],"ix":2},"a":{"a":0,"k":[53,53,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,-15.464],[15.464,0],[0,15.464],[-15.464,0]],"o":[[0,15.464],[-15.464,0],[0,-15.464],[15.464,0]],"v":[[28,0],[0,28],[-28,0],[0,-28]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.2196078431372549,0.06666666666666667,0.7490196078431373,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":2,"lj":1,"ml":10,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[53,53],"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":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":51,"s":[0]},{"t":79,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":39,"s":[0]},{"t":64,"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":39,"op":79,"st":39,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"icon","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[-90]},{"t":40,"s":[270]}],"ix":10},"p":{"a":0,"k":[150,75,0],"ix":2},"a":{"a":0,"k":[53,53,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,-15.464],[15.464,0],[0,15.464],[-15.464,0]],"o":[[0,15.464],[-15.464,0],[0,-15.464],[15.464,0]],"v":[[28,0],[0,28],[-28,0],[0,-28]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.2196078431372549,0.06666666666666667,0.7490196078431373,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":10,"ix":5},"lc":2,"lj":1,"ml":10,"bm":0,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[53,53],"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":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":12,"s":[0]},{"t":40,"s":[100]}],"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"t":0,"s":[0]},{"t":25,"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":40,"st":0,"bm":0}],"markers":[]} \ No newline at end of file diff --git a/src/apollo/apolloClient.ts b/src/apollo/apolloClient.ts index 1ba45b5ef9..7460be9609 100644 --- a/src/apollo/apolloClient.ts +++ b/src/apollo/apolloClient.ts @@ -76,7 +76,9 @@ function createApolloClient() { return new ApolloClient({ ssrMode, link: errorLink.concat(authLink.concat(httpLink)), - cache: new InMemoryCache(), + cache: new InMemoryCache({ + addTypename: false, + }), defaultOptions: { watchQuery: { fetchPolicy: 'cache-and-network', diff --git a/src/apollo/gql/gqlProjects.ts b/src/apollo/gql/gqlProjects.ts index 55e6ce61eb..76346c6aed 100644 --- a/src/apollo/gql/gqlProjects.ts +++ b/src/apollo/gql/gqlProjects.ts @@ -138,6 +138,9 @@ export const FETCH_PROJECT_BY_SLUG = gql` label supportCustomTokens } + projectVerificationForm { + status + } } } `; diff --git a/src/apollo/gql/gqlUser.ts b/src/apollo/gql/gqlUser.ts index 64782f06d1..f64e7b24ae 100644 --- a/src/apollo/gql/gqlUser.ts +++ b/src/apollo/gql/gqlUser.ts @@ -58,6 +58,9 @@ export const FETCH_USER_PROJECTS = gql` name } qualityScore + projectVerificationForm { + status + } } totalCount } diff --git a/src/apollo/gql/gqlVerification.ts b/src/apollo/gql/gqlVerification.ts new file mode 100644 index 0000000000..2d0d1569fe --- /dev/null +++ b/src/apollo/gql/gqlVerification.ts @@ -0,0 +1,232 @@ +import { gql } from '@apollo/client'; + +const gqlRes = `{ + id + isTermAndConditionsAccepted + email + emailConfirmationToken + emailConfirmationSent + emailConfirmationSentAt + emailConfirmedAt + emailConfirmed + emailConfirmationTokenExpiredAt + projectRegistry { + organizationDescription + isNonProfitOrganization + organizationCountry + organizationWebsite + organizationName + attachments + } + personalInfo { + email + walletAddress + fullName + } + projectContacts { + name + url + } + socialProfiles { + socialNetworkId + name + socialNetwork + isVerified + id + } + milestones { + mission + foundationDate + achievedMilestones + achievedMilestonesProofs + } + managingFunds { + description + relatedAddresses { + address + networkId + title + } + } + user { + id + walletAddress + firstName + lastName + email + } + project { + id + slug + title + } + status + lastStep +}`; + +export const GET_CURRENT_PROJECT_VERIFICATION_FORM = ` +query getCurrentProjectVerificationForm($projectId: Float!){ + getCurrentProjectVerificationForm(projectId: $projectId) { + id + isTermAndConditionsAccepted + email + emailConfirmationToken + emailConfirmationSent + emailConfirmationSentAt + emailConfirmedAt + emailConfirmed + projectRegistry { + organizationDescription + isNonProfitOrganization + organizationCountry + organizationWebsite + } + projectContacts { + name + url + } + milestones { + mission + foundationDate + achievedMilestones + achievedMilestonesProofs + } + managingFunds { + description + relatedAddresses { + address + networkId + title + } + } + user { + id + walletAddress + } + project { + id + slug + } + status + lastStep + } + } +`; + +export const FETCH_PROJECT_BY_SLUG = ` + query ProjectBySlug($slug: String!, $connectedWalletUserId: Int) { + projectBySlug( + slug: $slug + connectedWalletUserId: $connectedWalletUserId + ) { + id + title + image + slug + description + verified + traceCampaignId + walletAddress + totalProjectUpdates + totalDonations + totalTraceDonations + creationDate + reaction { + id + userId + } + totalReactions + traceCampaignId + categories { + name + } + adminUser { + id + name + walletAddress + } + status { + id + name + } + organization { + name + label + supportCustomTokens + } + } + } +`; + +export const CREATE_PROJECT_VERIFICATION = gql` + mutation createProjectVerificationForm($slug: String!) { + createProjectVerificationForm(slug: $slug) + ${gqlRes} + + } +`; + +export const FETCH_PROJECT_VERIFICATION = gql` + query getCurrentProjectVerificationForm($slug: String!) { + getCurrentProjectVerificationForm(slug: $slug) + ${gqlRes} + } +`; + +export const UPDATE_PROJECT_VERIFICATION = gql` + mutation updateProjectVerificationForm( + $projectVerificationUpdateInput: ProjectVerificationUpdateInput! + ) { + updateProjectVerificationForm( + projectVerificationUpdateInput: $projectVerificationUpdateInput + ) + ${gqlRes} + } +`; + +export const SEND_EMAIL_VERIFICATION = gql` + mutation projectVerificationSendEmailConfirmation( + $projectVerificationFormId: Float! + ) { + projectVerificationSendEmailConfirmation( + projectVerificationFormId: $projectVerificationFormId + ) + ${gqlRes} + } +`; + +export const SEND_EMAIL_VERIFICATION_TOKEN = gql` + mutation projectVerificationConfirmEmail($emailConfirmationToken: String!) { + projectVerificationConfirmEmail( + emailConfirmationToken: $emailConfirmationToken + ) + ${gqlRes} + } +`; + +export const SEND_NEW_SOCIAL_MEDIA = gql` + mutation addNewSocialProfile( + $projectVerificationId: Int! + $socialNetwork: String! + ) { + addNewSocialProfile( + projectVerificationId: $projectVerificationId + socialNetwork: $socialNetwork + ) + } +`; + +export const REMOVE_SOCIAL_MEDIA = gql` + mutation removeSocialProfile($socialProfileId: Int!) { + removeSocialProfile(socialProfileId: $socialProfileId) + } +`; + +export const FETCH_ALLOWED_COUNTRIES = gql` + query { + getAllowedCountries { + name + code + } + } +`; diff --git a/src/apollo/types/gqlTypes.ts b/src/apollo/types/gqlTypes.ts index 51126b6da6..8d1b784506 100644 --- a/src/apollo/types/gqlTypes.ts +++ b/src/apollo/types/gqlTypes.ts @@ -13,7 +13,7 @@ export interface IFetchAllProjects { } export interface IProjectBySlug { - project: IProject; + project?: IProject; } export interface IFetchProjectUpdates { diff --git a/src/apollo/types/types.ts b/src/apollo/types/types.ts index 2ebc39547d..750f424f46 100644 --- a/src/apollo/types/types.ts +++ b/src/apollo/types/types.ts @@ -3,6 +3,7 @@ import { EDonationType, EProjectStatus, } from '@/apollo/types/gqlEnums'; +import { IAddress } from '@/components/views/verification/manageFunds/ManageFundsIndex'; export interface IProject { id?: string; @@ -13,7 +14,6 @@ export interface IProject { creationDate?: string; admin?: string; description?: string; - walletAddress?: string; addresses?: IWalletAddress[]; impactLocation?: string; qualityScore?: number; @@ -46,6 +46,7 @@ export interface IProject { label: string; supportCustomTokens: boolean; }; + projectVerificationForm?: IProjectVerification; } export interface IWalletAddress { @@ -59,7 +60,6 @@ export interface IProjectEdition { title?: string; image?: string; description?: string; - walletAddress?: string; addresses?: IWalletAddress[]; impactLocation?: string; categories: ICategory[]; @@ -167,3 +167,85 @@ export interface ISiweMessage { nonce: string; message: string; } + +export interface IProjectRegistry { + isNonProfitOrganization?: boolean; + organizationCountry?: string; + organizationWebsite?: string; + organizationDescription?: string; + organizationName?: string; + attachments?: string[]; +} + +export interface IProjectContact { + name: string; + url: string; +} + +export interface IProjectMilestones { + foundationDate?: string; + mission?: string; + achievedMilestones?: string; + achievedMilestonesProofs?: string[]; +} + +export interface IProjectManagingFunds { + description: string; + relatedAddresses: IAddress[]; +} + +export interface ISocialProfile { + id: string; + isVerified: boolean; + socialNetwork: string; + socialNetworkId: string; + name: string; +} + +export interface IProjectVerification { + id: string; + isTermAndConditionsAccepted: boolean; + emailConfirmationToken?: string; + emailConfirmationSent?: boolean; + emailConfirmationSentAt?: string; + emailConfirmedAt?: string; + emailConfirmed?: boolean; + email?: string; + projectRegistry?: IProjectRegistry; + projectContacts?: IProjectContact[]; + milestones?: IProjectMilestones; + managingFunds?: IProjectManagingFunds; + emailConfirmationTokenExpiredAt?: string; + user: IUser; + project: IProject; + socialProfiles?: ISocialProfile[]; + status: EVerificationStatus; + lastStep: EVerificationSteps; +} + +export enum EVerificationStatus { + VERIFIED = 'verified', + DRAFT = 'draft', + SUBMITTED = 'submitted', + REJECTED = 'rejected', +} + +export interface IProjectVerificationUpdateInput { + step: EVerificationSteps; + projectVerificationId: number; + projectRegistry?: IProjectRegistry; + projectContacts?: IProjectContact[]; + milestones?: IProjectMilestones; + managingFunds?: IProjectManagingFunds; + isTermAndConditionsAccepted?: boolean; +} + +export enum EVerificationSteps { + PERSONAL_INFO = 'personalInfo', + PROJECT_REGISTRY = 'projectRegistry', + PROJECT_CONTACTS = 'projectContacts', + MANAGING_FUNDS = 'managingFunds', + MILESTONES = 'milestones', + TERM_AND_CONDITION = 'termAndCondition', + SUBMIT = 'submit', +} diff --git a/src/components/AmountInput.tsx b/src/components/AmountInput.tsx index 0182bde01e..1f01eb25d1 100644 --- a/src/components/AmountInput.tsx +++ b/src/components/AmountInput.tsx @@ -36,7 +36,7 @@ export const AmountInput: FC = ({ [maxAmount], ); - const onUserInput = useCallback(value => { + const onUserInput = useCallback((value: string) => { setDisplayAmount(value); setActiveStep(0); let valueBn = BigNumber.from(0); diff --git a/src/components/Checkbox.tsx b/src/components/Checkbox.tsx index 0209d1236e..d6b98a0bf7 100644 --- a/src/components/Checkbox.tsx +++ b/src/components/Checkbox.tsx @@ -1,57 +1,51 @@ -import { P, neutralColors } from '@giveth/ui-design-system'; +import { + brandColors, + IconCheck, + neutralColors, +} from '@giveth/ui-design-system'; import styled from 'styled-components'; - -interface ICheckBox { - checked?: boolean | undefined; -} +import { FlexCenter } from '@/components/styled-components/Flex'; const CheckBox = (props: { - onChange: (e: any) => void; - value?: any; + onChange: (e: boolean) => void; title: string; - checked: boolean | undefined; - style?: any; + checked?: boolean; + disabled?: boolean; }) => { - const { onChange, checked, title, style } = props; + const { onChange, checked, title, disabled } = props; return ( onChange(!checked)} + onClick={() => !disabled && onChange(!checked)} + disabled={disabled} checked={checked} - style={style} > - {checked ? ( - checkmark - ) : ( - - )} -

{title}

+ + {checked && } + +
{title}
); }; -const Wrapper = styled.div` +const Wrapper = styled.div<{ disabled?: boolean; checked?: boolean }>` cursor: pointer; display: flex; align-items: center; gap: 12px; - color: ${(props: any) => - props.checked ? neutralColors.gray[900] : neutralColors.gray[700]}; - img { + color: ${props => + props.disabled ? neutralColors.gray[600] : neutralColors.gray[900]}; + > div:first-child { border: 2px solid - ${(props: any) => - props.checked - ? neutralColors.gray[900] - : neutralColors.gray[400]}; + ${props => + props.disabled + ? neutralColors.gray[400] + : neutralColors.gray[900]}; border-radius: 4px; - padding: 8px 8px 8px 6.67px; - width: 28px; - } - span { + width: 20px; + height: 20px; flex-shrink: 0; - width: 28px; - height: 28px; - border-radius: 4px; - border: 2px solid ${neutralColors.gray[400]}; + background: ${props => + props.checked ? brandColors.deep[900] : 'white'}; } `; diff --git a/src/components/DescriptionInput.tsx b/src/components/DescriptionInput.tsx new file mode 100644 index 0000000000..366e958812 --- /dev/null +++ b/src/components/DescriptionInput.tsx @@ -0,0 +1,67 @@ +import { FC, InputHTMLAttributes } from 'react'; +import { FieldError, RegisterOptions, UseFormRegister } from 'react-hook-form'; +import styled from 'styled-components'; +import { GLink, neutralColors, semanticColors } from '@giveth/ui-design-system'; +import { TextArea } from './styled-components/TextArea'; +import { EInputValidation, IInputValidation } from '@/types/inputValidation'; + +interface IInputWithRegister extends InputHTMLAttributes { + register: UseFormRegister; + registerName: string; + registerOptions?: RegisterOptions; + error?: FieldError; +} + +type InputType = + | IInputWithRegister + | ({ + registerName?: never; + register?: never; + registerOptions?: never; + error?: never; + } & IInputWithRegister); + +const DescriptionInput: FC = ({ + register = () => {}, + registerName = '', + registerOptions = { required: false }, + error, + ...rest +}) => { + const validationStatus = error + ? EInputValidation.ERROR + : EInputValidation.NORMAL; + + return ( + <> +