diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..c2e059e --- /dev/null +++ b/.env.example @@ -0,0 +1,17 @@ +VITE_NODE_ENV=development +VITE_APP_BASE_URL=http://localhost:3001 +VITE_APP_URL=http://localhost:5173 +VITE_APP_NETWORK=sepolia +VITE_APP_BLOCK_EXPLORER=https://sepolia.arbiscan.io/ + +# WalletConnect and RainbowKit Project ID +VITE_APP_RAINBOW_PROJECT_ID= +VITE_APP_WALLETCONNECT_PROJECT_ID= + +# Contract Factory Addresses +VITE_APP_TEAM_POINTS_FACTORY_ADDRESS= +VITE_APP_TEAM_POINTS_FACTORY_ADDRESS_CELO= + +# RPC URLs for different networks +VITE_APP_ARBITRUM_SEPOLIA_RPC= +VITE_APP_CELO_ALFAJORES_RPC= \ No newline at end of file diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000..90668f2 --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,30 @@ +module.exports = { + root: true, + env: { browser: true, es2020: true }, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:react-hooks/recommended', + 'plugin:react/recommended', + 'plugin:tailwindcss/recommended', + 'prettier', + ], + ignorePatterns: ['dist', '.eslintrc.cjs'], + parser: '@typescript-eslint/parser', + plugins: ['react-refresh'], + rules: { + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + 'react/prop-types': 'off', + 'react/react-in-jsx-scope': 'off', + 'tailwindcss/classnames-order': 'warn', + 'tailwindcss/enforces-shorthand': 'off', + }, + settings: { + react: { + version: 'detect', + }, + }, +}; \ No newline at end of file diff --git a/.gitignore b/.gitignore index cfc8373..ffeb6a1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,10 @@ +// ... existing code ... +# misc +.DS_Store +.env +npm-debug.log +.trae/ + # See http://help.github.com/ignore-files/ for more about ignoring files. # dependencies @@ -12,4 +19,5 @@ # misc .DS_Store .env -npm-debug.log \ No newline at end of file +npm-debug.log +.trae/ \ No newline at end of file diff --git a/docker-compose.ci-demo-01.yml b/docker-compose.ci-demo-01.yml index c3b4f19..85dc77c 100644 --- a/docker-compose.ci-demo-01.yml +++ b/docker-compose.ci-demo-01.yml @@ -16,18 +16,10 @@ services: build: context: . dockerfile: Dockerfile - args: - - VITE_APP_BASE_URL=https://beta-api.collabberry.xyz - - VITE_APP_TEAM_POINTS_FACTORY_ADDRESS=0x86207Ce1202766041F414C47134A8b0A1607d899 - - VITE_NODE_ENV=production - - VITE_APP_URL=https://beta.collabberry.xyz - - VITE_APP_NETWORK=Arbitrum - - VITE_APP_BLOCK_EXPLORER=https://arbiscan.io/tx - - VITE_APP_TEAM_POINTS_FACTORY_ADDRESS_CELO=0x0e414560fdEeC039c4636b9392176ddc938b182D - - + env_file: + - .env image: collabberry/frontend-app-demo-01:latest networks: collabberry-frontend: - driver: bridge + driver: bridge \ No newline at end of file diff --git a/docker-compose.ci-dev.yml b/docker-compose.ci-dev.yml index 8c6a9e5..14496db 100644 --- a/docker-compose.ci-dev.yml +++ b/docker-compose.ci-dev.yml @@ -16,16 +16,10 @@ services: build: context: . dockerfile: Dockerfile - args: - - VITE_APP_BASE_URL=https://api.collabberry.xyz - - VITE_APP_TEAM_POINTS_FACTORY_ADDRESS=0x69a99AeAc1F2410e82A84E08268b336116Ab3B5a - - VITE_NODE_ENV=development - - VITE_APP_URL=https://app.collabberry.xyz - - VITE_APP_NETWORK=Arbitrum Sepolia - - VITE_APP_BLOCK_EXPLORER=https://sepolia.arbiscan.io/tx - - VITE_APP_TEAM_POINTS_FACTORY_ADDRESS_CELO=0x0e414560fdEeC039c4636b9392176ddc938b182D + env_file: + - .env image: collabberry/frontend-app:latest networks: collabberry-frontend: - driver: bridge + driver: bridge \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index e763082..8fa5ee9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -16,17 +16,11 @@ services: build: context: . dockerfile: Dockerfile - args: - - VITE_APP_BASE_URL=http://16.171.142.20 - - VITE_APP_TEAM_POINTS_FACTORY_ADDRESS=0x69a99AeAc1F2410e82A84E08268b336116Ab3B5a - - VITE_NODE_ENV=development - - VITE_APP_URL=https://app.collabberry.xyz - - VITE_APP_NETWORK=Arbitrum Sepolia - - VITE_APP_BLOCK_EXPLORER=https://sepolia.arbiscan.io/tx - - VITE_APP_TEAM_POINTS_FACTORY_ADDRESS_CELO=0x0e414560fdEeC039c4636b9392176ddc938b182D + env_file: + - .env ports: - 4100:4100 networks: collabberry-frontend: - driver: bridge + driver: bridge \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ce2e149..18b42f1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -96,6 +96,7 @@ "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.1", + "eslint-plugin-tailwindcss": "^3.18.2", "postcss": "^8.4.21", "postcss-cli": "^11.0.0", "postcss-nesting": "^12.0.2", @@ -12058,6 +12059,23 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-tailwindcss": { + "version": "3.18.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-tailwindcss/-/eslint-plugin-tailwindcss-3.18.2.tgz", + "integrity": "sha512-QbkMLDC/OkkjFQ1iz/5jkMdHfiMu/uwujUHLAJK5iwNHD8RTxVTlsUezE0toTZ6VhybNBsk+gYGPDq2agfeRNA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-glob": "^3.2.5", + "postcss": "^8.4.4" + }, + "engines": { + "node": ">=18.12.0" + }, + "peerDependencies": { + "tailwindcss": "^3.4.0" + } + }, "node_modules/eslint-visitor-keys": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", @@ -32823,6 +32841,16 @@ "dev": true, "requires": {} }, + "eslint-plugin-tailwindcss": { + "version": "3.18.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-tailwindcss/-/eslint-plugin-tailwindcss-3.18.2.tgz", + "integrity": "sha512-QbkMLDC/OkkjFQ1iz/5jkMdHfiMu/uwujUHLAJK5iwNHD8RTxVTlsUezE0toTZ6VhybNBsk+gYGPDq2agfeRNA==", + "dev": true, + "requires": { + "fast-glob": "^3.2.5", + "postcss": "^8.4.4" + } + }, "eslint-visitor-keys": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz", diff --git a/package.json b/package.json index 59c423d..7bf8ae5 100644 --- a/package.json +++ b/package.json @@ -101,6 +101,7 @@ "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-react-refresh": "^0.4.1", + "eslint-plugin-tailwindcss": "^3.18.2", "postcss": "^8.4.21", "postcss-cli": "^11.0.0", "postcss-nesting": "^12.0.2", diff --git a/src/@types/auth.ts b/src/@types/auth.ts index 8d67d64..64a2e02 100644 --- a/src/@types/auth.ts +++ b/src/@types/auth.ts @@ -35,17 +35,23 @@ export type RegisterCredential = { }; export type OrganizationData = { - id?: string; - par?: number; - compensationStartDay?: string; - assessmentStartDelayInDays?: number; - assessmentDurationInDays?: number - compensationPeriod?: number; - name: string; - logo?: string; -}; + id?: string + par?: number + compensationStartDay?: string + assessmentStartDelayInDays?: number + assessmentDurationInDays?: number + compensationPeriod?: number + name: string + logo?: string + chain?: 'arbitrum' | 'sepolia' + safeAddress?: string + stablecoinAddress?: string + recognitionTokenAddress?: string + recognitionMode?: 'hours-based' | 'discretionary' + chainId?: number +} -export type Assessment = { +export type User = { contributorId: string; cultureScore: number; workScore: number; @@ -59,4 +65,4 @@ export type ForgotPassword = { export type ResetPassword = { password: string; -}; +}; \ No newline at end of file diff --git a/src/@types/payouts.ts b/src/@types/payouts.ts new file mode 100644 index 0000000..d488fa0 --- /dev/null +++ b/src/@types/payouts.ts @@ -0,0 +1 @@ +export type RecognitionMode = 'hours-based' | 'discretionary'; \ No newline at end of file diff --git a/src/api/environment.ts b/src/api/environment.ts index 77af55a..f71d137 100644 --- a/src/api/environment.ts +++ b/src/api/environment.ts @@ -10,6 +10,10 @@ export const envVariables = { apiUrl: "VITE_APP_BASE_URL", teamPointsFactoryAddress: "VITE_APP_TEAM_POINTS_FACTORY_ADDRESS", teamPointsFactoryAddressCelo: "VITE_APP_TEAM_POINTS_FACTORY_ADDRESS_CELO", + rainbowProjectId: "VITE_APP_RAINBOW_PROJECT_ID", + walletConnectProjectId: "VITE_APP_WALLETCONNECT_PROJECT_ID", + arbitrumSepoliaRpc: "VITE_APP_ARBITRUM_SEPOLIA_RPC", + celoAlfajoresRpc: "VITE_APP_CELO_ALFAJORES_RPC", appUrl: "VITE_APP_URL", network: "VITE_APP_NETWORK", blockExplorer: "VITE_APP_BLOCK_EXPLORER" @@ -17,4 +21,4 @@ export const envVariables = { }; export const environment: typeof envVariables = - envionmentGenerator(envVariables); + envionmentGenerator(envVariables); \ No newline at end of file diff --git a/src/components/collabberry/PrivacyPolicy.tsx b/src/components/collabberry/PrivacyPolicy.tsx index e9a4ca1..c681844 100644 --- a/src/components/collabberry/PrivacyPolicy.tsx +++ b/src/components/collabberry/PrivacyPolicy.tsx @@ -3,7 +3,7 @@ import React from "react"; const PrivacyPolicy: React.FC = () => { return ( <> -
Your privacy is important to us. It is Collabberry's policy to respect @@ -11,7 +11,7 @@ const PrivacyPolicy: React.FC = () => { our website, http://collabberry.com, and other sites we own and operate.
-@@ -19,7 +19,7 @@ const PrivacyPolicy: React.FC = () => { for example, to provide our services, to communicate with you, or to make our services better.
-@@ -32,18 +32,18 @@ const PrivacyPolicy: React.FC = () => { information relating to the website, and for marketing and promotional purposes.
-We do not share your personal information with anyone except to comply with the law, develop our products, or protect our rights.
-We take reasonable measures to help protect your personal information from loss, theft, misuse, and unauthorized access, disclosure, alteration, and destruction.
-If you have any questions about this Privacy Policy, please contact us at support@collabberry.com. diff --git a/src/components/collabberry/TermsAndConditions.tsx b/src/components/collabberry/TermsAndConditions.tsx index af79b38..d468548 100644 --- a/src/components/collabberry/TermsAndConditions.tsx +++ b/src/components/collabberry/TermsAndConditions.tsx @@ -3,24 +3,24 @@ import React from "react"; const TermsAndConditions: React.FC = () => { return ( <> -
Welcome to Collabberry! These terms and conditions outline the rules and regulations for the use of Collabberry's Website.
-By accessing this website we assume you accept these terms and conditions. Do not continue to use Collabberry if you do not agree to take all of the terms and conditions stated on this page.
-We employ the use of cookies. By accessing Collabberry, you agreed to use cookies in agreement with the Collabberry's Privacy Policy.
-Unless otherwise stated, Collabberry and/or its licensors own the intellectual property rights for all material on Collabberry. All @@ -28,7 +28,7 @@ const TermsAndConditions: React.FC = () => { Collabberry for your own personal use subjected to restrictions set in these terms and conditions.
-This Agreement shall begin on the date hereof.
-The following organizations may link to our Website without prior written approval:
-Without prior approval and written permission, you may not create frames around our Webpages that alter in any way the visual presentation or appearance of our Website.
-We shall not be hold responsible for any content that appears on your Website. You agree to protect and defend us against all claims that is @@ -83,9 +83,9 @@ const TermsAndConditions: React.FC = () => { infringes, otherwise violates, or advocates the infringement or other violation of, any third party rights.
-Please read Privacy Policy
-We reserve the right to request that you remove all links or any particular link to our Website. You approve to immediately remove all @@ -94,7 +94,7 @@ const TermsAndConditions: React.FC = () => { continuously linking to our Website, you agree to be bound to and follow these linking terms and conditions.
-@@ -109,13 +109,13 @@ const TermsAndConditions: React.FC = () => { ensure that the website remains available or that the material on the website is kept up to date.
-To the maximum extent permitted by applicable law, we exclude all representations, warranties and conditions relating to our website and the use of this website. Nothing in this disclaimer will:
-