diff --git a/.changeset/chatty-otters-visit.md b/.changeset/chatty-otters-visit.md deleted file mode 100644 index a2622bf5..00000000 --- a/.changeset/chatty-otters-visit.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -feat: add WeightedAllowlistFormController to modular Form -feat: create Object validator for modular form -fix: improve checker evaluation form -fix: update RoundDatesController UI styling \ No newline at end of file diff --git a/.changeset/chilly-poems-decide.md b/.changeset/chilly-poems-decide.md deleted file mode 100644 index f1bd0f61..00000000 --- a/.changeset/chilly-poems-decide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -Stacking hub beta components diff --git a/.changeset/cuddly-pumas-watch.md b/.changeset/cuddly-pumas-watch.md deleted file mode 100644 index ad128672..00000000 --- a/.changeset/cuddly-pumas-watch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -implemented Spinner component diff --git a/.changeset/curly-clouds-travel.md b/.changeset/curly-clouds-travel.md deleted file mode 100644 index ae02c1cd..00000000 --- a/.changeset/curly-clouds-travel.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@gitcoin/themes": patch -"@gitcoin/ui": patch ---- - -fix(theme): default theme missing - -fix(ui): NotFoundPage should be full height diff --git a/.changeset/dirty-donkeys-live.md b/.changeset/dirty-donkeys-live.md deleted file mode 100644 index 90c12777..00000000 --- a/.changeset/dirty-donkeys-live.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -fix read only error diff --git a/.changeset/few-files-sip.md b/.changeset/few-files-sip.md deleted file mode 100644 index 8e3d8f15..00000000 --- a/.changeset/few-files-sip.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -migrate checker to use new indexer diff --git a/.changeset/five-stingrays-turn.md b/.changeset/five-stingrays-turn.md deleted file mode 100644 index 7ef30826..00000000 --- a/.changeset/five-stingrays-turn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -fixes staking project input diff --git a/.changeset/forty-planets-collect.md b/.changeset/forty-planets-collect.md deleted file mode 100644 index 3a8f4c09..00000000 --- a/.changeset/forty-planets-collect.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -chore: moved table to primitives - -chore: moved dialog to primitives - -chore: removed accordion as it already exists on primitives \ No newline at end of file diff --git a/.changeset/funny-crews-attend.md b/.changeset/funny-crews-attend.md deleted file mode 100644 index fc31ecae..00000000 --- a/.changeset/funny-crews-attend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -Staking app components improvements diff --git a/.changeset/good-squids-decide.md b/.changeset/good-squids-decide.md deleted file mode 100644 index 6a9969ae..00000000 --- a/.changeset/good-squids-decide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -fix: staking-project-card-design diff --git a/.changeset/grumpy-flies-smell.md b/.changeset/grumpy-flies-smell.md deleted file mode 100644 index df525ab0..00000000 --- a/.changeset/grumpy-flies-smell.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -### Features - -- **Get Transaction URL:** Added the `getTransactionUrl` utility function. -- **SVG Conversion:** Added a utility to convert SVG to Blob. -- **Retrofunding:** Created the retrofunding distribute component. -- **Form Validation:** Added a number validation utility in forms. -- **Math Utilities:** Enhanced math utilities and included a reset for editing ballots. - -### Chores - -- **Select Component:** Enhanced the Select component (added SVG icon support and additional - improvements). -- **UI Props:** Added missing Radix UI props to Switch and Checkbox components. -- **Tailwind Variants:** Improved Tailwind variants for statCard/Group. -- **Storybook:** Updated story args to demonstrate the new math utilities. -- **Types Migration:** Moved distribute types to the types folder. -- **General Improvements:** Miscellaneous improvements. diff --git a/.changeset/grumpy-garlics-rescue.md b/.changeset/grumpy-garlics-rescue.md deleted file mode 100644 index ce364062..00000000 --- a/.changeset/grumpy-garlics-rescue.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -feat: UI Component Enhancements - -- Added new icon components -- Added warning toaster component -- Made IconLabel component more modular -- Updated markdown editor action buttons to match designs -- Added summary section support in progress form -- Added clickable side navigation for form steps - -chore: Component Organization - -- Moved Input component to primitives -- Moved Label component to primitives -- Made allowlist import button optional - -fix: Markdown editor styling matches design spec diff --git a/.changeset/hip-impalas-eat.md b/.changeset/hip-impalas-eat.md deleted file mode 100644 index 066fec88..00000000 --- a/.changeset/hip-impalas-eat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -improvements to date picker, checker diff --git a/.changeset/hip-lies-remember.md b/.changeset/hip-lies-remember.md deleted file mode 100644 index 642f7613..00000000 --- a/.changeset/hip-lies-remember.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -Add charts diff --git a/.changeset/hungry-hornets-end.md b/.changeset/hungry-hornets-end.md deleted file mode 100644 index b181bc42..00000000 --- a/.changeset/hungry-hornets-end.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -fix: retrofunding tweaks diff --git a/.changeset/kind-pens-build.md b/.changeset/kind-pens-build.md deleted file mode 100644 index 113fddca..00000000 --- a/.changeset/kind-pens-build.md +++ /dev/null @@ -1,19 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -### Features - -- Created new program picker modal component for improved program selection -- Refactored carousel component for better performance and maintainability - -### Bug Fixes - -- Improved disabled field styling -- Fixed conditional padding in review application page checker -- Updated program list filter placeholder text - -### Chores - -- Enhanced IndexDB implementation -- Added mock service worker file for testing purposes diff --git a/.changeset/large-tools-confess.md b/.changeset/large-tools-confess.md deleted file mode 100644 index f8f64c0c..00000000 --- a/.changeset/large-tools-confess.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -(retrofunding): changed props in LandingPage "actionButton" -> "children" diff --git a/.changeset/lucky-comics-thank.md b/.changeset/lucky-comics-thank.md deleted file mode 100644 index 942a6a56..00000000 --- a/.changeset/lucky-comics-thank.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -Export dialog and table diff --git a/.changeset/many-carrots-sparkle.md b/.changeset/many-carrots-sparkle.md deleted file mode 100644 index 474b3fe6..00000000 --- a/.changeset/many-carrots-sparkle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -feat: adds an allocation bar to the ballot form diff --git a/.changeset/nasty-masks-grab.md b/.changeset/nasty-masks-grab.md deleted file mode 100644 index 9dfeb336..00000000 --- a/.changeset/nasty-masks-grab.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -Fixes past applications query diff --git a/.changeset/nine-cars-relate.md b/.changeset/nine-cars-relate.md deleted file mode 100644 index 656fbf1b..00000000 --- a/.changeset/nine-cars-relate.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -chore: improve leaderboard sorting -feat: add share to twitter btn after submitting the ballot diff --git a/.changeset/plenty-zebras-move.md b/.changeset/plenty-zebras-move.md deleted file mode 100644 index 58ace3ba..00000000 --- a/.changeset/plenty-zebras-move.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -Fixed retrofunding leaderboard component issues diff --git a/.changeset/pre.json b/.changeset/pre.json index 5e914c69..583c71aa 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -1,54 +1,17 @@ { "mode": "pre", - "tag": "beta", + "tag": "next", "initialVersions": { - "@repo/next-app": "0.0.0", - "@gitcoin/config": "0.0.0", - "@gitcoin/themes": "0.0.0", - "@gitcoin/types": "0.0.0", - "@gitcoin/ui": "0.0.0", - "@gitcoin/utils": "0.0.0" + "@gitcoin/checker": "0.0.0", + "@gitcoin/config": "0.0.0-beta.41", + "@repo/example": "0.0.0", + "@gitcoin/services": "0.0.0", + "@gitcoin/themes": "0.0.0-beta.41", + "@gitcoin/types": "0.0.0-beta.41", + "@gitcoin/ui": "0.0.0-beta.41", + "@gitcoin/utils": "0.0.0-beta.41" }, "changesets": [ - "chatty-otters-visit", - "chilly-poems-decide", - "cuddly-pumas-watch", - "curly-clouds-travel", - "dirty-donkeys-live", - "few-files-sip", - "five-stingrays-turn", - "forty-planets-collect", - "funny-crews-attend", - "good-squids-decide", - "grumpy-flies-smell", - "grumpy-garlics-rescue", - "hip-impalas-eat", - "hip-lies-remember", - "hungry-hornets-end", - "kind-pens-build", - "large-tools-confess", - "lucky-comics-thank", - "many-carrots-sparkle", - "nasty-masks-grab", - "nine-cars-relate", - "plenty-zebras-move", - "pretty-panthers-worry", - "rare-plants-work", - "rich-phones-live", - "rude-apples-play", - "shy-pigs-camp", - "shy-rats-peel", - "silver-planets-return", - "silver-waves-turn", - "small-crabs-obey", - "soft-carpets-allow", - "sweet-crabs-care", - "thick-jobs-try", - "tough-candles-shake", - "violet-bikes-yell", - "warm-insects-call", - "witty-countries-tan", - "witty-plants-kneel", - "witty-pots-bow" + "ten-islands-jump" ] } diff --git a/.changeset/pretty-panthers-worry.md b/.changeset/pretty-panthers-worry.md deleted file mode 100644 index 7d282516..00000000 --- a/.changeset/pretty-panthers-worry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -chore: leaderboard improvements diff --git a/.changeset/rare-plants-work.md b/.changeset/rare-plants-work.md deleted file mode 100644 index 3acfceb8..00000000 --- a/.changeset/rare-plants-work.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -direct grants status fix diff --git a/.changeset/rich-phones-live.md b/.changeset/rich-phones-live.md deleted file mode 100644 index 0615490e..00000000 --- a/.changeset/rich-phones-live.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -added classname prop to AllocationSidebar and MetricsBallot diff --git a/.changeset/rude-apples-play.md b/.changeset/rude-apples-play.md deleted file mode 100644 index 124b6277..00000000 --- a/.changeset/rude-apples-play.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -created components for metrics diff --git a/.changeset/shy-pigs-camp.md b/.changeset/shy-pigs-camp.md deleted file mode 100644 index 9bf6bb18..00000000 --- a/.changeset/shy-pigs-camp.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -Added disabled input and improvements for pool details diff --git a/.changeset/shy-rats-peel.md b/.changeset/shy-rats-peel.md deleted file mode 100644 index 49a36356..00000000 --- a/.changeset/shy-rats-peel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -fixes: retrofunding calculations using decimal.js diff --git a/.changeset/silver-planets-return.md b/.changeset/silver-planets-return.md deleted file mode 100644 index 2a59bfed..00000000 --- a/.changeset/silver-planets-return.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -feat: added usePoolManager hook on checker - -fix: showing hidden answers only to pool managers \ No newline at end of file diff --git a/.changeset/silver-waves-turn.md b/.changeset/silver-waves-turn.md deleted file mode 100644 index 3faf2168..00000000 --- a/.changeset/silver-waves-turn.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -"@gitcoin/themes": patch -"@gitcoin/ui": patch ---- - -### Features - -- Refactored themes package using `tw-colors` -- Added new icons to the library -- Created new `IconWithTooltip` component -- Implemented pagination primitive with theme support -- Built Retrofunding leaderboard component with theme support - -### Improvements - -- Enhanced `IconLabel` component functionality -- Upgraded `Select` component with better UX diff --git a/.changeset/small-crabs-obey.md b/.changeset/small-crabs-obey.md deleted file mode 100644 index ad53ee78..00000000 --- a/.changeset/small-crabs-obey.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -chore: updated retrofunding landing pages svgs diff --git a/.changeset/soft-carpets-allow.md b/.changeset/soft-carpets-allow.md deleted file mode 100644 index f838378d..00000000 --- a/.changeset/soft-carpets-allow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -Adds optional constant funding per grantee in retrofunding Distribute component diff --git a/.changeset/sweet-crabs-care.md b/.changeset/sweet-crabs-care.md deleted file mode 100644 index 83d0d219..00000000 --- a/.changeset/sweet-crabs-care.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -chore: leaderboard impovements -chore: start using react-markdown instead of markdown-preview -fix: markdown editor to work with next.js diff --git a/.changeset/ten-islands-jump.md b/.changeset/ten-islands-jump.md new file mode 100644 index 00000000..883bb633 --- /dev/null +++ b/.changeset/ten-islands-jump.md @@ -0,0 +1,17 @@ +--- +"@gitcoin/services": major +"@gitcoin/config": major +"@gitcoin/types": major +"@gitcoin/utils": major +"@gitcoin/checker": major +"@gitcoin/ui": major +--- + +- moved packages/ui feature checker to apps/checker (npm: @gitcoin/checker) + +- moved the types that were used by checker and ui to packages/types (npm: @gitcoin/types) + +- moved the utils that were used by checker and ui to packages/utils (npm: @gitcoin/utils) + +- moved allo and checker services from checker feature to packages/services (npm: + @packages/services) diff --git a/.changeset/thick-jobs-try.md b/.changeset/thick-jobs-try.md deleted file mode 100644 index 7dd61195..00000000 --- a/.changeset/thick-jobs-try.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -set min review to 1 on checker diff --git a/.changeset/tough-candles-shake.md b/.changeset/tough-candles-shake.md deleted file mode 100644 index 46165f6a..00000000 --- a/.changeset/tough-candles-shake.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -feature: implemented BallotForm - -fix: onWheel functionality for DistributeTable diff --git a/.changeset/violet-bikes-yell.md b/.changeset/violet-bikes-yell.md deleted file mode 100644 index 4b0cd9cd..00000000 --- a/.changeset/violet-bikes-yell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -Forms refactoring: Added support for Form(Without persistence) and FormWithPersist diff --git a/.changeset/warm-insects-call.md b/.changeset/warm-insects-call.md deleted file mode 100644 index f8c5e37e..00000000 --- a/.changeset/warm-insects-call.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -fix: removed Navbar typo in central section diff --git a/.changeset/witty-countries-tan.md b/.changeset/witty-countries-tan.md deleted file mode 100644 index dc265347..00000000 --- a/.changeset/witty-countries-tan.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -fix: checker applications query with pagination to support more than 200 entries diff --git a/.changeset/witty-plants-kneel.md b/.changeset/witty-plants-kneel.md deleted file mode 100644 index e325d08d..00000000 --- a/.changeset/witty-plants-kneel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -fix: ballot form first render handling diff --git a/.changeset/witty-pots-bow.md b/.changeset/witty-pots-bow.md deleted file mode 100644 index aeb9045f..00000000 --- a/.changeset/witty-pots-bow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@gitcoin/ui": patch ---- - -implemented NotFoundPage diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml new file mode 100644 index 00000000..740462ea --- /dev/null +++ b/.github/workflows/pr-checks.yml @@ -0,0 +1,68 @@ +name: PR Checks + +on: + pull_request: + types: [opened, synchronize, reopened, edited] + +jobs: + pr-title: + name: Check PR Title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + scopes: | + PAR-\d+ + par-\d+ + requireScope: false + ignore-labels: | + bot + skip-pr-title-check + + lint-build: + name: Lint and Build Check + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: "20" + + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 8 + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - name: Setup pnpm cache + uses: actions/cache@v4 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - name: Setup Turbo cache + uses: actions/cache@v4 + with: + path: .turbo + key: ${{ runner.os }}-turbo-${{ github.sha }} + restore-keys: | + ${{ runner.os }}-turbo- + + # - name: Run lint + # run: pnpm lint + + - name: Run build + run: pnpm build diff --git a/.github/workflows/release-next.yml b/.github/workflows/release-next.yml new file mode 100644 index 00000000..b4b5c538 --- /dev/null +++ b/.github/workflows/release-next.yml @@ -0,0 +1,50 @@ +name: Release + +on: + push: + branches: + - next + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + permissions: + contents: write # to create release (changesets/action) + issues: write # to post issue comments (changesets/action) + pull-requests: write # to create pull request (changesets/action) + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup pnpm 8 + uses: pnpm/action-setup@v3 + with: + version: 8 + + - name: Setup Node.js 20.x + uses: actions/setup-node@v4 + with: + node-version: 20.x + + - name: Install Dependencies + run: pnpm i + + - name: Create Next Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + publish: pnpm release + version: pnpm version-packages + commit: "ci: new next release" + title: "ci: new next release candidate" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + + # - name: Send a Slack notification if a publish happens + # if: steps.changesets.outputs.published == 'true' + # # You can do something when a publish happens. + # run: my-slack-bot send-notification --message "A new version of ${GITHUB_REPOSITORY} was published!" diff --git a/apps/checker/.gitignore b/apps/checker/.gitignore new file mode 100644 index 00000000..6291b7a6 --- /dev/null +++ b/apps/checker/.gitignore @@ -0,0 +1,27 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +.env +storybook-static \ No newline at end of file diff --git a/apps/checker/.prettierignore b/apps/checker/.prettierignore new file mode 100644 index 00000000..6ea956bc --- /dev/null +++ b/apps/checker/.prettierignore @@ -0,0 +1,5 @@ +node_modules +dist +pnpm-lock.yaml +mockServiceWorker.js +storybook-static \ No newline at end of file diff --git a/apps/checker/.prettierrc b/apps/checker/.prettierrc new file mode 100644 index 00000000..4b76c5bf --- /dev/null +++ b/apps/checker/.prettierrc @@ -0,0 +1,22 @@ +{ + "useTabs": false, + "singleQuote": false, + "trailingComma": "all", + "semi": true, + "printWidth": 100, + "plugins": ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-tailwindcss"], + "tailwindConfig": "./tailwind.config.ts", + "tailwindFunctions": ["tw", "tv", "cn", "clsx"], + "tailwindAttributes": ["tw", "tv", "cn", "clsx"], + "importOrder": [ + "^react(.*)?$", + "^@react(.*)?$", + "^vite(.*)?$", + "^@vite(.*)?$", + "", + "^@/(.*)$", + "^~(.*)$", + "^[./]" + ], + "importOrderSeparation": true +} diff --git a/apps/checker/.storybook/GitcoinTheme.ts b/apps/checker/.storybook/GitcoinTheme.ts new file mode 100644 index 00000000..41e77418 --- /dev/null +++ b/apps/checker/.storybook/GitcoinTheme.ts @@ -0,0 +1,9 @@ +import { create } from "@storybook/theming"; + +export default create({ + base: "dark", + brandTitle: "Gitcoin UI Kit", + brandUrl: "https://gitcoin.co", + brandImage: "https://ipfs.io/ipfs/QmXuheKdZJwvCrZKF1Py5ez6H3jV9XNtDLTXbPuQknUgzr", + brandTarget: "_self", +}); diff --git a/apps/checker/.storybook/Manager.ts b/apps/checker/.storybook/Manager.ts new file mode 100644 index 00000000..fdc103f2 --- /dev/null +++ b/apps/checker/.storybook/Manager.ts @@ -0,0 +1,7 @@ +import { addons } from "@storybook/manager-api"; + +import GitcoinTheme from "./GitcoinTheme"; + +addons.setConfig({ + theme: GitcoinTheme, +}); diff --git a/apps/checker/.storybook/main.ts b/apps/checker/.storybook/main.ts new file mode 100644 index 00000000..52604746 --- /dev/null +++ b/apps/checker/.storybook/main.ts @@ -0,0 +1,33 @@ +import { withoutVitePlugins } from "@storybook/builder-vite"; +import type { StorybookConfig } from "@storybook/react-vite"; + +const config: StorybookConfig = { + stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"], + addons: [ + "@storybook/addon-links", + "@storybook/addon-essentials", + "@chromatic-com/storybook", + "@storybook/addon-themes", + "@storybook/addon-a11y", + "@storybook/addon-actions", + "@storybook/addon-interactions", + ], + staticDirs: ["../public"], + framework: { + name: "@storybook/react-vite", + options: {}, + }, + docs: {}, + core: { + disableTelemetry: true, // 👈 Used to ignore update notifications. + }, + typescript: { + reactDocgen: "react-docgen-typescript", + }, + async viteFinal(config) { + config.plugins = await withoutVitePlugins(config.plugins, ["vite:dts"]); + + return config; + }, +}; +export default config; diff --git a/apps/checker/.storybook/preview.ts b/apps/checker/.storybook/preview.ts new file mode 100644 index 00000000..9ca22aa2 --- /dev/null +++ b/apps/checker/.storybook/preview.ts @@ -0,0 +1,65 @@ +import "@gitcoin/ui/styles.css"; +import { withThemeByDataAttribute } from "@storybook/addon-themes"; +import type { Preview } from "@storybook/react"; +import { initialize, mswLoader } from "msw-storybook-addon"; +import { mockDateDecorator } from "storybook-mock-date-decorator"; + +import { handlers } from "../src/mocks/handlers"; + +initialize(); + +const preview: Preview = { + parameters: { + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/i, + }, + }, + options: { + storySort: { + method: "alphabetical", + order: [ + "Welcome", + "Docs", + "Styles", + "Features", + ["Checker", "Retrofunding", "Application", "*"], + "Components", + "Primitives", + "Pages", + "Shadcn", + "*", + ], + locales: "en-US", + }, + }, + msw: { + handlers, + }, + }, + + loaders: [mswLoader], + decorators: [ + withThemeByDataAttribute({ + themes: { + light: "light", + dark: "dark", + }, + defaultTheme: "light", + attributeName: "data-theme", + }), + mockDateDecorator, + ], + + tags: ["autodocs"], +}; + +// NOTE: Example of global loaders +// export const loaders = [ +// async () => ({ +// userData: await fetch('/api/user').then((res) => res.json()), +// }), +// ]; + +export default preview; diff --git a/apps/checker/.storybook/test-runner.ts b/apps/checker/.storybook/test-runner.ts new file mode 100644 index 00000000..46ae0323 --- /dev/null +++ b/apps/checker/.storybook/test-runner.ts @@ -0,0 +1,19 @@ +import type { TestRunnerConfig } from "@storybook/test-runner"; +import { injectAxe } from "axe-playwright"; + +// TODO: Enable a11y check +const config: TestRunnerConfig = { + async preVisit(page) { + await injectAxe(page); + }, + // async postVisit(page) { + // await checkA11y(page, "#storybook-root", { + // detailedReport: true, + // detailedReportOptions: { + // html: true, + // }, + // }); + // }, +}; + +export default config; diff --git a/apps/checker/CHANGELOG.md b/apps/checker/CHANGELOG.md new file mode 100644 index 00000000..d268214d --- /dev/null +++ b/apps/checker/CHANGELOG.md @@ -0,0 +1,18 @@ +# @gitcoin/checker + +## 1.0.0-next.0 + +### Major Changes + +- - moved packages/ui feature checker to apps/checker (npm: @gitcoin/checker) + - moved the types that were used by checker and ui to packages/types (npm: @gitcoin/types) + - moved the utils that were used by checker and ui to packages/utils (npm: @gitcoin/utils) + - moved allo and checker services from checker feature to packages/services (npm: + @packages/services) + +### Patch Changes + +- Updated dependencies []: + - @gitcoin/services@1.0.0-next.0 + - @gitcoin/utils@1.0.0-next.0 + - @gitcoin/ui@1.0.0-next.0 diff --git a/apps/checker/README.md b/apps/checker/README.md new file mode 100644 index 00000000..6a8677a5 --- /dev/null +++ b/apps/checker/README.md @@ -0,0 +1 @@ +# @gitcoin/checker diff --git a/apps/checker/eslint.config.js b/apps/checker/eslint.config.js new file mode 100644 index 00000000..87bcec24 --- /dev/null +++ b/apps/checker/eslint.config.js @@ -0,0 +1,33 @@ +import eslint from "@eslint/js"; +import eslintConfigPrettier from "eslint-config-prettier"; +import tailwind from "eslint-plugin-tailwindcss"; +import globals from "globals"; +import tseslint from "typescript-eslint"; + +export default tseslint.config( + eslint.configs.recommended, + ...tseslint.configs.recommended, // .strict is a super set of recommended + // ...tseslint.configs.strict, + ...tseslint.configs.stylistic, + { ignores: ["dist", "node_modules", "storybook-static", "ui-shadcn"] }, + { + extends: [ + eslint.configs.recommended, + ...tseslint.configs.recommended, + ...tailwind.configs["flat/recommended"], + ], + languageOptions: { + ecmaVersion: 2020, + globals: globals.browser, + }, + rules: { + "@typescript-eslint/no-empty-object-type": "off", + "@typescript-eslint/no-unused-vars": "warn", + "@typescript-eslint/no-non-null-assertion": "warn", + "@typescript-eslint/no-explicit-any": "warn", + "@typescript-eslint/consistent-type-definitions": "warn", + "tailwindcss/enforces-shorthand": "off", + }, + }, + eslintConfigPrettier, +); diff --git a/apps/checker/index.html b/apps/checker/index.html new file mode 100644 index 00000000..e286b8d6 --- /dev/null +++ b/apps/checker/index.html @@ -0,0 +1,13 @@ + + + + + + + Checker Preview + + +
+ + + diff --git a/apps/checker/package.json b/apps/checker/package.json new file mode 100644 index 00000000..584b7ce5 --- /dev/null +++ b/apps/checker/package.json @@ -0,0 +1,134 @@ +{ + "name": "@gitcoin/checker", + "version": "1.0.0-next.0", + "repository": { + "type": "git", + "url": "https://github.com/gitcoinco/core", + "directory": "apps/checker" + }, + "type": "module", + "types": "./dist/index.d.ts", + "main": "./dist/index.js", + "module": "./dist/index.js", + "files": [ + "dist" + ], + "sideEffects": [ + "**/*.css" + ], + "license": "AGPL-3.0", + "scripts": { + "dev": "pnpm storybook", + "test": "test-storybook --url http://localhost:6007", + "clean": "rm -rf .turbo node_modules dist", + "build": "tsc && vite build", + "build:watch": "tsc && vite build --watch", + "lint": "eslint . --report-unused-disable-directives --max-warnings 0", + "format": "prettier --write --ignore-unknown .", + "preview": "vite", + "storybook": "storybook dev -p 6007", + "build-storybook": "storybook build" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "import": "./dist/index.js", + "require": "./dist/index.js" + } + }, + "devDependencies": { + "@chromatic-com/storybook": "^3.2.2", + "@eslint/js": "^9.11.1", + "@gitcoin/themes": "workspace:*", + "@gitcoin/types": "workspace:*", + "@storybook/addon-a11y": "^8.4.4", + "@storybook/addon-essentials": "^8.4.4", + "@storybook/addon-interactions": "^8.4.4", + "@storybook/addon-links": "^8.4.4", + "@storybook/addon-themes": "^8.4.4", + "@storybook/blocks": "^8.4.4", + "@storybook/builder-vite": "^8.4.7", + "@storybook/manager-api": "^8.4.4", + "@storybook/react": "^8.4.7", + "@storybook/react-vite": "^8.4.7", + "@storybook/test": "^8.4.7", + "@storybook/test-runner": "^0.19.1", + "@storybook/theming": "^8.4.4", + "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/lodash": "^4.17.15", + "@types/node": "^22.10.2", + "@types/react": "^18.3.10", + "@types/react-dom": "^18.3.0", + "@typescript-eslint/eslint-plugin": "^8.10.0", + "@typescript-eslint/parser": "^8.10.0", + "@vitejs/plugin-react": "^4.3.2", + "@vitejs/plugin-react-swc": "^3.7.1", + "autoprefixer": "^10.4.20", + "axe-playwright": "^2.0.3", + "chromatic": "^11.12.6", + "clsx": "^2.1.1", + "eslint": "^9.11.1", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-tailwindcss": "^3.17.5", + "fs": "0.0.1-security", + "globals": "^15.9.0", + "http-server": "^14.1.1", + "husky": "^9.1.6", + "lint-staged": "^15.2.10", + "lucide-react": "^0.453.0", + "msw": "^2.4.11", + "msw-storybook-addon": "^2.0.4", + "path": "^0.12.7", + "playwright": "^1.48.1", + "postcss": "^8.4.47", + "prettier": "3.1.0", + "prettier-plugin-tailwindcss": "0.5.7", + "react": "18.3.1", + "react-dom": "18.3.1", + "rollup-preserve-directives": "^1.1.3", + "storybook": "^8.4.7", + "tailwind-merge": "^2.5.4", + "tailwindcss": "^3.4.14", + "tailwindcss-animate": "^1.0.7", + "ts-node": "^10.9.2", + "typescript": "5.4.2", + "typescript-eslint": "^8.10.0", + "vite": "^6.0.3", + "vite-plugin-dts": "^4.3.0" + }, + "peerDependencies": { + "react": "18.3.1", + "react-dom": "18.3.1" + }, + "eslintConfig": { + "extends": [ + "plugin:storybook/recommended" + ] + }, + "lint-staged": { + "**/*": "prettier --write --ignore-unknown" + }, + "msw": { + "workerDirectory": [ + "public" + ] + }, + "dependencies": { + "@gitcoin/gitcoin-chain-data": "^1.0.43", + "@gitcoin/ui": "workspace:*", + "@gitcoin/services": "workspace:*", + "@gitcoin/utils": "workspace:*", + "@storybook/addon-actions": "8.3.5", + "@tanstack/react-query": "^5.59.15", + "graphql-request": "^7.1.0", + "lodash": "^4.17.21", + "storybook-mock-date-decorator": "^2.0.6", + "tailwind-variants": "^0.2.1", + "ts-pattern": "^5.5.0", + "viem": "^2.21.48", + "vite-plugin-svgr": "^4.2.0" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/apps/checker/postcss.config.js b/apps/checker/postcss.config.js new file mode 100644 index 00000000..2aa7205d --- /dev/null +++ b/apps/checker/postcss.config.js @@ -0,0 +1,6 @@ +export default { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +}; diff --git a/apps/checker/public/mockServiceWorker.js b/apps/checker/public/mockServiceWorker.js new file mode 100644 index 00000000..c9c662a2 --- /dev/null +++ b/apps/checker/public/mockServiceWorker.js @@ -0,0 +1,295 @@ +/* eslint-disable */ +/* tslint:disable */ + +/** + * Mock Service Worker. + * @see https://github.com/mswjs/msw + * - Please do NOT modify this file. + * - Please do NOT serve this file on production. + */ + +const PACKAGE_VERSION = '2.6.6' +const INTEGRITY_CHECKSUM = 'ca7800994cc8bfb5eb961e037c877074' +const IS_MOCKED_RESPONSE = Symbol('isMockedResponse') +const activeClientIds = new Set() + +self.addEventListener('install', function () { + self.skipWaiting() +}) + +self.addEventListener('activate', function (event) { + event.waitUntil(self.clients.claim()) +}) + +self.addEventListener('message', async function (event) { + const clientId = event.source.id + + if (!clientId || !self.clients) { + return + } + + const client = await self.clients.get(clientId) + + if (!client) { + return + } + + const allClients = await self.clients.matchAll({ + type: 'window', + }) + + switch (event.data) { + case 'KEEPALIVE_REQUEST': { + sendToClient(client, { + type: 'KEEPALIVE_RESPONSE', + }) + break + } + + case 'INTEGRITY_CHECK_REQUEST': { + sendToClient(client, { + type: 'INTEGRITY_CHECK_RESPONSE', + payload: { + packageVersion: PACKAGE_VERSION, + checksum: INTEGRITY_CHECKSUM, + }, + }) + break + } + + case 'MOCK_ACTIVATE': { + activeClientIds.add(clientId) + + sendToClient(client, { + type: 'MOCKING_ENABLED', + payload: { + client: { + id: client.id, + frameType: client.frameType, + }, + }, + }) + break + } + + case 'MOCK_DEACTIVATE': { + activeClientIds.delete(clientId) + break + } + + case 'CLIENT_CLOSED': { + activeClientIds.delete(clientId) + + const remainingClients = allClients.filter((client) => { + return client.id !== clientId + }) + + // Unregister itself when there are no more clients + if (remainingClients.length === 0) { + self.registration.unregister() + } + + break + } + } +}) + +self.addEventListener('fetch', function (event) { + const { request } = event + + // Bypass navigation requests. + if (request.mode === 'navigate') { + return + } + + // Opening the DevTools triggers the "only-if-cached" request + // that cannot be handled by the worker. Bypass such requests. + if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') { + return + } + + // Bypass all requests when there are no active clients. + // Prevents the self-unregistered worked from handling requests + // after it's been deleted (still remains active until the next reload). + if (activeClientIds.size === 0) { + return + } + + // Generate unique request ID. + const requestId = crypto.randomUUID() + event.respondWith(handleRequest(event, requestId)) +}) + +async function handleRequest(event, requestId) { + const client = await resolveMainClient(event) + const response = await getResponse(event, client, requestId) + + // Send back the response clone for the "response:*" life-cycle events. + // Ensure MSW is active and ready to handle the message, otherwise + // this message will pend indefinitely. + if (client && activeClientIds.has(client.id)) { + ;(async function () { + const responseClone = response.clone() + + sendToClient( + client, + { + type: 'RESPONSE', + payload: { + requestId, + isMockedResponse: IS_MOCKED_RESPONSE in response, + type: responseClone.type, + status: responseClone.status, + statusText: responseClone.statusText, + body: responseClone.body, + headers: Object.fromEntries(responseClone.headers.entries()), + }, + }, + [responseClone.body], + ) + })() + } + + return response +} + +// Resolve the main client for the given event. +// Client that issues a request doesn't necessarily equal the client +// that registered the worker. It's with the latter the worker should +// communicate with during the response resolving phase. +async function resolveMainClient(event) { + const client = await self.clients.get(event.clientId) + + if (activeClientIds.has(event.clientId)) { + return client + } + + if (client?.frameType === 'top-level') { + return client + } + + const allClients = await self.clients.matchAll({ + type: 'window', + }) + + return allClients + .filter((client) => { + // Get only those clients that are currently visible. + return client.visibilityState === 'visible' + }) + .find((client) => { + // Find the client ID that's recorded in the + // set of clients that have registered the worker. + return activeClientIds.has(client.id) + }) +} + +async function getResponse(event, client, requestId) { + const { request } = event + + // Clone the request because it might've been already used + // (i.e. its body has been read and sent to the client). + const requestClone = request.clone() + + function passthrough() { + // Cast the request headers to a new Headers instance + // so the headers can be manipulated with. + const headers = new Headers(requestClone.headers) + + // Remove the "accept" header value that marked this request as passthrough. + // This prevents request alteration and also keeps it compliant with the + // user-defined CORS policies. + headers.delete('accept', 'msw/passthrough') + + return fetch(requestClone, { headers }) + } + + // Bypass mocking when the client is not active. + if (!client) { + return passthrough() + } + + // Bypass initial page load requests (i.e. static assets). + // The absence of the immediate/parent client in the map of the active clients + // means that MSW hasn't dispatched the "MOCK_ACTIVATE" event yet + // and is not ready to handle requests. + if (!activeClientIds.has(client.id)) { + return passthrough() + } + + // Notify the client that a request has been intercepted. + const requestBuffer = await request.arrayBuffer() + const clientMessage = await sendToClient( + client, + { + type: 'REQUEST', + payload: { + id: requestId, + url: request.url, + mode: request.mode, + method: request.method, + headers: Object.fromEntries(request.headers.entries()), + cache: request.cache, + credentials: request.credentials, + destination: request.destination, + integrity: request.integrity, + redirect: request.redirect, + referrer: request.referrer, + referrerPolicy: request.referrerPolicy, + body: requestBuffer, + keepalive: request.keepalive, + }, + }, + [requestBuffer], + ) + + switch (clientMessage.type) { + case 'MOCK_RESPONSE': { + return respondWithMock(clientMessage.data) + } + + case 'PASSTHROUGH': { + return passthrough() + } + } + + return passthrough() +} + +function sendToClient(client, message, transferrables = []) { + return new Promise((resolve, reject) => { + const channel = new MessageChannel() + + channel.port1.onmessage = (event) => { + if (event.data && event.data.error) { + return reject(event.data.error) + } + + resolve(event.data) + } + + client.postMessage( + message, + [channel.port2].concat(transferrables.filter(Boolean)), + ) + }) +} + +async function respondWithMock(response) { + // Setting response status code to 0 is a no-op. + // However, when responding with a "Response.error()", the produced Response + // instance will have status code set to 0. Since it's not possible to create + // a Response instance with status code 0, handle that use-case separately. + if (response.status === 0) { + return Response.error() + } + + const mockedResponse = new Response(response.body, response) + + Reflect.defineProperty(mockedResponse, IS_MOCKED_RESPONSE, { + value: true, + enumerable: true, + }) + + return mockedResponse +} \ No newline at end of file diff --git a/packages/ui/src/features/checker/apps/ApplicationView.tsx b/apps/checker/src/apps/ApplicationView.tsx similarity index 80% rename from packages/ui/src/features/checker/apps/ApplicationView.tsx rename to apps/checker/src/apps/ApplicationView.tsx index 5fa5f52b..e9e764a6 100644 --- a/packages/ui/src/features/checker/apps/ApplicationView.tsx +++ b/apps/checker/src/apps/ApplicationView.tsx @@ -3,8 +3,8 @@ import { ViewApplicationEvaluationsPage, ViewApplicationEvaluationsPageProps, -} from "~checker/pages"; -import { CheckerProvider } from "~checker/store"; +} from "@/pages"; +import { CheckerProvider } from "@/store"; export const ApplicationView: React.FC = (props) => { return ( diff --git a/packages/ui/src/features/checker/apps/Checker.stories.tsx b/apps/checker/src/apps/Checker.stories.tsx similarity index 93% rename from packages/ui/src/features/checker/apps/Checker.stories.tsx rename to apps/checker/src/apps/Checker.stories.tsx index 2e87e50c..03fe4d94 100644 --- a/packages/ui/src/features/checker/apps/Checker.stories.tsx +++ b/apps/checker/src/apps/Checker.stories.tsx @@ -1,7 +1,7 @@ import type { Meta, StoryObj } from "@storybook/react"; -import { usePerformEvaluation, usePerformOnChainReview } from "~checker/hooks"; -import { CheckerProvider } from "~checker/store"; +import { usePerformEvaluation, usePerformOnChainReview } from "@/hooks"; +import { CheckerProvider } from "@/store"; import { Checker } from "./Checker"; diff --git a/packages/ui/src/features/checker/apps/Checker.tsx b/apps/checker/src/apps/Checker.tsx similarity index 73% rename from packages/ui/src/features/checker/apps/Checker.tsx rename to apps/checker/src/apps/Checker.tsx index 72bd0c32..9a5b6c01 100644 --- a/packages/ui/src/features/checker/apps/Checker.tsx +++ b/apps/checker/src/apps/Checker.tsx @@ -1,12 +1,11 @@ "use client"; +import { EvaluationBody, ReviewBody } from "@gitcoin/types"; +import { Step } from "@gitcoin/ui/types"; import { Hex } from "viem"; -import { Step } from "@/types"; - -import { CheckerRouter } from "~checker/routers"; -import { CheckerProvider } from "~checker/store"; -import { EvaluationBody, ReviewBody } from "~checker/types"; +import { CheckerRouter } from "@/routers"; +import { CheckerProvider } from "@/store"; export interface CheckerProps { address: Hex; diff --git a/packages/ui/src/features/checker/apps/index.ts b/apps/checker/src/apps/index.ts similarity index 100% rename from packages/ui/src/features/checker/apps/index.ts rename to apps/checker/src/apps/index.ts diff --git a/apps/checker/src/assets/default_logo.png b/apps/checker/src/assets/default_logo.png new file mode 100644 index 00000000..932fdc99 Binary files /dev/null and b/apps/checker/src/assets/default_logo.png differ diff --git a/apps/checker/src/assets/images.d.ts b/apps/checker/src/assets/images.d.ts new file mode 100644 index 00000000..56b7c172 --- /dev/null +++ b/apps/checker/src/assets/images.d.ts @@ -0,0 +1,4 @@ +declare module "*.png" { + const content: string; + export default content; +} diff --git a/apps/checker/src/assets/index.ts b/apps/checker/src/assets/index.ts new file mode 100644 index 00000000..92bbef76 --- /dev/null +++ b/apps/checker/src/assets/index.ts @@ -0,0 +1 @@ +export { default as DefaultLogo } from "./default_logo.png"; diff --git a/packages/ui/src/features/checker/components/ApplicationHistoryList/ApplicationHistoryList.mdx b/apps/checker/src/components/ApplicationHistoryList/ApplicationHistoryList.mdx similarity index 100% rename from packages/ui/src/features/checker/components/ApplicationHistoryList/ApplicationHistoryList.mdx rename to apps/checker/src/components/ApplicationHistoryList/ApplicationHistoryList.mdx diff --git a/packages/ui/src/features/checker/components/ApplicationHistoryList/ApplicationHistoryList.stories.tsx b/apps/checker/src/components/ApplicationHistoryList/ApplicationHistoryList.stories.tsx similarity index 100% rename from packages/ui/src/features/checker/components/ApplicationHistoryList/ApplicationHistoryList.stories.tsx rename to apps/checker/src/components/ApplicationHistoryList/ApplicationHistoryList.stories.tsx diff --git a/packages/ui/src/features/checker/components/ApplicationHistoryList/ApplicationHistoryList.tsx b/apps/checker/src/components/ApplicationHistoryList/ApplicationHistoryList.tsx similarity index 84% rename from packages/ui/src/features/checker/components/ApplicationHistoryList/ApplicationHistoryList.tsx rename to apps/checker/src/components/ApplicationHistoryList/ApplicationHistoryList.tsx index 3e57e37f..1edbb6a9 100644 --- a/packages/ui/src/features/checker/components/ApplicationHistoryList/ApplicationHistoryList.tsx +++ b/apps/checker/src/components/ApplicationHistoryList/ApplicationHistoryList.tsx @@ -1,9 +1,6 @@ "use client"; -import { IconLabel } from "@/components/IconLabel"; -import { ListGrid, ListGridColumn } from "@/primitives/ListGrid"; - -import { ApplicationBadge } from "~application"; +import { ApplicationBadge, IconLabel, ListGrid, ListGridColumn } from "@gitcoin/ui"; import { Application } from "./types"; diff --git a/packages/ui/src/features/checker/components/ApplicationHistoryList/index.ts b/apps/checker/src/components/ApplicationHistoryList/index.ts similarity index 100% rename from packages/ui/src/features/checker/components/ApplicationHistoryList/index.ts rename to apps/checker/src/components/ApplicationHistoryList/index.ts diff --git a/packages/ui/src/features/checker/components/ApplicationHistoryList/mocks.tsx b/apps/checker/src/components/ApplicationHistoryList/mocks.tsx similarity index 91% rename from packages/ui/src/features/checker/components/ApplicationHistoryList/mocks.tsx rename to apps/checker/src/components/ApplicationHistoryList/mocks.tsx index 17ff0089..020cccc9 100644 --- a/packages/ui/src/features/checker/components/ApplicationHistoryList/mocks.tsx +++ b/apps/checker/src/components/ApplicationHistoryList/mocks.tsx @@ -1,4 +1,4 @@ -import { ApplicationBadgeStatus } from "~application"; +import { ApplicationBadgeStatus } from "@gitcoin/ui"; import { Application } from "./types"; diff --git a/packages/ui/src/features/checker/components/ApplicationHistoryList/types.ts b/apps/checker/src/components/ApplicationHistoryList/types.ts similarity index 70% rename from packages/ui/src/features/checker/components/ApplicationHistoryList/types.ts rename to apps/checker/src/components/ApplicationHistoryList/types.ts index 0741f378..0ebdb963 100644 --- a/packages/ui/src/features/checker/components/ApplicationHistoryList/types.ts +++ b/apps/checker/src/components/ApplicationHistoryList/types.ts @@ -1,4 +1,4 @@ -import { ApplicationBadgeStatus } from "~application"; +import { ApplicationBadgeStatus } from "@gitcoin/ui"; export interface Application { id: number; diff --git a/packages/ui/src/features/application/components/ApplicationSummary/ApplicationSummary.mdx b/apps/checker/src/components/ApplicationSummary/ApplicationSummary.mdx similarity index 100% rename from packages/ui/src/features/application/components/ApplicationSummary/ApplicationSummary.mdx rename to apps/checker/src/components/ApplicationSummary/ApplicationSummary.mdx diff --git a/packages/ui/src/features/application/components/ApplicationSummary/ApplicationSummary.stories.tsx b/apps/checker/src/components/ApplicationSummary/ApplicationSummary.stories.tsx similarity index 100% rename from packages/ui/src/features/application/components/ApplicationSummary/ApplicationSummary.stories.tsx rename to apps/checker/src/components/ApplicationSummary/ApplicationSummary.stories.tsx diff --git a/packages/ui/src/features/application/components/ApplicationSummary/ApplicationSummary.tsx b/apps/checker/src/components/ApplicationSummary/ApplicationSummary.tsx similarity index 90% rename from packages/ui/src/features/application/components/ApplicationSummary/ApplicationSummary.tsx rename to apps/checker/src/components/ApplicationSummary/ApplicationSummary.tsx index c5216cb9..b7ce92e2 100644 --- a/packages/ui/src/features/application/components/ApplicationSummary/ApplicationSummary.tsx +++ b/apps/checker/src/components/ApplicationSummary/ApplicationSummary.tsx @@ -1,17 +1,20 @@ "use client"; -import { IconLabel } from "@/components/IconLabel"; -import { usePoolManager } from "@/features/checker/hooks"; -import { DateFormat, formatDate } from "@/lib/dates/formatDate"; -import { Accordion } from "@/primitives/Accordion"; -import { IconType } from "@/primitives/Icon"; -import { ListGrid, ListGridColumn } from "@/primitives/ListGrid"; -import { Markdown } from "@/primitives/Markdown"; +import { PastApplication, ProjectApplication, ProjectMetadata } from "@gitcoin/types"; +import { + Accordion, + ApplicationBadge, + ApplicationBadgeStatus, + IconLabel, + IconType, + ListGrid, + ListGridColumn, + ProjectSummary, +} from "@gitcoin/ui"; +import { Markdown } from "@gitcoin/ui/client"; +import { DateFormat, formatDate } from "@gitcoin/utils"; -import { PastApplication, ProjectApplication, ProjectMetadata } from "~checker/services/allo/types"; -import { ProjectSummary } from "~project"; - -import { ApplicationBadge, ApplicationBadgeStatus } from "../ApplicationBadge"; +import { usePoolManager } from "@/hooks"; export enum SummaryAccordians { project = "project", diff --git a/packages/ui/src/features/application/components/ApplicationSummary/index.ts b/apps/checker/src/components/ApplicationSummary/index.ts similarity index 100% rename from packages/ui/src/features/application/components/ApplicationSummary/index.ts rename to apps/checker/src/components/ApplicationSummary/index.ts diff --git a/packages/ui/src/features/application/components/ApplicationSummary/mocks.ts b/apps/checker/src/components/ApplicationSummary/mocks.ts similarity index 98% rename from packages/ui/src/features/application/components/ApplicationSummary/mocks.ts rename to apps/checker/src/components/ApplicationSummary/mocks.ts index 8dc0c5f1..3a6c9dd8 100644 --- a/packages/ui/src/features/application/components/ApplicationSummary/mocks.ts +++ b/apps/checker/src/components/ApplicationSummary/mocks.ts @@ -3,7 +3,7 @@ import { CheckerApplication, ApplicationStatus, PastApplication, -} from "@/features/checker"; +} from "@gitcoin/types"; export const project: ProjectMetadata = { title: "Sample Project", diff --git a/packages/ui/src/features/checker/components/ApplicationsSection/ApplicationsSection.tsx b/apps/checker/src/components/ApplicationsSection/ApplicationsSection.tsx similarity index 92% rename from packages/ui/src/features/checker/components/ApplicationsSection/ApplicationsSection.tsx rename to apps/checker/src/components/ApplicationsSection/ApplicationsSection.tsx index 79840e7d..c54e6cf5 100644 --- a/packages/ui/src/features/checker/components/ApplicationsSection/ApplicationsSection.tsx +++ b/apps/checker/src/components/ApplicationsSection/ApplicationsSection.tsx @@ -2,14 +2,12 @@ import React from "react"; +import { ProjectReview } from "@gitcoin/types"; +import { Button, Skeleton } from "@gitcoin/ui"; import { match } from "ts-pattern"; -import { Button } from "@/primitives/Button"; -import { Skeleton } from "@/primitives/Skeleton"; - -import { ProjectReviewList } from "~checker/components"; -import { useCheckerContext } from "~checker/store"; -import { ProjectReview } from "~checker/types"; +import { ProjectReviewList } from "@/components"; +import { useCheckerContext } from "@/store"; export interface SectionCountHeadingProps { label: string; diff --git a/packages/ui/src/features/checker/components/ApplicationsSection/index.ts b/apps/checker/src/components/ApplicationsSection/index.ts similarity index 100% rename from packages/ui/src/features/checker/components/ApplicationsSection/index.ts rename to apps/checker/src/components/ApplicationsSection/index.ts diff --git a/packages/ui/src/features/checker/components/EvaluationList/EvaluationList.stories.tsx b/apps/checker/src/components/EvaluationList/EvaluationList.stories.tsx similarity index 100% rename from packages/ui/src/features/checker/components/EvaluationList/EvaluationList.stories.tsx rename to apps/checker/src/components/EvaluationList/EvaluationList.stories.tsx diff --git a/packages/ui/src/features/checker/components/EvaluationList/EvaluationList.tsx b/apps/checker/src/components/EvaluationList/EvaluationList.tsx similarity index 86% rename from packages/ui/src/features/checker/components/EvaluationList/EvaluationList.tsx rename to apps/checker/src/components/EvaluationList/EvaluationList.tsx index ebccbee7..a6033a52 100644 --- a/packages/ui/src/features/checker/components/EvaluationList/EvaluationList.tsx +++ b/apps/checker/src/components/EvaluationList/EvaluationList.tsx @@ -1,11 +1,8 @@ "use client"; -import { IconLabel } from "@/components/IconLabel"; -import { capitalizeWord, getAddressLabel } from "@/lib/utils"; -import { IconType } from "@/primitives/Icon"; -import { ListGrid, ListGridColumn } from "@/primitives/ListGrid"; - -import { Evaluation } from "~checker/types"; +import { Evaluation } from "@gitcoin/types"; +import { IconLabel, IconType, ListGrid, ListGridColumn } from "@gitcoin/ui"; +import { capitalizeWord, getAddressLabel } from "@gitcoin/utils"; export interface EvaluationListProps { evaluations: Evaluation[]; diff --git a/packages/ui/src/features/checker/components/EvaluationList/index.ts b/apps/checker/src/components/EvaluationList/index.ts similarity index 100% rename from packages/ui/src/features/checker/components/EvaluationList/index.ts rename to apps/checker/src/components/EvaluationList/index.ts diff --git a/packages/ui/src/features/checker/components/EvaluationList/mocks.tsx b/apps/checker/src/components/EvaluationList/mocks.tsx similarity index 96% rename from packages/ui/src/features/checker/components/EvaluationList/mocks.tsx rename to apps/checker/src/components/EvaluationList/mocks.tsx index 477ea354..3b7b047a 100644 --- a/packages/ui/src/features/checker/components/EvaluationList/mocks.tsx +++ b/apps/checker/src/components/EvaluationList/mocks.tsx @@ -1,4 +1,4 @@ -import { Evaluation } from "../../types"; +import { Evaluation } from "@gitcoin/types"; export const mockEvaluations: Evaluation[] = [ { diff --git a/packages/ui/src/features/checker/components/ProjectEvaluationAction/ProjectEvaluationAction.mdx b/apps/checker/src/components/ProjectEvaluationAction/ProjectEvaluationAction.mdx similarity index 100% rename from packages/ui/src/features/checker/components/ProjectEvaluationAction/ProjectEvaluationAction.mdx rename to apps/checker/src/components/ProjectEvaluationAction/ProjectEvaluationAction.mdx diff --git a/packages/ui/src/features/checker/components/ProjectEvaluationAction/ProjectEvaluationAction.stories.tsx b/apps/checker/src/components/ProjectEvaluationAction/ProjectEvaluationAction.stories.tsx similarity index 96% rename from packages/ui/src/features/checker/components/ProjectEvaluationAction/ProjectEvaluationAction.stories.tsx rename to apps/checker/src/components/ProjectEvaluationAction/ProjectEvaluationAction.stories.tsx index 87085fcd..e31f372c 100644 --- a/packages/ui/src/features/checker/components/ProjectEvaluationAction/ProjectEvaluationAction.stories.tsx +++ b/apps/checker/src/components/ProjectEvaluationAction/ProjectEvaluationAction.stories.tsx @@ -1,7 +1,7 @@ +import { EvaluationAction } from "@gitcoin/types"; import { action } from "@storybook/addon-actions"; import type { Meta, StoryObj } from "@storybook/react"; -import { EvaluationAction } from "../../types"; import { ProjectEvaluationAction } from "./ProjectEvaluationAction"; const onEvaluateAction = action("onEvaluate"); diff --git a/packages/ui/src/features/checker/components/ProjectEvaluationAction/ProjectEvaluationAction.tsx b/apps/checker/src/components/ProjectEvaluationAction/ProjectEvaluationAction.tsx similarity index 88% rename from packages/ui/src/features/checker/components/ProjectEvaluationAction/ProjectEvaluationAction.tsx rename to apps/checker/src/components/ProjectEvaluationAction/ProjectEvaluationAction.tsx index 156bde9f..522c6c61 100644 --- a/packages/ui/src/features/checker/components/ProjectEvaluationAction/ProjectEvaluationAction.tsx +++ b/apps/checker/src/components/ProjectEvaluationAction/ProjectEvaluationAction.tsx @@ -2,11 +2,9 @@ import { useEffect, useState } from "react"; -import { cn } from "@/lib/utils"; -import { Button } from "@/primitives/Button"; -import { IconType, Icon } from "@/primitives/Icon"; - -import { EvaluationAction, ProjectStatus } from "~checker/types"; +import { EvaluationAction, ProjectStatus } from "@gitcoin/types"; +import { Button, Icon, IconType } from "@gitcoin/ui"; +import { cn } from "@gitcoin/utils"; import { getButtonProps, evaluateProject } from "./utils"; diff --git a/packages/ui/src/features/checker/components/ProjectEvaluationAction/index.ts b/apps/checker/src/components/ProjectEvaluationAction/index.ts similarity index 100% rename from packages/ui/src/features/checker/components/ProjectEvaluationAction/index.ts rename to apps/checker/src/components/ProjectEvaluationAction/index.ts diff --git a/packages/ui/src/features/checker/components/ProjectEvaluationAction/utils.ts b/apps/checker/src/components/ProjectEvaluationAction/utils.ts similarity index 97% rename from packages/ui/src/features/checker/components/ProjectEvaluationAction/utils.ts rename to apps/checker/src/components/ProjectEvaluationAction/utils.ts index 178a1e88..fa6f8326 100644 --- a/packages/ui/src/features/checker/components/ProjectEvaluationAction/utils.ts +++ b/apps/checker/src/components/ProjectEvaluationAction/utils.ts @@ -1,8 +1,7 @@ +import { EvaluationAction, ProjectStatus } from "@gitcoin/types"; import { tv } from "tailwind-variants"; import { match } from "ts-pattern"; -import { EvaluationAction, ProjectStatus } from "~checker/types"; - const commonButtonStyles = "h-[36px] w-[111px] text-[14px]/[20px]"; // TODO instead of ts-pattern, use a more readable approach with tailwind compound variants export const variants = tv({ diff --git a/packages/ui/src/features/checker/components/ProjectEvaluationList/ProjectEvaluationList.tsx b/apps/checker/src/components/ProjectEvaluationList/ProjectEvaluationList.tsx similarity index 91% rename from packages/ui/src/features/checker/components/ProjectEvaluationList/ProjectEvaluationList.tsx rename to apps/checker/src/components/ProjectEvaluationList/ProjectEvaluationList.tsx index 2e699eab..b3da066e 100644 --- a/packages/ui/src/features/checker/components/ProjectEvaluationList/ProjectEvaluationList.tsx +++ b/apps/checker/src/components/ProjectEvaluationList/ProjectEvaluationList.tsx @@ -1,12 +1,10 @@ "use client"; -import { DefaultLogo } from "@/assets"; -import { IconLabel } from "@/components/IconLabel"; -import { CircleStat } from "@/primitives/Indicators"; -import { ListGrid, ListGridColumn } from "@/primitives/ListGrid"; +import { EvaluationAction, ProjectReview, ProjectStatus } from "@gitcoin/types"; +import { CircleStat, IconLabel, ListGrid, ListGridColumn } from "@gitcoin/ui"; +import { getReviewsCount } from "@gitcoin/utils/checker"; -import { EvaluationAction, ProjectReview, ProjectStatus } from "~checker/types"; -import { getReviewsCount } from "~checker/utils/getReviewsCount"; +import { DefaultLogo } from "@/assets"; import { ProjectEvaluationAction } from "../ProjectEvaluationAction"; import { ReviewsCounterLabelWithTooltip } from "../ReviewsCounterLabel"; diff --git a/packages/ui/src/features/checker/components/ProjectEvaluationList/index.ts b/apps/checker/src/components/ProjectEvaluationList/index.ts similarity index 100% rename from packages/ui/src/features/checker/components/ProjectEvaluationList/index.ts rename to apps/checker/src/components/ProjectEvaluationList/index.ts diff --git a/packages/ui/src/features/checker/components/ProjectReviewList/ProjectReviewList.stories.tsx b/apps/checker/src/components/ProjectReviewList/ProjectReviewList.stories.tsx similarity index 100% rename from packages/ui/src/features/checker/components/ProjectReviewList/ProjectReviewList.stories.tsx rename to apps/checker/src/components/ProjectReviewList/ProjectReviewList.stories.tsx diff --git a/packages/ui/src/features/checker/components/ProjectReviewList/ProjectReviewList.tsx b/apps/checker/src/components/ProjectReviewList/ProjectReviewList.tsx similarity index 92% rename from packages/ui/src/features/checker/components/ProjectReviewList/ProjectReviewList.tsx rename to apps/checker/src/components/ProjectReviewList/ProjectReviewList.tsx index abf7cdfc..da07a1e1 100644 --- a/packages/ui/src/features/checker/components/ProjectReviewList/ProjectReviewList.tsx +++ b/apps/checker/src/components/ProjectReviewList/ProjectReviewList.tsx @@ -1,12 +1,10 @@ "use client"; +import { ProjectReview } from "@gitcoin/types"; +import { ListGrid } from "@gitcoin/ui"; import { match } from "ts-pattern"; import { Address } from "viem"; -import { ListGrid } from "@/primitives/ListGrid"; - -import { ProjectReview } from "~checker/types"; - import { getProjectReviewListColumns, skeletonColumns, skeletonData } from "./utils"; export interface ProjectReviewListProps { diff --git a/packages/ui/src/features/checker/components/ProjectReviewList/index.ts b/apps/checker/src/components/ProjectReviewList/index.ts similarity index 100% rename from packages/ui/src/features/checker/components/ProjectReviewList/index.ts rename to apps/checker/src/components/ProjectReviewList/index.ts diff --git a/packages/ui/src/features/checker/components/ProjectReviewList/mocks.tsx b/apps/checker/src/components/ProjectReviewList/mocks.tsx similarity index 94% rename from packages/ui/src/features/checker/components/ProjectReviewList/mocks.tsx rename to apps/checker/src/components/ProjectReviewList/mocks.tsx index d81d9cab..77983284 100644 --- a/packages/ui/src/features/checker/components/ProjectReviewList/mocks.tsx +++ b/apps/checker/src/components/ProjectReviewList/mocks.tsx @@ -1,5 +1,5 @@ -import { addressFrom } from "@/lib"; -import { ProjectReview } from "../../types"; +import { ProjectReview } from "@gitcoin/types"; +import { addressFrom } from "@gitcoin/utils"; export const mockPendingReview0: ProjectReview[] = [ { diff --git a/packages/ui/src/features/checker/components/ProjectReviewList/utils/getGridCollumns.tsx b/apps/checker/src/components/ProjectReviewList/utils/getGridCollumns.tsx similarity index 90% rename from packages/ui/src/features/checker/components/ProjectReviewList/utils/getGridCollumns.tsx rename to apps/checker/src/components/ProjectReviewList/utils/getGridCollumns.tsx index ba70c277..6e77906f 100644 --- a/packages/ui/src/features/checker/components/ProjectReviewList/utils/getGridCollumns.tsx +++ b/apps/checker/src/components/ProjectReviewList/utils/getGridCollumns.tsx @@ -1,18 +1,13 @@ // utils/getProjectReviewListColumns.ts import React from "react"; +import { ProjectReview } from "@gitcoin/types"; +import { Button, CircleStat, IconLabel, ListGridColumn, Skeleton } from "@gitcoin/ui"; +import { getReviewsCount } from "@gitcoin/utils/checker"; import { Address } from "viem"; import { DefaultLogo } from "@/assets"; -import { IconLabel } from "@/components/IconLabel"; -import { Button } from "@/primitives/Button"; -import { CircleStat } from "@/primitives/Indicators"; -import { ListGridColumn } from "@/primitives/ListGrid"; -import { Skeleton } from "@/primitives/Skeleton"; - -import { ReviewsCounterLabelWithTooltip } from "~checker/components"; -import { ProjectReview } from "~checker/types"; -import { getReviewsCount } from "~checker/utils"; +import { ReviewsCounterLabelWithTooltip } from "@/components"; interface GetColumnsParams { reviewer?: Address; diff --git a/packages/ui/src/features/checker/components/ProjectReviewList/utils/index.ts b/apps/checker/src/components/ProjectReviewList/utils/index.ts similarity index 100% rename from packages/ui/src/features/checker/components/ProjectReviewList/utils/index.ts rename to apps/checker/src/components/ProjectReviewList/utils/index.ts diff --git a/packages/ui/src/features/checker/components/ReviewDropdown/ReviewDropdown.mdx b/apps/checker/src/components/ReviewDropdown/ReviewDropdown.mdx similarity index 100% rename from packages/ui/src/features/checker/components/ReviewDropdown/ReviewDropdown.mdx rename to apps/checker/src/components/ReviewDropdown/ReviewDropdown.mdx diff --git a/packages/ui/src/features/checker/components/ReviewDropdown/ReviewDropdown.stories.tsx b/apps/checker/src/components/ReviewDropdown/ReviewDropdown.stories.tsx similarity index 100% rename from packages/ui/src/features/checker/components/ReviewDropdown/ReviewDropdown.stories.tsx rename to apps/checker/src/components/ReviewDropdown/ReviewDropdown.stories.tsx diff --git a/packages/ui/src/features/checker/components/ReviewDropdown/ReviewDropdown.tsx b/apps/checker/src/components/ReviewDropdown/ReviewDropdown.tsx similarity index 96% rename from packages/ui/src/features/checker/components/ReviewDropdown/ReviewDropdown.tsx rename to apps/checker/src/components/ReviewDropdown/ReviewDropdown.tsx index b11be24c..3ee0e6b4 100644 --- a/packages/ui/src/features/checker/components/ReviewDropdown/ReviewDropdown.tsx +++ b/apps/checker/src/components/ReviewDropdown/ReviewDropdown.tsx @@ -2,15 +2,11 @@ import * as React from "react"; +import { Evaluation } from "@gitcoin/types"; +import { Accordion, Badge, Icon, IconType } from "@gitcoin/ui"; +import { cn, formatLocalDate, getAddressLabel, capitalizeWord } from "@gitcoin/utils"; import { tv, type VariantProps } from "tailwind-variants"; -import { cn, formatLocalDate, getAddressLabel, capitalizeWord } from "@/lib/utils"; -import { Accordion } from "@/primitives/Accordion"; -import { Badge } from "@/primitives/Badge"; -import { Icon, IconType } from "@/primitives/Icon"; - -import { Evaluation } from "../../types"; - const ReviewDropdownVariants = tv({ slots: { header: "flex w-full items-center justify-between gap-4 py-4 pr-2", diff --git a/packages/ui/src/features/checker/components/ReviewDropdown/index.ts b/apps/checker/src/components/ReviewDropdown/index.ts similarity index 100% rename from packages/ui/src/features/checker/components/ReviewDropdown/index.ts rename to apps/checker/src/components/ReviewDropdown/index.ts diff --git a/packages/ui/src/features/checker/components/ReviewDropdown/mockData.ts b/apps/checker/src/components/ReviewDropdown/mockData.ts similarity index 100% rename from packages/ui/src/features/checker/components/ReviewDropdown/mockData.ts rename to apps/checker/src/components/ReviewDropdown/mockData.ts diff --git a/packages/ui/src/features/checker/components/ReviewDropdownList/ReviewDropdownList.mdx b/apps/checker/src/components/ReviewDropdownList/ReviewDropdownList.mdx similarity index 100% rename from packages/ui/src/features/checker/components/ReviewDropdownList/ReviewDropdownList.mdx rename to apps/checker/src/components/ReviewDropdownList/ReviewDropdownList.mdx diff --git a/packages/ui/src/features/checker/components/ReviewDropdownList/ReviewDropdownList.stories.tsx b/apps/checker/src/components/ReviewDropdownList/ReviewDropdownList.stories.tsx similarity index 100% rename from packages/ui/src/features/checker/components/ReviewDropdownList/ReviewDropdownList.stories.tsx rename to apps/checker/src/components/ReviewDropdownList/ReviewDropdownList.stories.tsx diff --git a/packages/ui/src/features/checker/components/ReviewDropdownList/ReviewDropdownList.tsx b/apps/checker/src/components/ReviewDropdownList/ReviewDropdownList.tsx similarity index 92% rename from packages/ui/src/features/checker/components/ReviewDropdownList/ReviewDropdownList.tsx rename to apps/checker/src/components/ReviewDropdownList/ReviewDropdownList.tsx index 38a5ea96..fbfeac33 100644 --- a/packages/ui/src/features/checker/components/ReviewDropdownList/ReviewDropdownList.tsx +++ b/apps/checker/src/components/ReviewDropdownList/ReviewDropdownList.tsx @@ -1,10 +1,9 @@ "use client"; +import { Evaluation } from "@gitcoin/types"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; -import { cn } from "@/lib/utils"; - -import { Evaluation } from "../../types"; import { ReviewDropdown } from "../ReviewDropdown"; const reviewDropdownListVariants = tv({ diff --git a/packages/ui/src/features/checker/components/ReviewDropdownList/index.ts b/apps/checker/src/components/ReviewDropdownList/index.ts similarity index 100% rename from packages/ui/src/features/checker/components/ReviewDropdownList/index.ts rename to apps/checker/src/components/ReviewDropdownList/index.ts diff --git a/packages/ui/src/features/checker/components/ReviewsCounterLabel/ReviewsCounterLabel.stories.tsx b/apps/checker/src/components/ReviewsCounterLabel/ReviewsCounterLabel.stories.tsx similarity index 100% rename from packages/ui/src/features/checker/components/ReviewsCounterLabel/ReviewsCounterLabel.stories.tsx rename to apps/checker/src/components/ReviewsCounterLabel/ReviewsCounterLabel.stories.tsx diff --git a/packages/ui/src/features/checker/components/ReviewsCounterLabel/ReviewsCounterLabel.tsx b/apps/checker/src/components/ReviewsCounterLabel/ReviewsCounterLabel.tsx similarity index 97% rename from packages/ui/src/features/checker/components/ReviewsCounterLabel/ReviewsCounterLabel.tsx rename to apps/checker/src/components/ReviewsCounterLabel/ReviewsCounterLabel.tsx index 7e15267e..851c8533 100644 --- a/packages/ui/src/features/checker/components/ReviewsCounterLabel/ReviewsCounterLabel.tsx +++ b/apps/checker/src/components/ReviewsCounterLabel/ReviewsCounterLabel.tsx @@ -2,11 +2,10 @@ import React from "react"; +import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from "@gitcoin/ui"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; -import { cn } from "@/lib/utils"; -import { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from "@/ui-shadcn/tooltip"; - import { ReviewIconGroup, ReviewIconGroupProps } from "./components/ReviewIconGroup"; const variants = tv({ diff --git a/packages/ui/src/features/checker/components/ReviewsCounterLabel/ReviewsCouterLabelWithTooltip.stories.tsx b/apps/checker/src/components/ReviewsCounterLabel/ReviewsCouterLabelWithTooltip.stories.tsx similarity index 100% rename from packages/ui/src/features/checker/components/ReviewsCounterLabel/ReviewsCouterLabelWithTooltip.stories.tsx rename to apps/checker/src/components/ReviewsCounterLabel/ReviewsCouterLabelWithTooltip.stories.tsx diff --git a/packages/ui/src/features/checker/components/ReviewsCounterLabel/components/ReviewIcon.stories.tsx b/apps/checker/src/components/ReviewsCounterLabel/components/ReviewIcon.stories.tsx similarity index 100% rename from packages/ui/src/features/checker/components/ReviewsCounterLabel/components/ReviewIcon.stories.tsx rename to apps/checker/src/components/ReviewsCounterLabel/components/ReviewIcon.stories.tsx diff --git a/packages/ui/src/features/checker/components/ReviewsCounterLabel/components/ReviewIcon.tsx b/apps/checker/src/components/ReviewsCounterLabel/components/ReviewIcon.tsx similarity index 94% rename from packages/ui/src/features/checker/components/ReviewsCounterLabel/components/ReviewIcon.tsx rename to apps/checker/src/components/ReviewsCounterLabel/components/ReviewIcon.tsx index 35b8c055..6b3825a8 100644 --- a/packages/ui/src/features/checker/components/ReviewsCounterLabel/components/ReviewIcon.tsx +++ b/apps/checker/src/components/ReviewsCounterLabel/components/ReviewIcon.tsx @@ -1,8 +1,7 @@ +import { Icon, IconType } from "@gitcoin/ui"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; -import { cn } from "@/lib/utils"; -import { Icon, IconType } from "@/primitives/Icon"; - const iconType = { approved: IconType.CHECK, rejected: IconType.X, diff --git a/packages/ui/src/features/checker/components/ReviewsCounterLabel/components/ReviewIconGroup.stories.tsx b/apps/checker/src/components/ReviewsCounterLabel/components/ReviewIconGroup.stories.tsx similarity index 100% rename from packages/ui/src/features/checker/components/ReviewsCounterLabel/components/ReviewIconGroup.stories.tsx rename to apps/checker/src/components/ReviewsCounterLabel/components/ReviewIconGroup.stories.tsx diff --git a/packages/ui/src/features/checker/components/ReviewsCounterLabel/components/ReviewIconGroup.tsx b/apps/checker/src/components/ReviewsCounterLabel/components/ReviewIconGroup.tsx similarity index 100% rename from packages/ui/src/features/checker/components/ReviewsCounterLabel/components/ReviewIconGroup.tsx rename to apps/checker/src/components/ReviewsCounterLabel/components/ReviewIconGroup.tsx diff --git a/packages/ui/src/features/checker/components/ReviewsCounterLabel/index.ts b/apps/checker/src/components/ReviewsCounterLabel/index.ts similarity index 100% rename from packages/ui/src/features/checker/components/ReviewsCounterLabel/index.ts rename to apps/checker/src/components/ReviewsCounterLabel/index.ts diff --git a/packages/ui/src/features/checker/components/index.ts b/apps/checker/src/components/index.ts similarity index 100% rename from packages/ui/src/features/checker/components/index.ts rename to apps/checker/src/components/index.ts diff --git a/packages/ui/src/features/checker/constants/defaultStatCardProps.ts b/apps/checker/src/constants/defaultStatCardProps.ts similarity index 85% rename from packages/ui/src/features/checker/constants/defaultStatCardProps.ts rename to apps/checker/src/constants/defaultStatCardProps.ts index d61eae16..b6d87e7d 100644 --- a/packages/ui/src/features/checker/constants/defaultStatCardProps.ts +++ b/apps/checker/src/constants/defaultStatCardProps.ts @@ -1,4 +1,4 @@ -import { StatCardProps } from "@/primitives/StatCard"; +import { StatCardProps } from "@gitcoin/ui"; export const DefaultStatCardsProps = [ { diff --git a/packages/ui/src/features/checker/constants/index.ts b/apps/checker/src/constants/index.ts similarity index 100% rename from packages/ui/src/features/checker/constants/index.ts rename to apps/checker/src/constants/index.ts diff --git a/packages/ui/src/features/checker/hooks/index.ts b/apps/checker/src/hooks/index.ts similarity index 100% rename from packages/ui/src/features/checker/hooks/index.ts rename to apps/checker/src/hooks/index.ts diff --git a/packages/ui/src/features/checker/hooks/useApplicationEvaluations.ts b/apps/checker/src/hooks/useApplicationEvaluations.ts similarity index 88% rename from packages/ui/src/features/checker/hooks/useApplicationEvaluations.ts rename to apps/checker/src/hooks/useApplicationEvaluations.ts index df61b78b..eb370e7c 100644 --- a/packages/ui/src/features/checker/hooks/useApplicationEvaluations.ts +++ b/apps/checker/src/hooks/useApplicationEvaluations.ts @@ -1,10 +1,9 @@ "use client"; +import { getApplicationByIdFromIndexer } from "@gitcoin/services/allo"; +import { getCheckerApplicationEvaluations } from "@gitcoin/services/checker"; import { useQuery } from "@tanstack/react-query"; -import { getApplicationByIdFromIndexer } from "~checker/services/allo"; -import { getCheckerApplicationEvaluations } from "~checker/services/checker"; - export const useApplicationEvaluations = ( chainId: number, roundId: string, diff --git a/packages/ui/src/features/checker/hooks/useApplicationOverviewEvaluations.ts b/apps/checker/src/hooks/useApplicationOverviewEvaluations.ts similarity index 79% rename from packages/ui/src/features/checker/hooks/useApplicationOverviewEvaluations.ts rename to apps/checker/src/hooks/useApplicationOverviewEvaluations.ts index f5c60cf8..692e42b6 100644 --- a/packages/ui/src/features/checker/hooks/useApplicationOverviewEvaluations.ts +++ b/apps/checker/src/hooks/useApplicationOverviewEvaluations.ts @@ -1,8 +1,8 @@ "use client"; -import { useCheckerContext } from "@/features/checker/store/hooks/useCheckerContext"; +import { generatePoolUUID } from "@gitcoin/utils/checker"; -import { generatePoolUUID } from "~checker/utils/generatePoolUUID"; +import { useCheckerContext } from "@/store/hooks/useCheckerContext"; export const useApplicationOverviewEvaluations = ({ applicationId }: { applicationId: string }) => { const { poolId, chainId, poolsData } = useCheckerContext(); diff --git a/packages/ui/src/features/checker/hooks/useGetApplicationsFinalEvaluationPage.ts b/apps/checker/src/hooks/useGetApplicationsFinalEvaluationPage.ts similarity index 80% rename from packages/ui/src/features/checker/hooks/useGetApplicationsFinalEvaluationPage.ts rename to apps/checker/src/hooks/useGetApplicationsFinalEvaluationPage.ts index 6d6fd269..3bc5119e 100644 --- a/packages/ui/src/features/checker/hooks/useGetApplicationsFinalEvaluationPage.ts +++ b/apps/checker/src/hooks/useGetApplicationsFinalEvaluationPage.ts @@ -1,13 +1,11 @@ "use client"; +import { ApplicationStatusType, PoolType, ReviewBody } from "@gitcoin/types"; +import { categorizeProjectReviews, generatePoolUUID } from "@gitcoin/utils/checker"; import { Address } from "viem"; -import { useCheckerContext } from "@/features/checker/store/hooks/useCheckerContext"; -import { PoolType } from "@/types"; - -import { DefaultStatCardsProps } from "~checker/constants"; -import { ApplicationStatusType, ReviewBody } from "~checker/types"; -import { categorizeProjectReviews, generatePoolUUID } from "~checker/utils"; +import { DefaultStatCardsProps } from "@/constants"; +import { useCheckerContext } from "@/store/hooks/useCheckerContext"; export const useGetApplicationsFinalEvaluationPage = () => { const { poolId, chainId, poolsData, poolsFetchState } = useCheckerContext(); diff --git a/packages/ui/src/features/checker/hooks/useGetApplicationsReviewPage.ts b/apps/checker/src/hooks/useGetApplicationsReviewPage.ts similarity index 76% rename from packages/ui/src/features/checker/hooks/useGetApplicationsReviewPage.ts rename to apps/checker/src/hooks/useGetApplicationsReviewPage.ts index 84d2b59a..e54f0c5c 100644 --- a/packages/ui/src/features/checker/hooks/useGetApplicationsReviewPage.ts +++ b/apps/checker/src/hooks/useGetApplicationsReviewPage.ts @@ -1,9 +1,9 @@ "use client"; -import { useCheckerContext } from "@/features/checker/store/hooks/useCheckerContext"; +import { categorizeProjectReviews, generatePoolUUID } from "@gitcoin/utils/checker"; -import { DefaultStatCardsProps } from "~checker/constants"; -import { categorizeProjectReviews, generatePoolUUID } from "~checker/utils"; +import { DefaultStatCardsProps } from "@/constants"; +import { useCheckerContext } from "@/store/hooks/useCheckerContext"; export const useGetApplicationsReviewPage = () => { const { poolId, chainId, poolsData, poolsFetchState } = useCheckerContext(); diff --git a/packages/ui/src/features/checker/hooks/useGetPastApplications.ts b/apps/checker/src/hooks/useGetPastApplications.ts similarity index 88% rename from packages/ui/src/features/checker/hooks/useGetPastApplications.ts rename to apps/checker/src/hooks/useGetPastApplications.ts index b40ea9f5..7601d1a7 100644 --- a/packages/ui/src/features/checker/hooks/useGetPastApplications.ts +++ b/apps/checker/src/hooks/useGetPastApplications.ts @@ -1,9 +1,8 @@ "use client"; +import { getPastApplicationsByApplicationIdFromIndexer } from "@gitcoin/services/allo"; import { useQuery } from "@tanstack/react-query"; -import { getPastApplicationsByApplicationIdFromIndexer } from "~checker/services/allo"; - export const useGetPastApplications = (chainId: number, roundId: string, applicationId: string) => { const query = useQuery({ enabled: !!applicationId && !!roundId && !!chainId, diff --git a/packages/ui/src/features/checker/hooks/useInitialize.ts b/apps/checker/src/hooks/useInitialize.ts similarity index 96% rename from packages/ui/src/features/checker/hooks/useInitialize.ts rename to apps/checker/src/hooks/useInitialize.ts index 336ac55b..e49ee04f 100644 --- a/packages/ui/src/features/checker/hooks/useInitialize.ts +++ b/apps/checker/src/hooks/useInitialize.ts @@ -4,7 +4,7 @@ import { useEffect } from "react"; import { Hex } from "viem"; -import { setInitialStateAction, useCheckerDispatchContext } from "~checker/store"; +import { setInitialStateAction, useCheckerDispatchContext } from "@/store"; import { usePoolData } from "./usePoolData"; diff --git a/packages/ui/src/features/checker/hooks/usePerformEvaluation.ts b/apps/checker/src/hooks/usePerformEvaluation.ts similarity index 92% rename from packages/ui/src/features/checker/hooks/usePerformEvaluation.ts rename to apps/checker/src/hooks/usePerformEvaluation.ts index c7adaaa1..ec77797f 100644 --- a/packages/ui/src/features/checker/hooks/usePerformEvaluation.ts +++ b/apps/checker/src/hooks/usePerformEvaluation.ts @@ -2,12 +2,11 @@ import { useState, useEffect } from "react"; +import { submitEvaluation } from "@gitcoin/services/checker"; +import { EvaluationBody } from "@gitcoin/types"; import { useMutation } from "@tanstack/react-query"; import { Hex } from "viem"; -import { submitEvaluation } from "~checker/services/checker/api"; -import { EvaluationBody } from "~checker/types"; - export const usePerformEvaluation = () => { const [evaluationBody, setEvaluationBody] = useState(null); diff --git a/packages/ui/src/features/checker/hooks/usePerformOnChainReview.ts b/apps/checker/src/hooks/usePerformOnChainReview.ts similarity index 93% rename from packages/ui/src/features/checker/hooks/usePerformOnChainReview.ts rename to apps/checker/src/hooks/usePerformOnChainReview.ts index 1823b7b3..1756029d 100644 --- a/packages/ui/src/features/checker/hooks/usePerformOnChainReview.ts +++ b/apps/checker/src/hooks/usePerformOnChainReview.ts @@ -2,13 +2,11 @@ import { useState, useEffect, useMemo } from "react"; +import { ReviewBody } from "@gitcoin/types"; +import { getOnchainEvaluationProgressSteps } from "@gitcoin/ui"; +import { ProgressStatus, Step } from "@gitcoin/ui/types"; import { useMutation } from "@tanstack/react-query"; -import { getOnchainEvaluationProgressSteps } from "@/components/ProgressModal"; -import { ProgressStatus } from "@/types"; - -import { ReviewBody } from "../types"; - export const usePerformOnChainReview = () => { const [reviewBody, setReviewBody] = useState(null); const [contractUpdatingStatus, setContractUpdatingStatus] = useState( @@ -75,7 +73,7 @@ export const usePerformOnChainReview = () => { } }, [evaluationMutation.isSuccess]); - const steps = useMemo(() => { + const steps: Step[] = useMemo(() => { return getOnchainEvaluationProgressSteps({ contractUpdatingStatus, indexingStatus, diff --git a/packages/ui/src/features/checker/hooks/usePoolData.ts b/apps/checker/src/hooks/usePoolData.ts similarity index 89% rename from packages/ui/src/features/checker/hooks/usePoolData.ts rename to apps/checker/src/hooks/usePoolData.ts index cfeb2a7e..e3c4e359 100644 --- a/packages/ui/src/features/checker/hooks/usePoolData.ts +++ b/apps/checker/src/hooks/usePoolData.ts @@ -2,20 +2,18 @@ import { useEffect } from "react"; +import { getApplicationsFromIndexer } from "@gitcoin/services/allo"; +import { getCheckerPoolData, syncPool, SyncPoolBody } from "@gitcoin/services/checker"; +import { CheckerApplication, CheckerPoolData, PoolInfo } from "@gitcoin/types"; +import { generatePoolUUID, isPoolManager } from "@gitcoin/utils/checker"; import { useQuery } from "@tanstack/react-query"; -import { getApplicationsFromIndexer } from "~checker/services/allo"; -import { getCheckerPoolData, syncPool, SyncPoolBody } from "~checker/services/checker"; import { - CheckerApplication, - CheckerPoolData, - PoolInfo, setPoolDataAction, setPoolFetchStateAction, useCheckerContext, useCheckerDispatchContext, -} from "~checker/store"; -import { generatePoolUUID, isPoolManager } from "~checker/utils"; +} from "@/store"; export const usePoolData = (): { poolData: CheckerPoolData | null; refetch: () => void } => { const { poolsData, poolId, chainId, address } = useCheckerContext(); diff --git a/packages/ui/src/features/checker/hooks/usePoolManager.ts b/apps/checker/src/hooks/usePoolManager.ts similarity index 76% rename from packages/ui/src/features/checker/hooks/usePoolManager.ts rename to apps/checker/src/hooks/usePoolManager.ts index d072d033..ed22d561 100644 --- a/packages/ui/src/features/checker/hooks/usePoolManager.ts +++ b/apps/checker/src/hooks/usePoolManager.ts @@ -1,8 +1,8 @@ "use client"; -import { useCheckerContext } from "@/features/checker/store/hooks/useCheckerContext"; +import { generatePoolUUID } from "@gitcoin/utils/checker"; -import { generatePoolUUID } from "~checker/utils"; +import { useCheckerContext } from "@/store"; export const usePoolManager = () => { const { poolId, chainId, poolsData, poolsFetchState } = useCheckerContext(); diff --git a/packages/ui/src/features/checker/index.ts b/apps/checker/src/index.ts similarity index 60% rename from packages/ui/src/features/checker/index.ts rename to apps/checker/src/index.ts index 118ee49f..7daaa790 100644 --- a/packages/ui/src/features/checker/index.ts +++ b/apps/checker/src/index.ts @@ -3,9 +3,5 @@ export * from "./components"; export * from "./hooks"; export * from "./pages"; export * from "./routers"; -export * from "./services/allo"; -export * from "./services/checker"; export * from "./store"; -export * from "./types"; -export * from "./utils"; export * from "./constants"; diff --git a/apps/checker/src/mocks/handlers.ts b/apps/checker/src/mocks/handlers.ts new file mode 100644 index 00000000..7b2565e0 --- /dev/null +++ b/apps/checker/src/mocks/handlers.ts @@ -0,0 +1,67 @@ +import { http, HttpResponse } from "msw"; +import { graphql } from "msw"; + +import { applicationsForManagers } from "./mockData/applicationsForManager"; +import { rounds } from "./mockData/rounds"; + +import { checkerApplicationEvaluations } from "./mockData/checkerApplicationEvaluations"; +import { checkerPoolData } from "./mockData/checkerPoolData"; +import { getApplicationById } from "./mockData/indexerGetApplicationById"; +import { pastApplicationsByApplicationId } from "./mockData/pastApplicationsByApplicationId"; + +export const taskListHandler = http.get("https://jsonplaceholder.typicode.com/todos", () => { + return HttpResponse.json([ + { userId: 1, id: 1, title: "Mocked Task 1", completed: false }, + { userId: 1, id: 2, title: "Mocked Task 2", completed: true }, + ]); +}); + +export const taskListHandlerWithError = http.get( + "https://jsonplaceholder.typicode.com/todos", + () => { + return HttpResponse.error(); + }, +); + +export const applicationForManagerHandler = graphql.query("getApplicationsForManager", () => { + return HttpResponse.json(applicationsForManagers); +}); + +export const getRoundHandler = graphql.query("getRound", () => { + return HttpResponse.json(rounds); +}); + +export const checkerPoolDataHandler = graphql.query("getCheckerPoolData", () => { + return HttpResponse.json({ + data: { pools: [checkerPoolData] }, + }); +}); + +export const indexerGetApplicationByIdHandler = graphql.query("getApplicationByIdQuery", () => { + return HttpResponse.json({ data: { applications: [getApplicationById] } }); +}); + +export const checkerApplicationEvaluationsHandler = graphql.query( + "getCheckerApplicationEvaluations", + () => { + return HttpResponse.json({ + data: { applications: [{ evaluations: checkerApplicationEvaluations }] }, + }); + }, +); + +export const getPastApplicationsByApplicationIdHandler = graphql.query( + "getPastApplicationsByApplicationId", + () => { + return HttpResponse.json({ data: pastApplicationsByApplicationId }); + }, +); + +export const handlers = [ + taskListHandler, + applicationForManagerHandler, + checkerPoolDataHandler, + indexerGetApplicationByIdHandler, + checkerApplicationEvaluationsHandler, + getPastApplicationsByApplicationIdHandler, +]; diff --git a/apps/checker/src/mocks/mockData/applicationsForManager.ts b/apps/checker/src/mocks/mockData/applicationsForManager.ts new file mode 100644 index 00000000..bdd134b1 --- /dev/null +++ b/apps/checker/src/mocks/mockData/applicationsForManager.ts @@ -0,0 +1,867 @@ +export const applicationsForManagers = { + data: { + applications: [ + { + id: "0", + projectId: "0x73980e4a960128ce20b1deb65678e7e215b1971b6908bfe7d204acb9420180c5", + chainId: 11155111, + roundId: "597", + status: "APPROVED", + metadataCid: "bafkreifjme522lkag5yz5hzdwqxvicc4jubfyuxw5nr2h3ixzvo4xzipim", + metadata: { + signature: + "0x47a5468e6b2a714245bda1725c625b929e5c1afbb765d531d810b6fb0b596eb02a02647d8ffbdd7f061cf76f070d09b1259b45e347a51b775cc7bd749f8ba2dc1c", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0x73980e4a960128ce20b1deb65678e7e215b1971b6908bfe7d204acb9420180c5", + title: "test", + metaPtr: { + pointer: "bafkreif67gqngagnukgkxzyt4gvnqcdohoolimjl4vpytzvhk5meh3v3ii", + protocol: "undefined", + }, + website: "https://example.com", + createdAt: 1716743685304, + credentials: {}, + description: "test", + lastUpdated: 0, + }, + recipient: "0x044B595C9b94A17Adc489bD29696af40ccb3E4d2", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-28T02:18:48.000Z", + updatedAtBlock: "7167075", + }, + { + status: "APPROVED", + updatedAt: "2024-11-28T14:09:00.000Z", + updatedAtBlock: "7170428", + }, + ], + anchorAddress: "0xb543d56ee04f516602057429ec4f1c85c19b1319", + project: { + projectRoles: [ + { + address: "0x0d1781f0b693b35939a49831a6c799b938bd2f80", + }, + ], + }, + }, + { + id: "1", + projectId: "0x0ad4d07d45ef3c6807b71f09342201baee881e13b67906d7067df59588dd4879", + chainId: 11155111, + roundId: "597", + status: "REJECTED", + metadataCid: "bafkreieltkyaoisfno7baeqwun63etfojflvd3c6mpk3w3lhe4kvvg5qam", + metadata: { + signature: + "0x43b0fc0cfac3f6863a716c75d4349cfb7440f27be2b1094d22d68a6b6fced94a2e1aa80d019dd42ec96e8803194d7c127852ec216aa87ffdd1aa31048da89e1b1b", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0x0ad4d07d45ef3c6807b71f09342201baee881e13b67906d7067df59588dd4879", + title: "Unicorn Party", + logoImg: "bafkreibmnvdglgcqhapu3mgusoqkhkoiwdqzxk22cy2lthp4v2cgl5zvp4", + metaPtr: { + pointer: "bafkreiazbhtmk7u5wjjq5qfedl6lxuznpmrohbca6nhpk52yt3wt7dfuiu", + protocol: "undefined", + }, + website: "https://unicorn.party", + bannerImg: "bafkreifvew4vbw4bps3554gz5xwgzuaimfzuammpjlsyzcd5o3clj24g3e", + createdAt: 1710424429780, + credentials: {}, + description: "I'm a fancy party unicorn", + lastUpdated: 0, + }, + recipient: "0x5645bF145C3f1E974D0D7FB91bf3c68592ab5012", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-28T09:19:00.000Z", + updatedAtBlock: "7169067", + }, + { + status: "REJECTED", + updatedAt: "2024-11-28T14:09:00.000Z", + updatedAtBlock: "7170428", + }, + ], + anchorAddress: "0x3bbb6cd15ff7d268640409aef5b2d407d4891276", + project: { + projectRoles: [ + { + address: "0x5645bf145c3f1e974d0d7fb91bf3c68592ab5012", + }, + ], + }, + }, + { + id: "10", + projectId: "0x6aa53fe03888bf2bbf159644205a9e6fe0d96fd493366c53726b2b0c38f52ca1", + chainId: 11155111, + roundId: "597", + status: "PENDING", + metadataCid: "bafkreibyib6252hqlb2plteuwekkwzjrzq3mjg3hgykjdywlkoz2mjt6zi", + metadata: { + signature: + "0xf788068d38e81ec85809c72ffd6a89d6c0d6f289e59f6521cf0593007cbf427d732f5b4cbceed2e2d8cf4b461e1982df35768f05737613722f7700e27cc53bec1b", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0x6aa53fe03888bf2bbf159644205a9e6fe0d96fd493366c53726b2b0c38f52ca1", + title: "My P-P-Protocol", + logoImg: "bafkreigyvk2btilf3tvmmxkimnmylj3uhst2b3axjtglw6qn5lkr4oqmo4", + metaPtr: { + pointer: "bafkreic7im7e5gksczjjdtk6yq5fjwju3wkmabtt5f5nek5yb4mi2jeq6e", + protocol: "undefined", + }, + website: "https://p-protoco.ll", + bannerImg: "bafybeigxn2sukxye4sfktemcancg2pu6x6nrnyzklfymwsu4nat45rba6e", + createdAt: 1706182533442, + credentials: {}, + description: + '```\nexport async function getCurrentSubgraphBlockNumber(\n chainId: number\n): Promise {\n try {\n const res = await graphql_fetch(\n `\n {\n _meta {\n block {\n number,\n hash\n }\n }\n }\n `,\n chainId\n );\n return BigInt(res.data._meta.block.number);\n } catch (error) {\n console.error(\n "An error occurred while fetching current subgraph block number:",\n error\n );\n throw error;\n }\n}\n```', + lastUpdated: 0, + }, + recipient: "0xE7eB5D2b5b188777df902e89c54570E7Ef4F59CE", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-29T16:28:00.000Z", + updatedAtBlock: "7177901", + }, + ], + anchorAddress: "0x3cdcb6611703a053751d2e82accd4daeb913aaa6", + project: { + projectRoles: [ + { + address: "0xe7eb5d2b5b188777df902e89c54570e7ef4f59ce", + }, + ], + }, + }, + { + id: "11", + projectId: "0xa28a0d75acc28d4d53423bf40b6eae6039348a385caf83022d6d937830b59b1a", + chainId: 11155111, + roundId: "597", + status: "PENDING", + metadataCid: "bafkreib5sms7kbgm62boquexl7rhdpm5vs3mslaolwwajnmqpath7uf2ma", + metadata: { + signature: + "0x1ca1f60de90877a08d1f30fb2f82e27680de32ed789f40cc9ca36072dc21c2c9036bb14324081f226c83d319ecc1de7f87cd217f15535971dbc1668ad17994f31b", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0xa28a0d75acc28d4d53423bf40b6eae6039348a385caf83022d6d937830b59b1a", + title: "🦄 No Money Donations 🌈", + logoImg: "bafkreidzsmnckc4fvm7mz4y642ihjsqjlrb4hr4llhdpks6xcopjdfnprm", + metaPtr: { + pointer: "bafkreiepmtbpydjtuk4u5ns3ggh3my52enimsr7viogf7hse7ujrz4ihku", + protocol: "undefined", + }, + website: "https://no-money-no-probl.em", + bannerImg: "bafkreif2wedknble4lyq3u2dzp2bhwkdfg6hk7k4efxzlnzi5cpl2rrgxy", + createdAt: 1711561335428, + credentials: {}, + description: + "![Meme](https://i.imgflip.com/8kpdwx.jpg)\n\n# 🦄 No Money Donations 🌈\n\n## Introduction\n\n🚀 Welcome to our magical idea about No Money Donations! We believe in redefining the art of giving. 🌟\n\n## The Idea\n\n💡 Picture a world where donations are more than just money. Here, we embrace the idea of gifting Idea Validation, Feedback, Resources (including mystical credits), Mentorship and others! 🌟✨\n\n## Highlights\n\n### 🌈 Idea Validation\n- Contributing idea validation empowers projects to refine their visions and ensure their concepts are viable. It's like granting wings to dreams, allowing them to soar into reality!\n\n### 🚀 Feedback\n- Feedback is the heartbeat of progress. Those who offer feedback provide invaluable insights that shape the trajectory of a project, guiding it toward success in the vast cosmos of Web3!\n\n### 💎 Resources\n- Resources are the building blocks of magic. With every resource donation, contributors provide the necessary spark to ignite a project's potential and illuminate the path forward! (e.g.Alchemy donates credits)\n\n### 🦄 Mentorship\n- Mentorship is the guiding star in the constellation of learning. Donors who offer mentorship share their wisdom, nurturing the next generation of Web3 innovators and fostering a community of collaboration and growth!\n", + lastUpdated: 0, + }, + recipient: "0xE7eB5D2b5b188777df902e89c54570E7Ef4F59CE", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-29T16:29:12.000Z", + updatedAtBlock: "7177907", + }, + ], + anchorAddress: "0x2c7296a5ec0539f0a018c7176c97c92a9c44e2b4", + project: { + projectRoles: [ + { + address: "0xe7eb5d2b5b188777df902e89c54570e7ef4f59ce", + }, + ], + }, + }, + { + id: "12", + projectId: "0xa55516f1a6564b3b645e81d2cd28fab3197ef6d4148da9c96729275957a4fe3a", + chainId: 11155111, + roundId: "597", + status: "PENDING", + metadataCid: "bafkreid4g3rhlf2hm5y6xc65iolh6wj6dqs7jjjbk7pktva7vognxtcbky", + metadata: { + signature: + "0x0a5bc2e5a6ec225d30c051f84bbfdf7219f5437b5cdbc1d3cde3530948ee26ce03b01e075127c961bef15895fc7cfe1bcc06c54407b6e4111c5bbb4f327dd52b1c", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0xa55516f1a6564b3b645e81d2cd28fab3197ef6d4148da9c96729275957a4fe3a", + title: "Hyper Fi", + logoImg: "bafkreidta7stwoltp4fc57cqkora5dsd6digvfmsr7npqpsollmt2rhira", + metaPtr: { + pointer: "bafkreibfre4mapst7zpwnov5ntccealoqbdpqqjyfr6t2o3d7cuydn7taq", + protocol: "undefined", + }, + website: "https://hyper.fi", + bannerImg: "bafkreignlptdxbg7e3ulakm4ysp3yyownnhbze52aq7gukxntxs7ha62vi", + createdAt: 1706183130614, + credentials: {}, + description: + "Create a Project\n\nExit\nProject Details\nTell us more about what you’re working on.\n\nNeed Help? Check out the Builder Guide.\n\nCreate a Project\n\nExit\nProject Details\nTell us more about what you’re working on.\n\nNeed Help? Check out the Builder Guide.", + lastUpdated: 0, + }, + recipient: "0xE7eB5D2b5b188777df902e89c54570E7Ef4F59CE", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-29T16:29:48.000Z", + updatedAtBlock: "7177910", + }, + ], + anchorAddress: "0x739dba380a2e448d66492a19f1efbec4228834ce", + project: { + projectRoles: [ + { + address: "0xe7eb5d2b5b188777df902e89c54570e7ef4f59ce", + }, + ], + }, + }, + { + id: "13", + projectId: "0xbfb3108c07f6078eec1a837d3e1a6a3fef455153d7982f36e7d50a2307a3b78b", + chainId: 11155111, + roundId: "597", + status: "PENDING", + metadataCid: "bafkreifvzlaew5it64h5k7vt4kuwmswoyujtd4dsk7hlm6eizee3lmxhce", + metadata: { + signature: + "0x9078ce2fb34416d793b0eaf17a1f46f0058a64a35d9447b2f8ea0a13f8b7a5e7759569aac2f1f57f0dc440f094ec9a3178d7ca975939920a07f0b187763e38f81c", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0xbfb3108c07f6078eec1a837d3e1a6a3fef455153d7982f36e7d50a2307a3b78b", + title: "Fancy Protocol", + logoImg: "bafkreibphyxfwmbsyz7yne2mxrj4xuejhfuqd25pt4p3rhh6odo2ixl7mi", + metaPtr: { + pointer: "bafkreihzxjvcyc26djnmfi5ui6tdbyam5s73ee7p2b34ijyh7spoz6urqq", + protocol: "undefined", + }, + website: "https://proto.col", + bannerImg: "bafkreif55jmzeppdbp64axpyfzd5ie3a4ncyvtvcgbhl77salweajdupse", + createdAt: 1706182326732, + credentials: {}, + description: + "Create a Project\n\nExit\nProject Details\nTell us more about what you’re working on.\n\nNeed Help? Check out the Builder Guide.\n\nCreate a Project\n\nExit\nProject Details\nTell us more about what you’re working on.\n\nNeed Help? Check out the Builder Guide.\n\nCreate a Project\n\nExit\nProject Details\nTell us more about what you’re working on.\n\nNeed Help? Check out the Builder Guide.", + lastUpdated: 0, + }, + recipient: "0xE7eB5D2b5b188777df902e89c54570E7Ef4F59CE", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-29T16:31:12.000Z", + updatedAtBlock: "7177917", + }, + ], + anchorAddress: "0x0193b4e5d895292ee332fe6b624dd5091d43cf75", + project: { + projectRoles: [ + { + address: "0xe7eb5d2b5b188777df902e89c54570e7ef4f59ce", + }, + ], + }, + }, + { + id: "14", + projectId: "0xbfe075166257fda5b915e3dda8be67b44b2db34ddf476841b1e7aa33a5e13db2", + chainId: 11155111, + roundId: "597", + status: "PENDING", + metadataCid: "bafkreif5zzwdih6nskotcjeqhw644mlyklql2vfaxwgfsbqckj6qdpagjq", + metadata: { + signature: + "0x5495386555469895ccb62e5955df0fc5771349dddcf4a0ab40dac81bb1c64d2c6776be690f4f6e67826a40775b5e4c7d0ab255f1a36e4eed1c80f37aac6ec2db1c", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0xbfe075166257fda5b915e3dda8be67b44b2db34ddf476841b1e7aa33a5e13db2", + title: "i bims 1canonical project", + logoImg: "bafkreicj544ax6cqp6djv6wxdhjhnaxlkxoqz3j2t4ovelbpshqqwek5dm", + metaPtr: { + pointer: "QmRiSvrAubP1KGhMxRj7TBaQ3ecvipM5N5nyiJDYF5e9dR", + protocol: "undefined", + }, + website: "https://edit.test", + bannerImg: "bafkreigdncuoyfsjiyxnu7fkoz4vpvgmapgtnhpdrh7cfztq24uhuwhcvi", + createdAt: 1706689434128, + credentials: {}, + description: + "Create a Project\n\nExit\nProject Details\nTell us more about what you’re working on.\n\nNeed Help? Check out the Builder Guide.\n\nCreate a Project\n\nExit\nProject Details\nTell us more about what you’re working on.\n\nNeed Help? Check out the Builder Guide.\n", + lastUpdated: 0, + }, + recipient: "0xE7eB5D2b5b188777df902e89c54570E7Ef4F59CE", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-29T16:32:12.000Z", + updatedAtBlock: "7177922", + }, + ], + anchorAddress: "0xf490040fc45b7405dd695be07f09125a2e75c7a3", + project: { + projectRoles: [ + { + address: "0xe7eb5d2b5b188777df902e89c54570e7ef4f59ce", + }, + ], + }, + }, + { + id: "15", + projectId: "0x05a1ab158427c9d0a777ee5e257c2986671f509bb8507565dd147b52d2df9cb7", + chainId: 11155111, + roundId: "597", + status: "PENDING", + metadataCid: "bafkreiag2pbnjz6n7wtmycqvajb5srd6cjpwbdxwwje43qgtpxgojyobii", + metadata: { + signature: + "0x10c4cf4dd2509f4c9663da71681d6eb16853ef5b14a2abe37fde00e41e6321b8764d0dbbb557980736cf335e739f304622400d7bfcb6ce957106313a8f4850301c", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0x05a1ab158427c9d0a777ee5e257c2986671f509bb8507565dd147b52d2df9cb7", + title: "Kurts v2 Test Project EDITED - WHOOP", + logoImg: "bafkreifa6xbq5lbj47lpqqf75jqjln6kfpyhqeedp75q7mbh3kas6oflee", + metaPtr: { + pointer: "bafkreidywd4q2flryp5rg6z7xcd44jdmwkxqao33lqkp56aqj23jmdoirq", + protocol: "undefined", + }, + website: "https://https://test.ts", + bannerImg: "bafkreid7hbtuc6ijqwdkr3exh2cq6rmz32genm33l7wlr2yqdusbfvuode", + createdAt: 1706133254506, + credentials: {}, + description: + "Create a Project\n\n# Exit\nProject Details\nTell us more about what you’re working on.\n\nNeed Help? Check out the Builder Guide.", + lastUpdated: 0, + }, + recipient: "0xE7eB5D2b5b188777df902e89c54570E7Ef4F59CE", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-29T16:35:00.000Z", + updatedAtBlock: "7177935", + }, + ], + anchorAddress: "0x656f2087b0c88370f74d3ed481694c99b7dcc035", + project: { + projectRoles: [ + { + address: "0xe7eb5d2b5b188777df902e89c54570e7ef4f59ce", + }, + ], + }, + }, + { + id: "2", + projectId: "0x19c7d2edfb225469d13291655c29d599fff7ab1b73a7eddd34ecc1e3951623ac", + chainId: 11155111, + roundId: "597", + status: "REJECTED", + metadataCid: "bafkreidj7lbw44m2bn7jvfgmpb5zhoixqluxwbhxfc2jttfrd6njmvebfe", + metadata: { + signature: + "0x9a193d4791395297b7e599926aed33dfd423bdac573f4367b2e8c5b7c4ef847725d23effc8444eba1cca49e75ae4c60cf0f39846dab0d243c4402bffa135bceb1b", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0x19c7d2edfb225469d13291655c29d599fff7ab1b73a7eddd34ecc1e3951623ac", + title: "Hello World", + logoImg: "bafkreie3vx7ttxmkotqsg75p3yyqzxcjelefl3qyihzraaxnh7maovq2tu", + metaPtr: { + pointer: "bafkreidnuwhlxwm6qqcapqxrqd6qfa5ho5ekgiz4gr5wnhm2y3edo3olym", + protocol: "undefined", + }, + website: "https://hello.world", + bannerImg: "bafkreiekpv3dtxaes5jqjd45jmwhsyrrtto6rqwc2yviyekcauegmmntuq", + createdAt: 1719928034540, + credentials: {}, + description: "Some random description", + lastUpdated: 0, + }, + recipient: "0x5645bF145C3f1E974D0D7FB91bf3c68592ab5012", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-28T09:19:48.000Z", + updatedAtBlock: "7169071", + }, + { + status: "REJECTED", + updatedAt: "2024-11-28T14:09:00.000Z", + updatedAtBlock: "7170428", + }, + ], + anchorAddress: "0x98df600f5676cb7b06d4ecd2c7c9df9a866d45a0", + project: { + projectRoles: [ + { + address: "0x5645bf145c3f1e974d0d7fb91bf3c68592ab5012", + }, + ], + }, + }, + { + id: "3", + projectId: "0x8d3610fd13ff40515606fbc1466564c7f11b74941dd9739a378ce7c8d5a1f9da", + chainId: 11155111, + roundId: "597", + status: "REJECTED", + metadataCid: "bafkreicm3jnpszyt4xypfytddzwwme2siodb2p3pl2c6w6f5dpemgj5fui", + metadata: { + signature: + "0x550683581840386239ac8083541561cd8f07799865a9f2485e9823eba33f20810f45a0c574364bf615532e19e063b889c38d9683ca9d26d52704a4f509e3efcd1b", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0x8d3610fd13ff40515606fbc1466564c7f11b74941dd9739a378ce7c8d5a1f9da", + title: "Uni Corn 🌽", + logoImg: "bafkreiazs4hmxmlg37n2xsctez6nwpxi323pak2shek6lj2fqbt2cksdvu", + metaPtr: { + pointer: "bafkreicjoebgoh6aaopgklqllcdfp2wzorsdsouh5oxakt4tb2s4vhtdpe", + protocol: "undefined", + }, + website: "https://uni.corn", + bannerImg: "bafkreiet7e2d7zjvajzb6u7tkpwotgvty2g2yaklume2quw7cp3bdeuhpe", + createdAt: 1711023991589, + userGithub: "0xKurt", + credentials: { + github: { + type: ["VerifiableCredential"], + proof: { + jws: "eyJhbGciOiJFZERTQSIsImNyaXQiOlsiYjY0Il0sImI2NCI6ZmFsc2V9..JBwNUeJVu_aWHYCEnnUm_7u47WoADQMBZ7l7pgUklKqvBK3ugh09q3L4owu11Y7B8CQsu4rfcPioJnqdGKa1BA", + type: "Ed25519Signature2018", + created: "2024-04-20T05:33:39.773Z", + proofPurpose: "assertionMethod", + verificationMethod: + "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC#z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC", + }, + issuer: "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC", + "@context": ["https://www.w3.org/2018/credentials/v1"], + issuanceDate: "2024-04-20T05:33:39.773Z", + expirationDate: "2024-07-19T05:33:39.773Z", + credentialSubject: { + id: "did:pkh:eip155:1:0x5645bF145C3f1E974D0D7FB91bf3c68592ab5012", + hash: "v0.0.0:mW9x968bbmCJLjefqGWnTHm5w7PoZSMtd+avxdQiGCk=", + "@context": [ + { + hash: "https://schema.org/Text", + provider: "https://schema.org/Text", + }, + ], + provider: "ClearTextGithubOrg#gitcoinco#22886639", + }, + }, + twitter: { + type: ["VerifiableCredential"], + proof: { + jws: "eyJhbGciOiJFZERTQSIsImNyaXQiOlsiYjY0Il0sImI2NCI6ZmFsc2V9..IYtGDmEFqNH0hyJpv-S175-Vq9E-A4TBmaiW6NESV7rD2LjXrbp9WRfUzFSpFUvcPxnF7p1-etBm8DdxQJCUCA", + type: "Ed25519Signature2018", + created: "2024-04-20T05:33:27.021Z", + proofPurpose: "assertionMethod", + verificationMethod: + "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC#z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC", + }, + issuer: "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC", + "@context": ["https://www.w3.org/2018/credentials/v1"], + issuanceDate: "2024-04-20T05:33:27.021Z", + expirationDate: "2024-07-19T05:33:27.021Z", + credentialSubject: { + id: "did:pkh:eip155:1:0x5645bF145C3f1E974D0D7FB91bf3c68592ab5012", + hash: "v0.0.0:CGfxIGbX95UJQ88c5YgBCRECV2w9sfmyFMLpEaYR66w=", + "@context": [ + { + hash: "https://schema.org/Text", + provider: "https://schema.org/Text", + }, + ], + provider: "ClearTextTwitter#_kurtme", + }, + }, + }, + description: + "## Unveiling the Magic of Uni Corn\n\nWelcome to Uni Corn, where magic meets technology in the vast landscape of Web3! 🌈✨\n\nAt Uni Corn, we've embarked on an enchanting journey to blend the mystical charm of unicorns with the wholesome essence of corn. Imagine a world where blockchain technology intertwines seamlessly with the whimsical aura of mythical creatures, offering a truly unique and enchanting experience.\n\n### Embrace the Magic\n\nStep into a realm where innovation thrives and imagination knows no bounds. Uni Corn is not just a project; it's a portal to a realm where dreams come alive and possibilities are endless. Our magical logo, featuring the majestic unicorn crowned with a crown of corn, symbolizes the fusion of innovation and imagination that defines Uni Corn.\n\n### Harnessing the Power of Web3\n\nAt Uni Corn, we harness the power of Web3 to create decentralized applications (DApps) that transcend the ordinary and venture into the extraordinary. Our team of wizards and technologists work tirelessly to build a blockchain ecosystem where transparency, security, and innovation reign supreme.\n\n### Join the Uni Corn Community\n\nAre you ready to embark on this magical journey with us? Join our vibrant community of dreamers, creators, and believers in the power of magic and technology. Together, we'll explore new horizons, unlock hidden potentials, and pave the way for a future where unicorns roam freely and cornfields stretch as far as the eye can see.\n\n### Let the Magic Begin!\n\nStep into the world of Uni Corn and experience the magic of Web3 like never before. Whether you're a blockchain enthusiast, a unicorn aficionado, or simply curious about the wonders of technology, there's a place for you in our mystical realm. Let your imagination run wild, and let the magic of Uni Corn ignite your senses.\n\nAre you ready to embark on this extraordinary adventure? Join us at Uni Corn and witness the fusion of magic and technology unfold before your very eyes. Let's make the impossible possible and create a future where dreams become reality. Welcome to Uni Corn – where magic happens, one blockchain at a time. 🦄🌽", + lastUpdated: 0, + projectGithub: "gitcoinco", + projectTwitter: "_kurtme", + }, + recipient: "0x5645bF145C3f1E974D0D7FB91bf3c68592ab5012", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-28T09:22:48.000Z", + updatedAtBlock: "7169083", + }, + { + status: "REJECTED", + updatedAt: "2024-11-28T14:09:00.000Z", + updatedAtBlock: "7170428", + }, + ], + anchorAddress: "0xe5023547991f22274f171f0cf0a88f69b178bb6d", + project: { + projectRoles: [ + { + address: "0x5645bf145c3f1e974d0d7fb91bf3c68592ab5012", + }, + ], + }, + }, + { + id: "4", + projectId: "0x06ce1a0439eaf1234b0b435bb23d2a70e5c7dad7b0461408beaa7dbbfdabe297", + chainId: 11155111, + roundId: "597", + status: "REJECTED", + metadataCid: "bafkreiegudkfyzmbk5oj7g2af2aaipymcf6gf3ae3i7hyuzdlmb74gv2jm", + metadata: { + signature: + "0x4b24ad3594a94e644273be673c3d5c0cadb3969e07bee8e387b8611ae046bdbf2fec4eea86ccd9a8965f6251ab22d8f62c23932ec171d2911c1e888132eeb3661c", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0x06ce1a0439eaf1234b0b435bb23d2a70e5c7dad7b0461408beaa7dbbfdabe297", + title: "frwedvc", + metaPtr: { + pointer: "bafkreifwcczkazvjvtbixpj6rgjwlo67bylgzpry4sjyjnjvjz3ks33nku", + protocol: "undefined", + }, + website: "https://SDXSDXS.COM", + createdAt: 1723450311486, + credentials: {}, + description: "vef", + lastUpdated: 0, + }, + recipient: "0x044B595C9b94A17Adc489bD29696af40ccb3E4d2", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-28T14:17:36.000Z", + updatedAtBlock: "7170471", + }, + { + status: "REJECTED", + updatedAt: "2024-11-28T15:57:36.000Z", + updatedAtBlock: "7170949", + }, + ], + anchorAddress: "0x741bba71ab5f667b1f1abc5c64f24289aac26cf2", + project: { + projectRoles: [ + { + address: "0x0d1781f0b693b35939a49831a6c799b938bd2f80", + }, + ], + }, + }, + { + id: "5", + projectId: "0x29ad9573b3d2bc9b75d44f89cd571103d50d5a06499499282d153d1187952923", + chainId: 11155111, + roundId: "597", + status: "APPROVED", + metadataCid: "bafkreifcfgg2o4v2ujpgl6ir6tab2al6hqu3uwljbzd7aoeichhrrr5tnq", + metadata: { + signature: + "0x7c78a61c8ca4adaeb7a8ca1908c75a5bd07c0464c32e711161b102a5ff133ac95ce944b301cce35134de7b5d0ae4ba424f349e073293f6e3d704aa10797467a71b", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0x29ad9573b3d2bc9b75d44f89cd571103d50d5a06499499282d153d1187952923", + title: "testing new lit", + metaPtr: { + pointer: "bafkreihb6dp2s63uhsstalqsm7qnrg6hr7uy3avkctcrjcexw64wohyyvm", + protocol: "undefined", + }, + website: "https://SDXSDXS.COM", + createdAt: 1723539781667, + credentials: {}, + description: "fvc", + lastUpdated: 0, + }, + recipient: "0x044B595C9b94A17Adc489bD29696af40ccb3E4d2", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-28T14:19:00.000Z", + updatedAtBlock: "7170478", + }, + { + status: "APPROVED", + updatedAt: "2024-11-29T07:53:12.000Z", + updatedAtBlock: "7175465", + }, + ], + anchorAddress: "0x9af6aad853b1f1f2908551c3e28c49ccc79cc765", + project: { + projectRoles: [ + { + address: "0x0d1781f0b693b35939a49831a6c799b938bd2f80", + }, + ], + }, + }, + { + id: "6", + projectId: "0x9e291f204f6e07e10bbf6b618f3e5aaced7d55ea80963ae1308c50701efcf0e0", + chainId: 11155111, + roundId: "597", + status: "APPROVED", + metadataCid: "bafkreigcv5aej22bmx6sdtpptbr7vlgstukvgacxewyolgz6uygmrrx4ga", + metadata: { + signature: + "0x0c65c9db452f158f4c6f2acffe7d5e7cf0ae8dc076334ff99539a9b78eebe456395bd47cc24549e5d84b165e5677447c7cf7604b1d154ee6119f1ba7a5134ea61c", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0x9e291f204f6e07e10bbf6b618f3e5aaced7d55ea80963ae1308c50701efcf0e0", + title: "My Super dope project on Gnosis", + logoImg: "bafkreiezicjt4lcelh64c2cza7blbliyacy2ppi6s23oq7qbdz3iu5ywau", + metaPtr: { + pointer: "bafkreigqo3sppzdvaoh2nn35kqgurv7ctbx3wjhirz2g4me2ffxo2mq64e", + protocol: "undefined", + }, + website: "https://super.dope", + bannerImg: "bafkreiehgzwzgoit64rip2vtvkgk7o5t6gpavf6m6capwmgq25x76nt4au", + createdAt: 1726136800253, + credentials: {}, + description: "be awesome :)", + lastUpdated: 0, + }, + recipient: "0x5645bF145C3f1E974D0D7FB91bf3c68592ab5012", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-28T14:19:48.000Z", + updatedAtBlock: "7170482", + }, + { + status: "APPROVED", + updatedAt: "2024-11-28T14:52:24.000Z", + updatedAtBlock: "7170639", + }, + ], + anchorAddress: "0x697a6cdd40b0bf7ce3ec818225f584ae5c48a573", + project: { + projectRoles: [ + { + address: "0x5645bf145c3f1e974d0d7fb91bf3c68592ab5012", + }, + ], + }, + }, + { + id: "7", + projectId: "0x12ab0bc22652005d71c6ab275b9f4403e972f806222167b45e6fd913a77ec25b", + chainId: 11155111, + roundId: "597", + status: "REJECTED", + metadataCid: "bafkreia7x3czst4yzjwu4aqnc6u77f3ll4q7ppsbtu6itg5u6dk2b7b4xu", + metadata: { + signature: + "0x37842d1a2dad4cd49889a80211063c40b4a0a3fe6e661718a322e8b259c2c4f143286966ab981be31d19490bfe55b752c80c39a9424a991284a0db83f4b123c21b", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0x12ab0bc22652005d71c6ab275b9f4403e972f806222167b45e6fd913a77ec25b", + title: "Kit Fix", + metaPtr: { + pointer: "bafkreibluucurs5rvsd2hciczv63ykzrhlw6xu625lbwrjrz4otqbma5nu", + protocol: "undefined", + }, + website: "https://pop.com", + createdAt: 1718355418126, + credentials: {}, + description: "jknfjwkndk qe qkjwe qkjw e ke kqjw ekqweqwe", + lastUpdated: 0, + }, + recipient: "0xB8cEF765721A6da910f14Be93e7684e9a3714123", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-29T07:49:48.000Z", + updatedAtBlock: "7175448", + }, + { + status: "REJECTED", + updatedAt: "2024-12-02T10:55:12.000Z", + updatedAtBlock: "7195597", + }, + ], + anchorAddress: "0x3b6a76df677df5489499ae8f67b07ed33a491dbb", + project: { + projectRoles: [ + { + address: "0xb8cef765721a6da910f14be93e7684e9a3714123", + }, + ], + }, + }, + { + id: "8", + projectId: "0xcc7dffb9b30d0b95aa24c23604cf5e0921ee83b1d43b4be87a9ec7a429cdc16e", + chainId: 11155111, + roundId: "597", + status: "PENDING", + metadataCid: "bafkreid2bhszojisejd7uyaoxseb5f3uplmj4azxj7lnu7f6mtoszw5rmu", + metadata: { + signature: + "0x6f533bb43e1f3482d3d9552a87d62808bc6d04774be3a5cae49b1d111f4a63b14946f2a440f283063475da9d2417a039039b93083841ae5861b36541042b62e51b", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0xcc7dffb9b30d0b95aa24c23604cf5e0921ee83b1d43b4be87a9ec7a429cdc16e", + title: "The day after dependency updates", + logoImg: "bafkreief7xplad32juidncotavrksal76gefr66zxq6g7ctgylqzs7mi6i", + metaPtr: { + pointer: "bafkreifz5b5xtbqeesnybvsgvfrmmtykqb7jtnayhv42zftytnl724ueqy", + protocol: "undefined", + }, + website: "https://yyy.yy", + bannerImg: "bafkreifmzxf4e2gac5gaabbzrjuliclseh3d77qgv4qfbcmk5kor6r7zha", + createdAt: 1718185991149, + credentials: {}, + description: "Wow, what a nice description.", + lastUpdated: 0, + }, + recipient: "0x5645bF145C3f1E974D0D7FB91bf3c68592ab5012", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-29T16:04:36.000Z", + updatedAtBlock: "7177792", + }, + ], + anchorAddress: "0xfc024a01c5f837d7ff5164d541e6ec350a7eeff2", + project: { + projectRoles: [ + { + address: "0x5645bf145c3f1e974d0d7fb91bf3c68592ab5012", + }, + ], + }, + }, + { + id: "9", + projectId: "0xdba27ceab70f958b580d32a7e39ecaa708a9de71df5a6e2ee29d1ecfc360a64e", + chainId: 11155111, + roundId: "597", + status: "PENDING", + metadataCid: "bafkreietn7rnrbi2wsch4s7hd4qxsqzfmdvzkfommswounabo7vfm3b3cm", + metadata: { + signature: + "0xeacc1a45a6e82dcb16ec1d816f9b4e036f324fa713b4149a3225572d897e7ef20eecc06ab089e35155707e2c6d1c97863c66c6e1ef2d9a2765405f54fce8ae2a1b", + application: { + round: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + answers: [], + project: { + id: "0xdba27ceab70f958b580d32a7e39ecaa708a9de71df5a6e2ee29d1ecfc360a64e", + title: "Hello Lukso", + metaPtr: { + pointer: "bafkreidawq33473thqnpan2by7xckhjylwzju4t22a36mxgmllfjge2gza", + protocol: "undefined", + }, + website: "https://hello-luk.so", + createdAt: 1724945275247, + credentials: {}, + description: "What is my project about?", + lastUpdated: 0, + }, + recipient: "0x5645bF145C3f1E974D0D7FB91bf3c68592ab5012", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-11-29T16:24:36.000Z", + updatedAtBlock: "7177885", + }, + ], + anchorAddress: "0xc482ead44a5ba21b419eaa352bfdaee04592c0f1", + project: { + projectRoles: [ + { + address: "0x5645bf145c3f1e974d0d7fb91bf3c68592ab5012", + }, + ], + }, + }, + ] + }, +}; diff --git a/packages/ui/src/mocks/mockData/checkerApplicationEvaluations.ts b/apps/checker/src/mocks/mockData/checkerApplicationEvaluations.ts similarity index 98% rename from packages/ui/src/mocks/mockData/checkerApplicationEvaluations.ts rename to apps/checker/src/mocks/mockData/checkerApplicationEvaluations.ts index 502698f3..478ca06b 100644 --- a/packages/ui/src/mocks/mockData/checkerApplicationEvaluations.ts +++ b/apps/checker/src/mocks/mockData/checkerApplicationEvaluations.ts @@ -1,4 +1,4 @@ -import { Evaluation } from "@/features/checker"; +import { Evaluation } from "@gitcoin/types"; export const checkerApplicationEvaluations: Evaluation[] = [ { diff --git a/packages/ui/src/mocks/mockData/checkerPoolData.ts b/apps/checker/src/mocks/mockData/checkerPoolData.ts similarity index 100% rename from packages/ui/src/mocks/mockData/checkerPoolData.ts rename to apps/checker/src/mocks/mockData/checkerPoolData.ts diff --git a/apps/checker/src/mocks/mockData/indexerGetApplicationById.ts b/apps/checker/src/mocks/mockData/indexerGetApplicationById.ts new file mode 100644 index 00000000..3a8202cf --- /dev/null +++ b/apps/checker/src/mocks/mockData/indexerGetApplicationById.ts @@ -0,0 +1,199 @@ +export const getApplicationById = { + id: "0", + projectId: "0x7f2586fce05d466c9fb3e509be56c02e0af6870f04209d5881c6d100534fec5d", + chainId: 42161, + roundId: "609", + status: "APPROVED", + metadataCid: "bafkreidtte6gasyfomd6w5krqtyxqzsgnxhsjcjxc4riywdy47jrkf6hum", + metadata: { + signature: + "0x8e5ec2f393c8570cd4cf2d3990e15d51553b6d4ac025a0be49726407fc85d89d46194c7a22eddb52ec646f7399d15d82dd8b0dc9814f12a97607b674a4b7a6211c", + application: { + round: "0xd2d99614321becd7cd0636715bbb4c94968e6271", + answers: [ + { + type: "email", + hidden: true, + question: "Email Address", + questionId: 0, + encryptedAnswer: { + ciphertext: "X2nnSyZKk4G/0TKk6R9RjaJ01T4CQIqg7il0DoKflxcrxVgDmLxmWM4qPOG9Obdw", + encryptedSymmetricKey: + "3d7fa6e2f2a14dad731145b91c1d9ff4e1d696706acc42198a107b1e3a4488298da98ee6312e58ed13e252803d20431272cc148e40f4a7d35e6fc0a98d7200b80b7e35f9587a5ebb2de95ed878f7b90f941fb3ff5313cc466e353e5c3d3e2584559c1482ae15ea9cde3ce9c91a258fbc346e4c4ac0818e6305a2e78bf66ec7e400000000000000203bfdcc0aca617ff08db2409505e1a85f977063ec59da7714eb5f123df68c878adc872797a26f04251220af6160cac2ab", + }, + }, + { + type: "short-answer", + answer: "DRPTBL", + hidden: true, + question: "Telegram Handle", + questionId: 1, + }, + { + type: "short-answer", + answer: "https://github.com/Synthetixio/synpress", + hidden: true, + question: "Project GitHub Repo", + questionId: 2, + }, + { + type: "short-answer", + answer: "https://discord.gg/XhZKSRGtWc", + hidden: true, + question: "Link to your Public Group Chat", + questionId: 3, + }, + { + type: "short-answer", + answer: + "Yes, we have participated in 3 rounds: Web3 Open Source Software, Developer Tooling and Libraries, GG21: Thriving Arbitrum Summer", + hidden: true, + question: + "Have you participated in a previous Gitcoin Grants Round? If so, please name the rounds or link the builder profile associated with previous rounds.", + questionId: 4, + }, + { + type: "paragraph", + answer: + "\nSynpress is an e2e testing framwork designed to simplify and improve the testing of Web3 decentralized applications. It solves the problem of inadequate tooling for testing the complex interactions inherent in dApps, such as connecting to wallets, signing transactions, interacting with smart contracts, and handling blockchain events. Existing E2E testing frameworks struggle with these Web3-specific actions, requiring developers to write cumbersome workarounds or rely on unreliable manual testing. Synpress provides dedicated features and APIs to handle these interactions seamlessly, making dApp testing more efficient, reliable, and developer-friendly. It aims to be the standard E2E testing solution for the Web3 ecosystem, ensuring higher quality and more secure dApps.", + hidden: true, + question: + "Provide a brief overview of your tool, library, or framework. What specific problem or inefficiency in the development process does it address?", + questionId: 5, + }, + { + type: "paragraph", + answer: + "Synpress simplifies complex Web3 testing scenarios. Its intuitive API and built-in mocking for wallets and local blockchains (like Anvil) drastically reduce the setup time and effort required for e2e testing, allowing developers, especially those new to Web3, to get started quickly. This ease of use enables faster iteration.\n\nEfficiency is improved through Synpress caching mechanism for browser contexts with pre-configured wallets. This significantly speeds up test execution by eliminating repetitive wallet setup steps, as demonstrated by our internal tests where setup time was reduced by up to 80%.\n\nSecurity enhancements come from enabling comprehensive testing of critical dApp interactions. Synpress facilitates robust testing of wallet connections, transaction signing, and smart contract calls, helping developers identify and mitigate vulnerabilities early in the development process.", + hidden: true, + question: + "How does your project reduce development barriers, improve efficiency, or enhance the security of Web3 projects? Please provide specific examples or metrics if available.", + questionId: 6, + }, + { + type: "paragraph", + answer: + "Synpress is in active development with a growing community. While still in its alpha stage (v4), the previous version (v3) saw substantial usage and community contributions, demonstrating the demand for a Web3-focused E2E testing solution. We are actively working on building community resources and gathering metrics for the v4 alpha release. Anecdotal feedback from early alpha users highlights the improved developer experience and speed enhancements brought by the new caching mechanism and the cleaner API.\n\nUseful metrics related to synpress:\n\n- npmjs (~14k downloads/week):\nhttps://www.npmjs.com/package/@synthetixio/synpress \n\n- Projects using synpress (includes a lot of big projects like Optimism, Arbitrum, Linea, WalletConnect, Across, Gitcoin and many others): https://github.com/Synthetixio/synpress/network/dependents?package_id=UGFja2FnZS0xNjIwNjMzMjE1\n\n- Downloads trends (up only since 4 years):\n https://npmtrends.com/@synthetixio/synpress", + hidden: true, + question: + "Describe the current usage and support for your tool within the developer community. This could include GitHub stars, downloads, or testimonials from developers.", + questionId: 7, + }, + { + type: "paragraph", + answer: + "Our project roadmap is available here:\nhttps://lindie.app/share/5ffb9e1d3e4b69c05fbdb11b7fb56e6c6f301183\n\nDepending on the grant size, funds will be used in different way. Nevertheless, our main priority for this grant is to enhance our `EthereumWalletMock` to cover wider range of methods, as currently we're not supporting many of them yet.\n\nWhole task (epic) is described here:\nhttps://lindie.app/share/5ffb9e1d3e4b69c05fbdb11b7fb56e6c6f301183/SYN-149", + hidden: true, + question: + "Outline your project's roadmap and how the grant funds will be used to achieve your development goals.", + questionId: 8, + }, + { + type: "paragraph", + hidden: true, + question: + "For any project deploying smart contracts on blockchain networks, please list all your deployer addresses and their corresponding blockchain networks. Use this format for each entry: [deployer_address], [chain_id]—for example, 0x123abc..., 42161 (This represents a deployer address on the Arbitrum network). Please include a separate line for each unique deployer address and blockchain combination.", + questionId: 9, + }, + ], + project: { + id: "0x7f2586fce05d466c9fb3e509be56c02e0af6870f04209d5881c6d100534fec5d", + title: "Synpress", + logoImg: "bafkreibcxewuw2eddh7iiuea73ho4vxws7d3cpccr4slns7cbrpdo6q3he", + metaPtr: { + pointer: "bafkreifkskbvxlsbwqvg6ykf5upkpuhfyk5npilq7cwu2z5hf2p5hgpqsi", + protocol: "undefined", + }, + website: "https://synpress.io", + bannerImg: "bafkreiel7b3pblo44wnfogktgm23z6td7e5dmdy7lwzzy2diyp377aivgu", + createdAt: 1691439308436, + userGithub: "drptbl", + credentials: { + github: { + type: ["VerifiableCredential"], + proof: { + jws: "eyJhbGciOiJFZERTQSIsImNyaXQiOlsiYjY0Il0sImI2NCI6ZmFsc2V9..isd9NhS75ZO7slJtO-EsgJp4f6UAbgfqYBQQvwzNcNbONzLqBMNxGwnF9LmkFFgzP95NFRjqU4hoS2m0JSN_Ag", + type: "Ed25519Signature2018", + created: "2023-08-07T20:14:06.799Z", + proofPurpose: "assertionMethod", + verificationMethod: + "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC#z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC", + }, + issuer: "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC", + "@context": ["https://www.w3.org/2018/credentials/v1"], + issuanceDate: "2023-08-07T20:14:06.799Z", + expirationDate: "2023-11-05T20:14:06.799Z", + credentialSubject: { + id: "did:pkh:eip155:1:0xd35E119782059A27FEAd4EddA8B555f393650BC8", + hash: "v0.0.0:FEgJkAFXR+3d9wS6PNaaadDrlsmY9WN/gefBZK1JsBE=", + "@context": [ + { + hash: "https://schema.org/Text", + provider: "https://schema.org/Text", + }, + ], + provider: "ClearTextGithubOrg#Synthetixio#8177587", + }, + }, + twitter: { + type: ["VerifiableCredential"], + proof: { + jws: "eyJhbGciOiJFZERTQSIsImNyaXQiOlsiYjY0Il0sImI2NCI6ZmFsc2V9..6T3y5nFhOBk70U0eqNGsj1hSbKITUx0QwqF_-KXY2D1MIK37iCjWIlMldNdXXK_a4AiDNUQd6Ty_ppP5KH4hBQ", + type: "Ed25519Signature2018", + created: "2023-08-07T20:12:52.905Z", + proofPurpose: "assertionMethod", + verificationMethod: + "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC#z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC", + }, + issuer: "did:key:z6MkghvGHLobLEdj1bgRLhS4LPGJAvbMA1tn2zcRyqmYU5LC", + "@context": ["https://www.w3.org/2018/credentials/v1"], + issuanceDate: "2023-08-07T20:12:52.905Z", + expirationDate: "2023-11-05T20:12:52.905Z", + credentialSubject: { + id: "did:pkh:eip155:1:0xd35E119782059A27FEAd4EddA8B555f393650BC8", + hash: "v0.0.0:JPXYebm9ngO8o9AF40COv6w8V3+WvnP8oQd5iAhlp1w=", + "@context": [ + { + hash: "https://schema.org/Text", + provider: "https://schema.org/Text", + }, + ], + provider: "ClearTextTwitter#Synpress_", + }, + }, + }, + description: + "Synpress is an end-to-end testing framework for web applications based on Cypress and Playwright, with support for MetaMask. It is a pioneering tool in web3 end-to-end testing with the potential to evolve into a decentralized network of test runners and continuous integration providers in the future. Synpress is easy to use, fully tested, and includes features such as MetaMask support, headless mode, integrated video recording, and many more. It is also blazingly-fast and extensible, with the ability to add custom commands and plugins. Synpress is already used by several open-source repositories.", + lastUpdated: 0, + projectGithub: "Synthetixio", + projectTwitter: "Synpress_", + }, + recipient: "0x7b57c388e6149b5c197B925037602d5B6bafFbCc", + }, + }, + distributionTransaction: null, + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-09-30T22:01:48.000Z", + updatedAtBlock: "259057447", + }, + { + status: "APPROVED", + updatedAt: "2024-10-09T18:12:27.000Z", + updatedAtBlock: "262087357", + }, + ], + anchorAddress: "0x83ba0bd26a20a2c5f4e9157242b0c0ee659b7a2c", + round: { + strategyName: "allov2.DonationVotingMerkleDistributionDirectTransferStrategy", + strategyAddress: "0xd2d99614321becd7cd0636715bbb4c94968e6271", + }, + project: { + projectRoles: [ + { + address: "0xd35e119782059a27fead4edda8b555f393650bc8", + }, + ], + }, +}; diff --git a/apps/checker/src/mocks/mockData/pastApplicationsByApplicationId.ts b/apps/checker/src/mocks/mockData/pastApplicationsByApplicationId.ts new file mode 100644 index 00000000..a0a10181 --- /dev/null +++ b/apps/checker/src/mocks/mockData/pastApplicationsByApplicationId.ts @@ -0,0 +1,103 @@ +export const pastApplicationsByApplicationId = { + applications: [ + { + project: { + applications: [ + { + id: "8", + roundId: "18", + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-05-08T21:50:53.000Z", + updatedAtBlock: "119803138", + }, + { + status: "APPROVED", + updatedAt: "2024-05-09T22:11:51.000Z", + updatedAtBlock: "119846967", + }, + ], + status: "APPROVED", + round: { + roundMetadata: { + name: "HyperLocalizer Round One (Mocked)", + support: { + info: "https://t.me/hyperlocalizer_chat", + type: "Telegram Group Invite Link", + }, + roundType: "public", + eligibility: { + description: "Experimental round to fund public goods for local impact", + requirements: [ + { + requirement: "Public good that does local impact", + }, + ], + }, + feesAddress: "", + feesPercentage: 0, + programContractAddress: + "0x690ca3292c6b22f71dc881efdc80938eefff014d8cd92fd950819287f758d229", + quadraticFundingConfig: { + matchingCap: true, + sybilDefense: false, + matchingCapAmount: 20, + minDonationThreshold: false, + matchingFundsAvailable: 50, + }, + }, + }, + }, + { + id: "1", + roundId: "7", + statusSnapshots: [ + { + status: "PENDING", + updatedAt: "2024-03-28T09:44:37.000Z", + updatedAtBlock: "118010150", + }, + { + status: "APPROVED", + updatedAt: "2024-03-29T06:35:21.000Z", + updatedAtBlock: "118047672", + }, + ], + status: "APPROVED", + round: { + roundMetadata: { + name: "Allo 2 🌐♻️ EcoSynthesisX Spring Round on Optimism (Mocked)", + support: { + info: "https://discord.gg/qkSy83uf", + type: "Discord Group Invite Link", + }, + roundType: "public", + eligibility: { + description: + "Allo 2 protocol. EcoSynthesisX Spring round as a space for showcase public good projects, foster coordination and bring funding for bigger impact! Experimental approach on public good funding utilizing hyperstructure vision and Gitcoin infrastructure. Open for applications. Our Discord https://discord.gg/qkSy83uf", + requirements: [ + { + requirement: "", + }, + ], + }, + feesAddress: "", + feesPercentage: 0, + programContractAddress: + "0x6c2402cc20967444d61900db0a5e4823d78be1eb379ca4942bb90b3d045f6690", + quadraticFundingConfig: { + matchingCap: false, + sybilDefense: false, + minDonationThreshold: true, + matchingFundsAvailable: 1000, + minDonationThresholdAmount: 1, + }, + }, + }, + }, + ], + }, + }, + ], +}; diff --git a/apps/checker/src/mocks/mockData/rounds.ts b/apps/checker/src/mocks/mockData/rounds.ts new file mode 100644 index 00000000..c31b3878 --- /dev/null +++ b/apps/checker/src/mocks/mockData/rounds.ts @@ -0,0 +1,76 @@ +export const rounds = { + data: { + rounds: [ + { + roundMetadata: { + name: "Checker Test Round", + support: { + info: "yy@yy.yy", + type: "Email", + }, + roundType: "private", + eligibility: { + description: + "This grant round is created purely for testing purposes. The project description is intentionally left empty, and the project itself is not intended to provide any meaningful service or product. This round is a placeholder for testing grant application processes.", + requirements: [ + { + requirement: + "You must provide a link to something (anything). It could be a website, a GitHub repo, or even just a link to your social media.", + }, + { + requirement: + "Your project must have a title. It can be a random word or phrase. Bonus points for creativity, but it's not required.", + }, + { + requirement: + 'Briefly describe your "project" in one sentence. It can be completely unrelated to the title and should not matter at all.', + }, + { + requirement: "Be awesome :)", + }, + ], + }, + feesAddress: "", + feesPercentage: 0, + programContractAddress: + "0x107879486cfb4f5e6284033fbe11a3cfd6bb447a119f15729cd8e3fc8ca8aff5", + quadraticFundingConfig: { + matchingCap: false, + sybilDefense: "passport-mbds", + minDonationThreshold: false, + matchingFundsAvailable: 0.1, + }, + }, + strategyName: "allov2.DonationVotingMerkleDistributionDirectTransferStrategy", + strategyAddress: "0xc5a0a4d4b0c46fc430362377d3d11a23bad4a645", + applicationsStartTime: "2024-11-26T13:50:00+00:00", + applicationsEndTime: "2024-12-27T23:00:00+00:00", + donationsEndTime: "2024-12-30T23:00:00+00:00", + donationsStartTime: "2024-11-29T23:00:00+00:00", + project: { + id: "0x107879486cfb4f5e6284033fbe11a3cfd6bb447a119f15729cd8e3fc8ca8aff5", + projectRoles: [ + { + address: "0x0d1781f0b693b35939a49831a6c799b938bd2f80", + }, + { + address: "0x5645bf145c3f1e974d0d7fb91bf3c68592ab5012", + }, + { + address: "0x5645bf145c3f1e974d0d7fb91bf3c68592ab5012", + }, + { + address: "0x5933fb4969b322220ed8c24f2088633115ecbcc0", + }, + { + address: "0x7b0e91c75ad9ec537083f61356c532bb882ea2fb", + }, + { + address: "0xb8cef765721a6da910f14be93e7684e9a3714123", + }, + ], + }, + }, + ], + }, +}; diff --git a/packages/ui/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.mdx b/apps/checker/src/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.mdx similarity index 100% rename from packages/ui/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.mdx rename to apps/checker/src/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.mdx diff --git a/packages/ui/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.stories.tsx b/apps/checker/src/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.stories.tsx similarity index 95% rename from packages/ui/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.stories.tsx rename to apps/checker/src/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.stories.tsx index dee66f63..73242ef8 100644 --- a/packages/ui/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.stories.tsx +++ b/apps/checker/src/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.stories.tsx @@ -2,7 +2,7 @@ import { Meta, StoryObj } from "@storybook/react"; import { handlers } from "@/mocks/handlers"; -import { CheckerProvider } from "~checker/store"; +import { CheckerProvider } from "@/store"; import { ApplicationEvaluationOverviewPage } from "./ApplicationEvaluationOverviewPage"; diff --git a/packages/ui/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx b/apps/checker/src/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx similarity index 90% rename from packages/ui/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx rename to apps/checker/src/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx index dd801225..a842831e 100644 --- a/packages/ui/src/features/checker/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx +++ b/apps/checker/src/pages/ApplicationEvaluationOverviewPage/ApplicationEvaluationOverviewPage.tsx @@ -1,20 +1,16 @@ "use client"; +import { Button, Icon, IconType, PoolSummary, ProjectBanner } from "@gitcoin/ui"; +import { cn } from "@gitcoin/utils"; import { Hex } from "viem"; -import { cn } from "@/lib"; -import { Button } from "@/primitives/Button"; -import { Icon, IconType } from "@/primitives/Icon"; - -import { EvaluationList } from "~checker/components"; -import { useApplicationOverviewEvaluations, useInitialize } from "~checker/hooks"; +import { EvaluationList } from "@/components"; +import { useApplicationOverviewEvaluations, useInitialize } from "@/hooks"; import { goToReviewApplicationsAction, goToSubmitApplicationEvaluationAction, useCheckerDispatchContext, -} from "~checker/store"; -import { PoolSummary } from "~pool"; -import { ProjectBanner } from "~project"; +} from "@/store"; export interface ApplicationEvaluationOverviewPageProps { chainId: number; diff --git a/packages/ui/src/features/checker/pages/ApplicationEvaluationOverviewPage/index.ts b/apps/checker/src/pages/ApplicationEvaluationOverviewPage/index.ts similarity index 100% rename from packages/ui/src/features/checker/pages/ApplicationEvaluationOverviewPage/index.ts rename to apps/checker/src/pages/ApplicationEvaluationOverviewPage/index.ts diff --git a/packages/ui/src/features/checker/pages/ReviewApplicationsPage/ReviewApplicationsPage.tsx b/apps/checker/src/pages/ReviewApplicationsPage/ReviewApplicationsPage.tsx similarity index 90% rename from packages/ui/src/features/checker/pages/ReviewApplicationsPage/ReviewApplicationsPage.tsx rename to apps/checker/src/pages/ReviewApplicationsPage/ReviewApplicationsPage.tsx index 53a029d2..414af23f 100644 --- a/packages/ui/src/features/checker/pages/ReviewApplicationsPage/ReviewApplicationsPage.tsx +++ b/apps/checker/src/pages/ReviewApplicationsPage/ReviewApplicationsPage.tsx @@ -2,23 +2,19 @@ import { useMemo } from "react"; -import { cn } from "@/lib"; -import { Button } from "@/primitives/Button"; -import { Icon, IconType } from "@/primitives/Icon"; -import { StatCardProps } from "@/primitives/StatCard"; -import { StatCardGroup } from "@/primitives/StatCardGroup"; -import { PoolType } from "@/types"; +import { PoolType } from "@gitcoin/types"; +import { Button, Icon, IconType, PoolSummary, StatCardProps, StatCardGroup } from "@gitcoin/ui"; +import { cn } from "@gitcoin/utils"; +import { getRoundLinkOnManager } from "@gitcoin/utils/checker"; -import { ApplicationsSection } from "~checker/components"; -import { useGetApplicationsReviewPage } from "~checker/hooks"; +import { ApplicationsSection } from "@/components"; +import { useGetApplicationsReviewPage } from "@/hooks"; import { goToApplicationEvaluationOverviewAction, goToSubmitFinalEvaluationAction, useCheckerContext, useCheckerDispatchContext, -} from "~checker/store"; -import { getRoundLinkOnManager } from "~checker/utils"; -import { PoolSummary } from "~pool"; +} from "@/store"; export const ReviewApplicationsPage = ({ isStandalone }: { isStandalone: boolean }) => { const { categorizedReviews, statCardsProps, poolData, poolFetchState } = diff --git a/packages/ui/src/features/checker/pages/ReviewApplicationsPage/index.ts b/apps/checker/src/pages/ReviewApplicationsPage/index.ts similarity index 100% rename from packages/ui/src/features/checker/pages/ReviewApplicationsPage/index.ts rename to apps/checker/src/pages/ReviewApplicationsPage/index.ts diff --git a/packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationModal.tsx b/apps/checker/src/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationModal.tsx similarity index 91% rename from packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationModal.tsx rename to apps/checker/src/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationModal.tsx index c1f5b1bf..aca19856 100644 --- a/packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationModal.tsx +++ b/apps/checker/src/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationModal.tsx @@ -2,14 +2,10 @@ import { useMemo } from "react"; +import { EvaluationActionState, EvaluationStatus } from "@gitcoin/types"; +import { Button, Dialog, DialogHeader, DialogTitle, DialogDescription, Modal } from "@gitcoin/ui"; import { match } from "ts-pattern"; -import { Button } from "@/primitives/Button"; -import { Dialog, DialogHeader, DialogTitle, DialogDescription } from "@/primitives/Dialog"; -import { Modal } from "@/primitives/Modal"; - -import { EvaluationActionState, EvaluationStatus } from "~checker/types"; - import { getButtonConfig } from "./utils"; interface SubmitApplicationEvaluationModalProps { diff --git a/packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.mdx b/apps/checker/src/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.mdx similarity index 100% rename from packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.mdx rename to apps/checker/src/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.mdx diff --git a/packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.stories.tsx b/apps/checker/src/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.stories.tsx similarity index 93% rename from packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.stories.tsx rename to apps/checker/src/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.stories.tsx index 8e985b8f..98dfd2b6 100644 --- a/packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.stories.tsx +++ b/apps/checker/src/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.stories.tsx @@ -2,8 +2,8 @@ import { Meta, StoryObj } from "@storybook/react"; import { handlers } from "@/mocks/handlers"; -import { usePerformEvaluation } from "~checker/hooks"; -import { CheckerProvider } from "~checker/store"; +import { usePerformEvaluation } from "@/hooks"; +import { CheckerProvider } from "@/store"; import { SubmitApplicationEvaluationPage } from "./SubmitApplicationEvaluationPage"; diff --git a/packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.tsx b/apps/checker/src/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.tsx similarity index 90% rename from packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.tsx rename to apps/checker/src/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.tsx index 9a8cfa55..e4aada1f 100644 --- a/packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.tsx +++ b/apps/checker/src/pages/SubmitApplicationEvaluationPage/SubmitApplicationEvaluationPage.tsx @@ -2,25 +2,16 @@ import { useEffect, useState } from "react"; +import { EvaluationStatus, EvaluationBody } from "@gitcoin/types"; +import { Button, EvaluationForm, Icon, IconType, PoolSummary, ProjectBanner } from "@gitcoin/ui"; +import { useToast } from "@gitcoin/ui/hooks/useToast"; +import { cn } from "@gitcoin/utils"; import { useQueryClient } from "@tanstack/react-query"; import { Hex } from "viem"; -import { EvaluationForm } from "@/components/EvaluationForm/EvaluationForm"; -import { useToast } from "@/hooks/useToast"; -import { cn } from "@/lib"; -import { Button } from "@/primitives/Button"; -import { Icon, IconType } from "@/primitives/Icon"; - -import { ApplicationSummary } from "~application"; -import { - useGetPastApplications, - useInitialize, - useApplicationOverviewEvaluations, -} from "~checker/hooks"; -import { goToApplicationEvaluationOverviewAction, useCheckerDispatchContext } from "~checker/store"; -import { EvaluationStatus, EvaluationBody } from "~checker/types"; -import { PoolSummary } from "~pool"; -import { ProjectBanner } from "~project"; +import { ApplicationSummary } from "@/components/ApplicationSummary"; +import { useGetPastApplications, useInitialize, useApplicationOverviewEvaluations } from "@/hooks"; +import { goToApplicationEvaluationOverviewAction, useCheckerDispatchContext } from "@/store"; import { SubmitApplicationEvaluationModal } from "./SubmitApplicationEvaluationModal"; import { getAnswerEnum } from "./utils"; diff --git a/packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/index.ts b/apps/checker/src/pages/SubmitApplicationEvaluationPage/index.ts similarity index 100% rename from packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/index.ts rename to apps/checker/src/pages/SubmitApplicationEvaluationPage/index.ts diff --git a/packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/utils.ts b/apps/checker/src/pages/SubmitApplicationEvaluationPage/utils.ts similarity index 94% rename from packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/utils.ts rename to apps/checker/src/pages/SubmitApplicationEvaluationPage/utils.ts index b5fe8830..72c32925 100644 --- a/packages/ui/src/features/checker/pages/SubmitApplicationEvaluationPage/utils.ts +++ b/apps/checker/src/pages/SubmitApplicationEvaluationPage/utils.ts @@ -1,8 +1,7 @@ // src/components/SubmitApplicationEvaluation/statusHandler.ts +import { EvaluationActionState } from "@gitcoin/types"; import { match } from "ts-pattern"; -import { EvaluationActionState } from "../../types"; - export interface ButtonConfig { text: string; disabled: boolean; diff --git a/packages/ui/src/features/checker/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationModal.tsx b/apps/checker/src/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationModal.tsx similarity index 91% rename from packages/ui/src/features/checker/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationModal.tsx rename to apps/checker/src/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationModal.tsx index 2ba4c048..733b95a9 100644 --- a/packages/ui/src/features/checker/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationModal.tsx +++ b/apps/checker/src/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationModal.tsx @@ -1,13 +1,9 @@ "use client"; +import { Button, Dialog, DialogHeader, DialogTitle, Modal, ProgressModal } from "@gitcoin/ui"; +import { Step } from "@gitcoin/ui/types"; import { Check, X } from "lucide-react"; -import { ProgressModal } from "@/components/ProgressModal"; -import { Button } from "@/primitives/Button"; -import { Dialog, DialogHeader, DialogTitle } from "@/primitives/Dialog"; -import { Modal } from "@/primitives/Modal"; -import { Step } from "@/types"; - export interface SubmitFinalEvaluationModalProps { reviews: Record; steps: Step[]; diff --git a/packages/ui/src/features/checker/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationPage.tsx b/apps/checker/src/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationPage.tsx similarity index 91% rename from packages/ui/src/features/checker/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationPage.tsx rename to apps/checker/src/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationPage.tsx index 9216c322..96ba86ee 100644 --- a/packages/ui/src/features/checker/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationPage.tsx +++ b/apps/checker/src/pages/SubmitFinalEvaluationPage/SubmitFinalEvaluationPage.tsx @@ -2,26 +2,22 @@ import { useState, useMemo, useEffect } from "react"; +import { EvaluationAction, ReviewBody, PoolType } from "@gitcoin/types"; +import { Button, Icon, IconType, PoolSummary, StatCardGroup } from "@gitcoin/ui"; +import { useToast } from "@gitcoin/ui/hooks/useToast"; +import { Step } from "@gitcoin/ui/types"; +import { cn } from "@gitcoin/utils"; +import { getRoundLinkOnManager } from "@gitcoin/utils/checker"; import { useQueryClient } from "@tanstack/react-query"; import { match } from "ts-pattern"; -import { useToast } from "@/hooks/useToast"; -import { cn } from "@/lib"; -import { Button } from "@/primitives/Button"; -import { Icon, IconType } from "@/primitives/Icon"; -import { StatCardGroup } from "@/primitives/StatCardGroup"; -import { PoolType, Step } from "@/types"; - -import { ProjectEvaluationList } from "~checker/components"; -import { useGetApplicationsFinalEvaluationPage } from "~checker/hooks"; +import { ProjectEvaluationList } from "@/components"; +import { useGetApplicationsFinalEvaluationPage } from "@/hooks"; import { goToReviewApplicationsAction, useCheckerDispatchContext, useCheckerContext, -} from "~checker/store"; -import { EvaluationAction, ReviewBody } from "~checker/types"; -import { getManagerUrl, getRoundLinkOnManager } from "~checker/utils"; -import { PoolSummary } from "~pool"; +} from "@/store"; import { SubmitFinalEvaluationModal } from "./SubmitFinalEvaluationModal"; diff --git a/packages/ui/src/features/checker/pages/SubmitFinalEvaluationPage/index.ts b/apps/checker/src/pages/SubmitFinalEvaluationPage/index.ts similarity index 100% rename from packages/ui/src/features/checker/pages/SubmitFinalEvaluationPage/index.ts rename to apps/checker/src/pages/SubmitFinalEvaluationPage/index.ts diff --git a/packages/ui/src/features/checker/pages/ViewApplicationEvaluationsPage/ViewApplicatioNEvaluationsPage.mdx b/apps/checker/src/pages/ViewApplicationEvaluationsPage/ViewApplicatioNEvaluationsPage.mdx similarity index 100% rename from packages/ui/src/features/checker/pages/ViewApplicationEvaluationsPage/ViewApplicatioNEvaluationsPage.mdx rename to apps/checker/src/pages/ViewApplicationEvaluationsPage/ViewApplicatioNEvaluationsPage.mdx diff --git a/packages/ui/src/features/checker/pages/ViewApplicationEvaluationsPage/ViewApplicationEvaluationsPage.stories.tsx b/apps/checker/src/pages/ViewApplicationEvaluationsPage/ViewApplicationEvaluationsPage.stories.tsx similarity index 94% rename from packages/ui/src/features/checker/pages/ViewApplicationEvaluationsPage/ViewApplicationEvaluationsPage.stories.tsx rename to apps/checker/src/pages/ViewApplicationEvaluationsPage/ViewApplicationEvaluationsPage.stories.tsx index 9caea287..4912d47d 100644 --- a/packages/ui/src/features/checker/pages/ViewApplicationEvaluationsPage/ViewApplicationEvaluationsPage.stories.tsx +++ b/apps/checker/src/pages/ViewApplicationEvaluationsPage/ViewApplicationEvaluationsPage.stories.tsx @@ -2,7 +2,7 @@ import { Meta, StoryObj } from "@storybook/react"; import { handlers } from "@/mocks/handlers"; -import { CheckerProvider } from "~checker/store"; +import { CheckerProvider } from "@/store"; import { ViewApplicationEvaluationsPage } from "./ViewApplicationEvaluationsPage"; diff --git a/packages/ui/src/features/checker/pages/ViewApplicationEvaluationsPage/ViewApplicationEvaluationsPage.tsx b/apps/checker/src/pages/ViewApplicationEvaluationsPage/ViewApplicationEvaluationsPage.tsx similarity index 86% rename from packages/ui/src/features/checker/pages/ViewApplicationEvaluationsPage/ViewApplicationEvaluationsPage.tsx rename to apps/checker/src/pages/ViewApplicationEvaluationsPage/ViewApplicationEvaluationsPage.tsx index a39dbea0..7b6cbb30 100644 --- a/packages/ui/src/features/checker/pages/ViewApplicationEvaluationsPage/ViewApplicationEvaluationsPage.tsx +++ b/apps/checker/src/pages/ViewApplicationEvaluationsPage/ViewApplicationEvaluationsPage.tsx @@ -2,18 +2,14 @@ import React from "react"; -import { useToast } from "@/hooks/useToast"; -import { capitalizeWord } from "@/lib/utils"; -import { Badge } from "@/primitives/Badge"; -import { Button } from "@/primitives/Button"; -import { Icon, IconType } from "@/primitives/Icon"; +import { Badge, Button, Icon, IconType, ProjectBanner, ProjectSummary } from "@gitcoin/ui"; +import { useToast } from "@gitcoin/ui/hooks/useToast"; +import { capitalizeWord } from "@gitcoin/utils"; +import { getApplicationLinkOnExplorer } from "@gitcoin/utils/checker"; -import { ApplicationSummary, SummaryAccordians } from "~application"; -import { ReviewDropdownList } from "~checker/components"; -import { useApplicationEvaluations, useGetPastApplications } from "~checker/hooks"; -import { getApplicationLinkOnExplorer, getExplorerUrl } from "~checker/utils"; -import { ProjectBanner } from "~project"; -import { ProjectSummary } from "~project"; +import { ReviewDropdownList } from "@/components"; +import { ApplicationSummary, SummaryAccordians } from "@/components/ApplicationSummary"; +import { useApplicationEvaluations, useGetPastApplications } from "@/hooks"; export interface ViewApplicationEvaluationsPageProps { chainId: number; diff --git a/packages/ui/src/features/checker/pages/ViewApplicationEvaluationsPage/index.ts b/apps/checker/src/pages/ViewApplicationEvaluationsPage/index.ts similarity index 100% rename from packages/ui/src/features/checker/pages/ViewApplicationEvaluationsPage/index.ts rename to apps/checker/src/pages/ViewApplicationEvaluationsPage/index.ts diff --git a/packages/ui/src/features/checker/pages/index.ts b/apps/checker/src/pages/index.ts similarity index 100% rename from packages/ui/src/features/checker/pages/index.ts rename to apps/checker/src/pages/index.ts diff --git a/packages/ui/src/features/checker/routers/CheckerRouter.tsx b/apps/checker/src/routers/CheckerRouter.tsx similarity index 88% rename from packages/ui/src/features/checker/routers/CheckerRouter.tsx rename to apps/checker/src/routers/CheckerRouter.tsx index 2b1445c1..425c9f17 100644 --- a/packages/ui/src/features/checker/routers/CheckerRouter.tsx +++ b/apps/checker/src/routers/CheckerRouter.tsx @@ -2,21 +2,20 @@ import { useEffect } from "react"; +import { EvaluationBody, ReviewBody } from "@gitcoin/types"; +import { Step } from "@gitcoin/ui/types"; import { match, P } from "ts-pattern"; import { Hex } from "viem"; -import { useCheckerContext } from "@/features/checker/store/hooks/useCheckerContext"; -import { Step } from "@/types"; - -import { useInitialize } from "~checker/hooks"; +import { useInitialize } from "@/hooks"; import { ApplicationEvaluationOverviewPage, ReviewApplicationsPage, SubmitApplicationEvaluationPage, SubmitFinalEvaluationPage, -} from "~checker/pages"; -import { CheckerRoute } from "~checker/store"; -import { EvaluationBody, ReviewBody } from "~checker/types"; +} from "@/pages"; +import { useCheckerContext } from "@/store"; +import { CheckerRoute } from "@/store"; export interface CheckerRouterProps { address: Hex; diff --git a/packages/ui/src/features/checker/routers/index.ts b/apps/checker/src/routers/index.ts similarity index 100% rename from packages/ui/src/features/checker/routers/index.ts rename to apps/checker/src/routers/index.ts diff --git a/packages/ui/src/features/checker/store/CheckerContext.ts b/apps/checker/src/store/CheckerContext.ts similarity index 100% rename from packages/ui/src/features/checker/store/CheckerContext.ts rename to apps/checker/src/store/CheckerContext.ts diff --git a/packages/ui/src/features/checker/store/CheckerProvider.tsx b/apps/checker/src/store/CheckerProvider.tsx similarity index 73% rename from packages/ui/src/features/checker/store/CheckerProvider.tsx rename to apps/checker/src/store/CheckerProvider.tsx index 07ac3eb6..d74c52a3 100644 --- a/packages/ui/src/features/checker/store/CheckerProvider.tsx +++ b/apps/checker/src/store/CheckerProvider.tsx @@ -1,15 +1,10 @@ import { PropsWithChildren, useReducer } from "react"; +import { Toaster } from "@gitcoin/ui"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; -import { Toaster } from "@/components/Toaster"; - -import { - CheckerContext, - CheckerDispatchContext, - initialState, -} from "~checker/store/CheckerContext"; -import { checkerReducer } from "~checker/store/checkerReducer"; +import { CheckerContext, CheckerDispatchContext, initialState } from "@/store/CheckerContext"; +import { checkerReducer } from "@/store/checkerReducer"; const queryClient = new QueryClient(); diff --git a/packages/ui/src/features/checker/store/actions/actions.ts b/apps/checker/src/store/actions/actions.ts similarity index 100% rename from packages/ui/src/features/checker/store/actions/actions.ts rename to apps/checker/src/store/actions/actions.ts diff --git a/packages/ui/src/features/checker/store/actions/index.ts b/apps/checker/src/store/actions/index.ts similarity index 100% rename from packages/ui/src/features/checker/store/actions/index.ts rename to apps/checker/src/store/actions/index.ts diff --git a/packages/ui/src/features/checker/store/actions/types.ts b/apps/checker/src/store/actions/types.ts similarity index 91% rename from packages/ui/src/features/checker/store/actions/types.ts rename to apps/checker/src/store/actions/types.ts index 429e3684..626e0296 100644 --- a/packages/ui/src/features/checker/store/actions/types.ts +++ b/apps/checker/src/store/actions/types.ts @@ -1,6 +1,7 @@ +import { CheckerPoolData } from "@gitcoin/types"; import { Hex } from "viem"; -import { CheckerPoolData, CheckerPoolFetchState } from "../types"; +import { CheckerPoolFetchState } from "../types"; export interface SetInitialStateAction { type: "SET_INITIAL_STATE"; diff --git a/packages/ui/src/features/checker/store/checkerReducer.ts b/apps/checker/src/store/checkerReducer.ts similarity index 96% rename from packages/ui/src/features/checker/store/checkerReducer.ts rename to apps/checker/src/store/checkerReducer.ts index 65c318b3..dc73d100 100644 --- a/packages/ui/src/features/checker/store/checkerReducer.ts +++ b/apps/checker/src/store/checkerReducer.ts @@ -1,4 +1,4 @@ -import { generatePoolUUID } from "~checker/utils/generatePoolUUID"; +import { generatePoolUUID } from "@gitcoin/utils/checker"; import { CheckerAction } from "./actions"; import { CheckerContextType, CheckerRoute } from "./types"; diff --git a/packages/ui/src/features/checker/store/hooks/index.ts b/apps/checker/src/store/hooks/index.ts similarity index 100% rename from packages/ui/src/features/checker/store/hooks/index.ts rename to apps/checker/src/store/hooks/index.ts diff --git a/packages/ui/src/features/checker/store/hooks/useCheckerContext.ts b/apps/checker/src/store/hooks/useCheckerContext.ts similarity index 100% rename from packages/ui/src/features/checker/store/hooks/useCheckerContext.ts rename to apps/checker/src/store/hooks/useCheckerContext.ts diff --git a/packages/ui/src/features/checker/store/hooks/useCheckerDispatchContext.ts b/apps/checker/src/store/hooks/useCheckerDispatchContext.ts similarity index 100% rename from packages/ui/src/features/checker/store/hooks/useCheckerDispatchContext.ts rename to apps/checker/src/store/hooks/useCheckerDispatchContext.ts diff --git a/packages/ui/src/features/checker/store/index.ts b/apps/checker/src/store/index.ts similarity index 100% rename from packages/ui/src/features/checker/store/index.ts rename to apps/checker/src/store/index.ts diff --git a/packages/ui/src/features/checker/store/types.ts b/apps/checker/src/store/types.ts similarity index 54% rename from packages/ui/src/features/checker/store/types.ts rename to apps/checker/src/store/types.ts index 0c170735..7238f257 100644 --- a/packages/ui/src/features/checker/store/types.ts +++ b/apps/checker/src/store/types.ts @@ -1,38 +1,12 @@ +import { CheckerPoolData } from "@gitcoin/types"; import { Hex } from "viem"; -import { ProjectApplicationForManager } from "~checker/services/allo"; -import { CheckerApiApplication, CheckerApiEvaluationQuestion } from "~checker/services/checker"; - -export interface CheckerApplication extends ProjectApplicationForManager, CheckerApiApplication { - lastFetchedAt?: Date; -} - -export interface PoolInfo { - roundName: string; - roundMetadata: { - name: string; - }; - project: { - id: string; - projectRoles: { - address: string; - }[]; - }; - strategyAddress: string; - strategyName: string; - applicationsStartTime: string; - applicationsEndTime: string; - donationsEndTime: string; - donationsStartTime: string; - programId: string; -} - -export interface CheckerPoolData extends PoolInfo { - chainId: number; - poolId: string; - applications: Record; - evaluationQuestions: CheckerApiEvaluationQuestion[]; - isPoolManager: boolean; +export enum CheckerRoute { + ReviewApplications = "review-applications", + ApplicationEvaluationOverview = "application-evaluation-overview", + SubmitApplicationEvaluation = "submit-application-evaluation", + SubmitFinalEvaluation = "submit-final-evaluation", + ApplicationEvaluation = "application-evaluation", } export interface CheckerPoolFetchState { @@ -45,14 +19,6 @@ export interface CheckerPoolFetchState { error: Error | null; } -export enum CheckerRoute { - ReviewApplications = "review-applications", - ApplicationEvaluationOverview = "application-evaluation-overview", - SubmitApplicationEvaluation = "submit-application-evaluation", - SubmitFinalEvaluation = "submit-final-evaluation", - ApplicationEvaluation = "application-evaluation", -} - export interface CheckerContextType { poolsData: Record; poolsFetchState: Record; diff --git a/apps/checker/tailwind.config.ts b/apps/checker/tailwind.config.ts new file mode 100644 index 00000000..88fe0ee4 --- /dev/null +++ b/apps/checker/tailwind.config.ts @@ -0,0 +1,9 @@ +import { withTV } from "tailwind-variants/transformer"; +import type { Config } from "tailwindcss"; +import { tailwindConfig } from "@gitcoin/themes" + + +export default withTV>({ + content: ["./src/**/*.{js,ts,jsx,tsx,mdx}"], + presets: [tailwindConfig], +}) satisfies Config; diff --git a/apps/checker/test-runner-jest.config.js b/apps/checker/test-runner-jest.config.js new file mode 100644 index 00000000..8b36cc53 --- /dev/null +++ b/apps/checker/test-runner-jest.config.js @@ -0,0 +1,15 @@ +import { getJestConfig } from "@storybook/test-runner"; + +// The default Jest configuration comes from @storybook/test-runner +const testRunnerConfig = getJestConfig(); + +/** + * @type {import('@jest/types').Config.InitialOptions} + */ +export default { + ...testRunnerConfig, + /** Add your own overrides below, and make sure + * to merge testRunnerConfig properties with your own + * @see https://jestjs.io/docs/configuration + */ +}; diff --git a/apps/checker/tsconfig.json b/apps/checker/tsconfig.json new file mode 100644 index 00000000..21811ce0 --- /dev/null +++ b/apps/checker/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, + "esModuleInterop": true, + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "declaration": true, + "jsx": "react-jsx", + + /* Linting */ + "strict": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "noFallthroughCasesInSwitch": true, + "baseUrl": ".", + "paths": { + "@/*": ["./src/*"] + }, + "outDir": "./dist" + }, + "include": ["src", "../../packages/utils/src/generatePoolUUID.ts"], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/apps/checker/tsconfig.node.json b/apps/checker/tsconfig.node.json new file mode 100644 index 00000000..d02c37df --- /dev/null +++ b/apps/checker/tsconfig.node.json @@ -0,0 +1,10 @@ +{ + "compilerOptions": { + "composite": true, + "skipLibCheck": true, + "module": "ESNext", + "moduleResolution": "bundler", + "strict": true + }, + "include": ["vite.config.ts"] +} diff --git a/apps/checker/vite.config.ts b/apps/checker/vite.config.ts new file mode 100644 index 00000000..e28f1418 --- /dev/null +++ b/apps/checker/vite.config.ts @@ -0,0 +1,50 @@ +import { defineConfig } from "vite"; +import dts from "vite-plugin-dts"; +import svgr from "vite-plugin-svgr"; + +import react from "@vitejs/plugin-react-swc"; + +import path, { resolve } from "path"; +import preserveDirectives from "rollup-preserve-directives"; +import tailwindcss from "tailwindcss"; + +export default defineConfig({ + build: { + lib: { + entry: { + index: resolve(__dirname, "./src/index.ts"), + }, + name: "gitcoin-checker", + fileName: (format: any, filename: any) => `${filename}.js`, + formats: ["es"], + }, + rollupOptions: { + external: ["react", "react-dom", "tailwindcss"], + output: { + globals: { + react: "React", + "react-dom": "ReactDOM", + tailwindcss: "tailwindcss", + }, + preserveModules: true, + preserveModulesRoot: "src", + }, + plugins: [preserveDirectives()], + }, + sourcemap: true, + emptyOutDir: true, + minify: false, + target: "esnext", + }, + plugins: [react(), svgr(), dts({ rollupTypes: true })], + resolve: { + alias: { + "@": path.resolve(__dirname, "./src"), + }, + }, + css: { + postcss: { + plugins: [tailwindcss], + }, + }, +}); diff --git a/apps/next-app/.eslintrc.js b/apps/next-app/.eslintrc.js deleted file mode 100644 index 82fe7214..00000000 --- a/apps/next-app/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -const config = require('@gitcoin/config/eslint-next'); - -module.exports = { - root: true, - extends: [config], - parser: "@typescript-eslint/parser", - parserOptions: { - project: true, - }, -}; diff --git a/apps/next-app/next-env.d.ts b/apps/next-app/next-env.d.ts deleted file mode 100644 index 40c3d680..00000000 --- a/apps/next-app/next-env.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -/// -/// - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information. diff --git a/apps/next-app/next.config.js b/apps/next-app/next.config.js deleted file mode 100644 index da1bb770..00000000 --- a/apps/next-app/next.config.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - reactStrictMode: true, -}; diff --git a/apps/next-app/package.json b/apps/next-app/package.json deleted file mode 100644 index f90c3f38..00000000 --- a/apps/next-app/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@repo/next-app", - "version": "0.0.0", - "private": true, - "scripts": { - "build": "next build", - "start": "next start ", - "dev": "next dev -p 3002", - "lint": "next lint", - "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next" - }, - "dependencies": { - "@gitcoin/ui": "workspace:*", - "@gitcoin/utils": "workspace:*", - "next": "^14.1.1", - "react": "18.3.1", - "react-dom": "18.3.1" - }, - "devDependencies": { - "@gitcoin/config": "workspace:*", - "@next/eslint-plugin-next": "^14.1.1", - "@types/node": "^22.10.2", - "@types/react": "^18.3.10", - "@types/react-dom": "^18.3.0", - "typescript": "5.4.2" - } -} diff --git a/apps/next-app/src/app/layout.tsx b/apps/next-app/src/app/layout.tsx deleted file mode 100644 index 08d14ca0..00000000 --- a/apps/next-app/src/app/layout.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import "@gitcoin/ui/styles.css" - -export default function RootLayout({ - children, -}: { - children: React.ReactNode; -}) { - return ( - - {children} - - ); -} diff --git a/apps/next-app/src/app/page.tsx b/apps/next-app/src/app/page.tsx deleted file mode 100644 index c743fe93..00000000 --- a/apps/next-app/src/app/page.tsx +++ /dev/null @@ -1,11 +0,0 @@ -import * as React from "react"; -import { Button } from "@gitcoin/ui"; - -export default function Page() { - return ( -
-

Web

-
- ); -} diff --git a/apps/next-app/tsconfig.json b/apps/next-app/tsconfig.json deleted file mode 100644 index a5a749af..00000000 --- a/apps/next-app/tsconfig.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "exclude": ["node_modules"], - "extends": "@gitcoin/config/tsconfig-nextjs.json", - "compilerOptions": { - "outDir": "dist", - "incremental": true, - "plugins": [ - { - "name": "next" - } - ] - }, - "include": ["src", "next-env.d.ts", ".next/types/**/*.ts"] -} diff --git a/package.json b/package.json index f551f91b..2e23a019 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "build": "turbo build", "dev": "turbo dev", "lint": "turbo lint", + "test": "turbo test", "clean": "turbo clean && rm -rf node_modules", "format": "prettier --write \"**/*.{ts,tsx,md}\"", "changeset": "changeset", diff --git a/packages/config/CHANGELOG.md b/packages/config/CHANGELOG.md index 55dc50a9..5551cf5f 100644 --- a/packages/config/CHANGELOG.md +++ b/packages/config/CHANGELOG.md @@ -1,5 +1,15 @@ # @gitcoin/config +## 1.0.0-next.0 + +### Major Changes + +- - moved packages/ui feature checker to apps/checker (npm: @gitcoin/checker) + - moved the types that were used by checker and ui to packages/types (npm: @gitcoin/types) + - moved the utils that were used by checker and ui to packages/utils (npm: @gitcoin/utils) + - moved allo and checker services from checker feature to packages/services (npm: + @packages/services) + ## 0.0.0-beta.41 ## 0.0.0-beta.40 diff --git a/packages/config/package.json b/packages/config/package.json index a5cef95b..7a63d1ed 100644 --- a/packages/config/package.json +++ b/packages/config/package.json @@ -1,6 +1,6 @@ { "name": "@gitcoin/config", - "version": "0.0.0-beta.41", + "version": "1.0.0-next.0", "repository": { "type": "git", "url": "https://github.com/gitcoinco/core", diff --git a/packages/config/tsconfig/react.json b/packages/config/tsconfig/react.json index c28bb214..02b38c23 100644 --- a/packages/config/tsconfig/react.json +++ b/packages/config/tsconfig/react.json @@ -3,7 +3,7 @@ "extends": "./base.json", "compilerOptions": { "jsx": "react-jsx", - "lib": ["dom", "ES2015"], + "lib": ["dom", "ES2017"], "module": "ESNext", "moduleResolution": "Bundler", "target": "es6" diff --git a/packages/example/README.md b/packages/example/README.md new file mode 100644 index 00000000..db9183d2 --- /dev/null +++ b/packages/example/README.md @@ -0,0 +1 @@ +# Example internal diff --git a/packages/example/package.json b/packages/example/package.json new file mode 100644 index 00000000..faf18255 --- /dev/null +++ b/packages/example/package.json @@ -0,0 +1,17 @@ +{ + "name": "@repo/example", + "version": "0.0.0", + "repository": { + "type": "git", + "url": "https://github.com/gitcoinco/core", + "directory": "packages/example" + }, + "sideEffects": false, + "license": "AGPL-3.0", + "scripts": {}, + "devDependencies": {}, + "dependencies": {}, + "publishConfig": { + "access": "public" + } +} diff --git a/packages/services/CHANGELOG.md b/packages/services/CHANGELOG.md new file mode 100644 index 00000000..7a355da9 --- /dev/null +++ b/packages/services/CHANGELOG.md @@ -0,0 +1,11 @@ +# @gitcoin/services + +## 1.0.0-next.0 + +### Major Changes + +- - moved packages/ui feature checker to apps/checker (npm: @gitcoin/checker) + - moved the types that were used by checker and ui to packages/types (npm: @gitcoin/types) + - moved the utils that were used by checker and ui to packages/utils (npm: @gitcoin/utils) + - moved allo and checker services from checker feature to packages/services (npm: + @packages/services) diff --git a/packages/services/README.md b/packages/services/README.md new file mode 100644 index 00000000..543ca90f --- /dev/null +++ b/packages/services/README.md @@ -0,0 +1 @@ +# @gitcoin/services diff --git a/packages/services/package.json b/packages/services/package.json new file mode 100644 index 00000000..f1268044 --- /dev/null +++ b/packages/services/package.json @@ -0,0 +1,43 @@ +{ + "name": "@gitcoin/services", + "version": "1.0.0-next.0", + "repository": { + "type": "git", + "url": "https://github.com/gitcoinco/core", + "directory": "packages/services" + }, + "exports": { + "./allo": { + "types": "./dist/allo.d.mts", + "import": "./dist/allo.mjs" + }, + "./checker": { + "types": "./dist/checker.d.mts", + "import": "./dist/checker.mjs" + } + }, + "sideEffects": false, + "license": "AGPL-3.0", + "scripts": { + "build": "tsup", + "dev": "tsup --watch", + "lint": "eslint . --max-warnings 0", + "clean": "rm -rf .turbo node_modules dist" + }, + "devDependencies": { + "@gitcoin/config": "workspace:*", + "@gitcoin/types": "workspace:*", + "@types/react": "^18.2.61", + "@types/react-dom": "^18.2.19", + "eslint": "^8.57.0", + "tsup": "^8.0.2", + "typescript": "5.5.4", + "viem": "^2.21.48" + }, + "publishConfig": { + "access": "public" + }, + "dependencies": { + "graphql-request": "^7.1.0" + } +} diff --git a/packages/ui/src/features/checker/services/allo/alloClient.ts b/packages/services/src/allo/alloClient.ts similarity index 100% rename from packages/ui/src/features/checker/services/allo/alloClient.ts rename to packages/services/src/allo/alloClient.ts diff --git a/packages/ui/src/features/checker/services/allo/dataLayer.ts b/packages/services/src/allo/dataLayer.ts similarity index 94% rename from packages/ui/src/features/checker/services/allo/dataLayer.ts rename to packages/services/src/allo/dataLayer.ts index 80a15d23..1cf5e970 100644 --- a/packages/ui/src/features/checker/services/allo/dataLayer.ts +++ b/packages/services/src/allo/dataLayer.ts @@ -1,5 +1,9 @@ -import { PoolInfo } from "~checker/store/types"; - +import { + PastApplication, + PoolInfo, + ProjectApplication, + ProjectApplicationForManager, +} from "@gitcoin/types"; import { executeQuery } from "./alloClient"; import { applicationsForManagerQuery, @@ -7,7 +11,6 @@ import { getPastApplicationsQueryByApplicationId, getRoundQuery, } from "./queries"; -import { PastApplication, ProjectApplication, ProjectApplicationForManager } from "./types"; export async function getApplicationsFromIndexer( chainId?: number, diff --git a/packages/ui/src/features/checker/services/allo/index.ts b/packages/services/src/allo/index.ts similarity index 69% rename from packages/ui/src/features/checker/services/allo/index.ts rename to packages/services/src/allo/index.ts index b7dbb140..7e02cc81 100644 --- a/packages/ui/src/features/checker/services/allo/index.ts +++ b/packages/services/src/allo/index.ts @@ -1,3 +1,2 @@ export * from "./dataLayer"; export * from "./queries"; -export * from "./types"; diff --git a/packages/ui/src/features/checker/services/allo/queries.ts b/packages/services/src/allo/queries.ts similarity index 100% rename from packages/ui/src/features/checker/services/allo/queries.ts rename to packages/services/src/allo/queries.ts diff --git a/packages/ui/src/features/checker/services/checker/api.ts b/packages/services/src/checker/api.ts similarity index 96% rename from packages/ui/src/features/checker/services/checker/api.ts rename to packages/services/src/checker/api.ts index b3d43fa6..a914b7bb 100644 --- a/packages/ui/src/features/checker/services/checker/api.ts +++ b/packages/services/src/checker/api.ts @@ -1,5 +1,4 @@ -import { EvaluationBody } from "../../types"; -import { ProjectApplicationForManager } from "../allo"; +import { EvaluationBody, ProjectApplicationForManager } from "@gitcoin/types"; import { CHECKER_ENDPOINT } from "./checkerClient"; export interface SyncPoolBody { diff --git a/packages/ui/src/features/checker/services/checker/checkerClient.ts b/packages/services/src/checker/checkerClient.ts similarity index 100% rename from packages/ui/src/features/checker/services/checker/checkerClient.ts rename to packages/services/src/checker/checkerClient.ts diff --git a/packages/ui/src/features/checker/services/checker/dataLayer.ts b/packages/services/src/checker/dataLayer.ts similarity index 93% rename from packages/ui/src/features/checker/services/checker/dataLayer.ts rename to packages/services/src/checker/dataLayer.ts index c28d9241..0a623654 100644 --- a/packages/ui/src/features/checker/services/checker/dataLayer.ts +++ b/packages/services/src/checker/dataLayer.ts @@ -1,6 +1,6 @@ +import { CheckerApiApplication, CheckerApiPoolData } from "@gitcoin/types"; import { executeQuery } from "./checkerClient"; import { checkerApplicationEvaluationsQuery, checkerPoolDataQuery } from "./queries"; -import { CheckerApiApplication, CheckerApiPoolData } from "./types"; export async function getCheckerPoolData( chainId?: number, diff --git a/packages/ui/src/features/checker/services/checker/index.ts b/packages/services/src/checker/index.ts similarity index 75% rename from packages/ui/src/features/checker/services/checker/index.ts rename to packages/services/src/checker/index.ts index 2e41c941..ca3ad97e 100644 --- a/packages/ui/src/features/checker/services/checker/index.ts +++ b/packages/services/src/checker/index.ts @@ -1,4 +1,3 @@ export * from "./api"; export * from "./dataLayer"; export * from "./queries"; -export * from "./types"; diff --git a/packages/ui/src/features/checker/services/checker/queries.ts b/packages/services/src/checker/queries.ts similarity index 100% rename from packages/ui/src/features/checker/services/checker/queries.ts rename to packages/services/src/checker/queries.ts diff --git a/packages/services/tsconfig.json b/packages/services/tsconfig.json new file mode 100644 index 00000000..eb684f4d --- /dev/null +++ b/packages/services/tsconfig.json @@ -0,0 +1,6 @@ +{ + "extends": "@gitcoin/config/tsconfig-react.json", + "include": ["."], + "exclude": ["dist", "build", "node_modules"] +} + diff --git a/packages/services/tsup.config.ts b/packages/services/tsup.config.ts new file mode 100644 index 00000000..cd8c0fcf --- /dev/null +++ b/packages/services/tsup.config.ts @@ -0,0 +1,11 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + entry: { + allo: "src/allo/index.ts", + checker: "src/checker/index.ts", + }, + format: ["esm"], + external: [], + dts: true, +}); diff --git a/packages/themes/CHANGELOG.md b/packages/themes/CHANGELOG.md index 74fcdce2..63af3242 100644 --- a/packages/themes/CHANGELOG.md +++ b/packages/themes/CHANGELOG.md @@ -1,5 +1,7 @@ # @gitcoin/themes +## 1.0.0-next.0 + ## 0.0.0-beta.41 ## 0.0.0-beta.40 diff --git a/packages/themes/package.json b/packages/themes/package.json index 255cd8e6..7b2665b1 100644 --- a/packages/themes/package.json +++ b/packages/themes/package.json @@ -1,6 +1,6 @@ { "name": "@gitcoin/themes", - "version": "0.0.0-beta.41", + "version": "1.0.0-next.0", "repository": { "type": "git", "url": "https://github.com/gitcoinco/core", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 6cd940a3..485b88ff 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,5 +1,15 @@ # @gitcoin/types +## 1.0.0-next.0 + +### Major Changes + +- - moved packages/ui feature checker to apps/checker (npm: @gitcoin/checker) + - moved the types that were used by checker and ui to packages/types (npm: @gitcoin/types) + - moved the utils that were used by checker and ui to packages/utils (npm: @gitcoin/utils) + - moved allo and checker services from checker feature to packages/services (npm: + @packages/services) + ## 0.0.0-beta.41 ## 0.0.0-beta.40 diff --git a/packages/types/package.json b/packages/types/package.json index 73c55d3a..affffc02 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,13 +1,13 @@ { "name": "@gitcoin/types", - "version": "0.0.0-beta.41", + "version": "1.0.0-next.0", "repository": { "type": "git", "url": "https://github.com/gitcoinco/core", "directory": "packages/types" }, - "types": "./dist/index.d.ts", - "main": "./dist/index.js", + "types": "./dist/index.d.mts", + "main": "./dist/index.mjs", "sideEffects": false, "license": "AGPL-3.0", "scripts": { @@ -22,10 +22,8 @@ "@types/react-dom": "^18.2.19", "eslint": "^8.57.0", "tsup": "^8.0.2", - "typescript": "5.5.4" - }, - "dependencies": { - "react": "18.3.1" + "typescript": "5.5.4", + "viem": "^2.21.48" }, "publishConfig": { "access": "public" diff --git a/packages/types/src/application.ts b/packages/types/src/application.ts new file mode 100644 index 00000000..0e04a3da --- /dev/null +++ b/packages/types/src/application.ts @@ -0,0 +1,150 @@ +import { Address } from "viem"; +import { CheckerApiApplication } from "./checkerApi"; +import { ProjectMetadata } from "./project"; + +export enum ApplicationStatus { + APPEAL = "APPEAL", + APPROVED = "APPROVED", + CANCELLED = "CANCELLED", + FRAUD = "FRAUD", + IN_REVIEW = "IN_REVIEW", + PENDING = "PENDING", + RECEIVED = "RECEIVED", + REJECTED = "REJECTED", +} + +export type ApplicationStatusType = keyof typeof ApplicationStatus; + +export interface ApplicationAnswer { + type: string; + hidden: boolean; + question: string; + questionId: number; + encryptedAnswer?: { + ciphertext: string; + encryptedSymmetricKey: string; + }; + answer: string; +} + +export interface ProjectApplicationMetadata { + signature: string; + application: { + round: string; + answers: ApplicationAnswer[]; + project: ProjectMetadata; + recipient: string; + }; +} + +export interface BaseDonorValues { + totalAmountDonatedInUsd: number; + totalDonationsCount: number; + uniqueDonorsCount: number; +} + +export interface ProjectApplication extends BaseDonorValues { + id: string; + projectId: string; + chainId: number; + roundId: string; + status: ApplicationStatusType; + metadataCid: string; + metadata: ProjectApplicationMetadata; + distributionTransaction: string | null; +} + +interface StatusSnapshot { + status: ApplicationStatusType; + updatedAtBlock: string; + updatedAt: string; +} + +export interface ProjectApplicationForManager extends ProjectApplication { + anchorAddress: Address; + statusSnapshots: StatusSnapshot[]; + project: { + projectRoles: { address: Address }[]; + }; +} + +export interface PastApplication { + id: string; + roundId: string; + statusSnapshots: StatusSnapshot[]; + status: ApplicationStatusType; + round: { + roundMetadata: { + name: string; + }; + }; +} + +export interface CheckerApplication extends ProjectApplicationForManager, CheckerApiApplication { + lastFetchedAt?: Date; +} + +export interface ApplicationAnswer { + type: string; + hidden: boolean; + question: string; + questionId: number; + encryptedAnswer?: { + ciphertext: string; + encryptedSymmetricKey: string; + }; + answer: string; +} + +export interface ProjectApplicationMetadata { + signature: string; + application: { + round: string; + answers: ApplicationAnswer[]; + project: ProjectMetadata; + recipient: string; + }; +} + +export interface BaseDonorValues { + totalAmountDonatedInUsd: number; + totalDonationsCount: number; + uniqueDonorsCount: number; +} + +export interface ProjectApplication extends BaseDonorValues { + id: string; + projectId: string; + chainId: number; + roundId: string; + status: ApplicationStatusType; + metadataCid: string; + metadata: ProjectApplicationMetadata; + distributionTransaction: string | null; +} + +export interface ProjectApplicationForManager extends ProjectApplication { + anchorAddress: Address; + statusSnapshots: StatusSnapshot[]; + project: { + projectRoles: { address: Address }[]; + }; +} + +export interface PastApplication { + id: string; + roundId: string; + statusSnapshots: StatusSnapshot[]; + status: ApplicationStatusType; + round: { + roundMetadata: { + name: string; + }; + }; +} + +interface StatusSnapshot { + status: ApplicationStatusType; + updatedAtBlock: string; + updatedAt: string; +} diff --git a/packages/types/src/button.ts b/packages/types/src/button.ts deleted file mode 100644 index 9b3d0ee7..00000000 --- a/packages/types/src/button.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ButtonProps { - children: React.ReactNode; -} diff --git a/packages/ui/src/features/checker/services/checker/types.ts b/packages/types/src/checkerApi.ts similarity index 88% rename from packages/ui/src/features/checker/services/checker/types.ts rename to packages/types/src/checkerApi.ts index dd823b17..c1ddf508 100644 --- a/packages/ui/src/features/checker/services/checker/types.ts +++ b/packages/types/src/checkerApi.ts @@ -1,4 +1,4 @@ -import { Evaluation } from "~checker/types"; +import { Evaluation } from "./evaluation"; export interface CheckerApiApplication { alloApplicationId: string; diff --git a/packages/ui/src/features/checker/types/evaluation.ts b/packages/types/src/evaluation.ts similarity index 100% rename from packages/ui/src/features/checker/types/evaluation.ts rename to packages/types/src/evaluation.ts diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts index 2b25e12b..be1de89b 100644 --- a/packages/types/src/index.ts +++ b/packages/types/src/index.ts @@ -1 +1,6 @@ -export * from "./button"; \ No newline at end of file +export * from "./application"; +export * from "./checkerApi"; +export * from "./evaluation"; +export * from "./pool"; +export * from "./project"; +export * from "./review"; diff --git a/packages/ui/src/types/pool.ts b/packages/types/src/pool.ts similarity index 65% rename from packages/ui/src/types/pool.ts rename to packages/types/src/pool.ts index a2e68d65..9c88c973 100644 --- a/packages/ui/src/types/pool.ts +++ b/packages/types/src/pool.ts @@ -1,14 +1,33 @@ -export enum PoolStatus { - PreRound = "PreRound", - RoundInProgress = "RoundInProgress", - ApplicationsInProgress = "ApplicationsInProgress", - FundingPending = "FundingPending", - Ended = "Ended", +import { CheckerApplication } from "./application"; +import { CheckerApiEvaluationQuestion } from "./checkerApi"; + +export interface PoolInfo { + roundName: string; + roundMetadata: { + name: string; + }; + project: { + id: string; + projectRoles: { + address: string; + }[]; + }; + strategyAddress: string; + strategyName: string; + applicationsStartTime: string; + applicationsEndTime: string; + donationsEndTime: string; + donationsStartTime: string; + programId: string; } -// Type guard for PoolStatus -export const isPoolStatus = (value: string): value is PoolStatus => - Object.values(PoolStatus).includes(value as PoolStatus); +export interface CheckerPoolData extends PoolInfo { + chainId: number; + poolId: string; + applications: Record; + evaluationQuestions: CheckerApiEvaluationQuestion[]; + isPoolManager: boolean; +} export enum PoolType { QuadraticFunding = "allov2.DonationVotingMerkleDistributionDirectTransferStrategy", @@ -16,9 +35,13 @@ export enum PoolType { Retrofunding = "allov2.EasyRetroFundingStrategy", } -// Type guard for PoolType -export const isPoolType = (value: string): value is PoolType => - Object.values(PoolType).includes(value as PoolType); +export enum PoolStatus { + PreRound = "PreRound", + RoundInProgress = "RoundInProgress", + ApplicationsInProgress = "ApplicationsInProgress", + FundingPending = "FundingPending", + Ended = "Ended", +} export interface PoolData { roundName: string; @@ -36,6 +59,14 @@ export interface PoolData { onClick?: (pool?: { chainId: number; roundId: string }) => void; } +// Type guard for PoolStatus +export const isPoolStatus = (value: string): value is PoolStatus => + Object.values(PoolStatus).includes(value as PoolStatus); + +// Type guard for PoolType +export const isPoolType = (value: string): value is PoolType => + Object.values(PoolType).includes(value as PoolType); + // Type guard for PoolData export const isPoolData = (value: any): value is PoolData => typeof value === "object" && @@ -46,3 +77,9 @@ export const isPoolData = (value: any): value is PoolData => isPoolStatus(value.poolStatus) && value.startDate instanceof Date && value.endDate instanceof Date; + +export enum PoolCategory { + QuadraticFunding, + Direct, + Retrofunding, +} diff --git a/packages/types/src/project.ts b/packages/types/src/project.ts new file mode 100644 index 00000000..2c5e266e --- /dev/null +++ b/packages/types/src/project.ts @@ -0,0 +1,58 @@ +import { Review } from "./review"; + +export type ProjectStatus = "pending" | "approved" | "rejected"; + +export interface ProjectReview { + id: string; + name: string; + date: Date; + avatarUrl: string; + reviews: Review[]; + aiSuggestion: number; + scoreAverage: number; +} + +export interface ProjectMetadata { + title: string; + description: string; + website: string; + bannerImg?: string; + logoImg?: string; + projectTwitter?: string; + userGithub?: string; + projectGithub?: string; + credentials: ProjectCredentials; + owners: ProjectOwner[]; + recipient?: string; + createdAt: number; + lastUpdated: number; +} + +export type ProjectCredentials = Record; + +export interface ProjectOwner { + address: string; +} + +export interface VerifiableCredential { + "@context": string[]; + type: string[]; + credentialSubject: { + id: string; + "@context": Record[]; + hash?: string; + provider?: string; + address?: string; + challenge?: string; + }; + issuer: string; + issuanceDate: string; + expirationDate: string; + proof: { + type: string; + proofPurpose: string; + verificationMethod: string; + created: string; + jws: string; + }; +} diff --git a/packages/ui/src/features/checker/types/review.ts b/packages/types/src/review.ts similarity index 99% rename from packages/ui/src/features/checker/types/review.ts rename to packages/types/src/review.ts index 98e848a6..842650ba 100644 --- a/packages/ui/src/features/checker/types/review.ts +++ b/packages/types/src/review.ts @@ -1,5 +1,4 @@ import { Address } from "viem"; - import { ApplicationStatusType } from "./application"; import { PoolCategory } from "./pool"; diff --git a/packages/types/src/stakePoolCard.ts b/packages/types/src/stakePoolCard.ts deleted file mode 100644 index f13bcc31..00000000 --- a/packages/types/src/stakePoolCard.ts +++ /dev/null @@ -1,18 +0,0 @@ -export interface StakePoolDataCardProps { - roundName: string; - roundDescription: string; - chainId: number; - roundId: string; - logoImg: string; - votingStartDate: Date; - votingEndDate: Date; - totalProjects: number; - totalStaked: number; - matchingPoolAmount: number; - stakedAmount?: number; - lastStakeDate?: Date; - claimed?: boolean; - isLoading?: boolean; - onClaim?: (pool: { chainId: number; roundId: string }) => void; - onClick?: (pool: { chainId: number; roundId: string }) => void; -} diff --git a/packages/types/tsup.config.ts b/packages/types/tsup.config.ts index 12767d9a..6b98f082 100644 --- a/packages/types/tsup.config.ts +++ b/packages/types/tsup.config.ts @@ -2,10 +2,9 @@ import { defineConfig } from "tsup"; export default defineConfig({ entry: { - "index": "src/index.ts", - // "./button": "src/button.ts", + index: "src/index.ts", }, format: ["esm"], - external: ["react"], + external: [], dts: true, }); diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index 73f32fb1..5fbc8133 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -1,5 +1,21 @@ # @gitcoin/ui +## 1.0.0-next.0 + +### Major Changes + +- - moved packages/ui feature checker to apps/checker (npm: @gitcoin/checker) + - moved the types that were used by checker and ui to packages/types (npm: @gitcoin/types) + - moved the utils that were used by checker and ui to packages/utils (npm: @gitcoin/utils) + - moved allo and checker services from checker feature to packages/services (npm: + @packages/services) + +### Patch Changes + +- Updated dependencies []: + - @gitcoin/services@1.0.0-next.0 + - @gitcoin/utils@1.0.0-next.0 + ## 0.0.0-beta.41 ### Patch Changes diff --git a/packages/ui/package.json b/packages/ui/package.json index dbc70956..e46f30a2 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -1,6 +1,6 @@ { "name": "@gitcoin/ui", - "version": "0.0.0-beta.41", + "version": "1.0.0-next.0", "repository": { "type": "git", "url": "https://github.com/gitcoinco/core", @@ -28,7 +28,6 @@ "preview": "vite", "storybook": "storybook dev -p 6006", "build-storybook": "storybook build", - "prepare": "husky", "chromatic": "chromatic", "generate-component": "npx tsx generateComponent.ts" }, @@ -99,31 +98,6 @@ "import": "./dist/theme.js", "require": "./dist/theme.js" }, - "./application": { - "types": "./dist/application.d.ts", - "import": "./dist/application.js", - "require": "./dist/application.js" - }, - "./checker": { - "types": "./dist/checker.d.ts", - "import": "./dist/checker.js", - "require": "./dist/checker.js" - }, - "./pool": { - "types": "./dist/pool.d.ts", - "import": "./dist/pool.js", - "require": "./dist/pool.js" - }, - "./program": { - "types": "./dist/program.d.ts", - "import": "./dist/program.js", - "require": "./dist/program.js" - }, - "./project": { - "types": "./dist/project.d.ts", - "import": "./dist/project.js", - "require": "./dist/project.js" - }, "./retrofunding": { "types": "./dist/retrofunding.d.ts", "import": "./dist/retrofunding.js", @@ -134,6 +108,7 @@ "@chromatic-com/storybook": "^3.2.2", "@eslint/js": "^9.11.1", "@gitcoin/themes": "workspace:*", + "@gitcoin/types": "workspace:*", "@gitcoinco/passport-sdk-types": "^0.2.0", "@storybook/addon-a11y": "^8.4.4", "@storybook/addon-essentials": "^8.4.4", @@ -163,7 +138,6 @@ "axe-playwright": "^2.0.3", "chromatic": "^11.12.6", "clsx": "^2.1.1", - "concurrently": "^9.0.1", "eslint": "^9.11.1", "eslint-config-prettier": "^9.1.0", "eslint-plugin-tailwindcss": "^3.17.5", @@ -177,15 +151,12 @@ "msw-storybook-addon": "^2.0.4", "path": "^0.12.7", "playwright": "^1.48.1", - "plotly.js": "^3.0.1", "postcss": "^8.4.47", "prettier": "3.1.0", "prettier-plugin-tailwindcss": "0.5.7", "react": "18.3.1", "react-dom": "18.3.1", - "react-plotly.js": "^2.6.0", "rollup-preserve-directives": "^1.1.3", - "semantic-release": "^24.2.0", "storybook": "^8.4.7", "tailwind-merge": "^2.5.4", "tailwindcss": "^3.4.14", @@ -195,8 +166,7 @@ "typescript-eslint": "^8.10.0", "vite": "^6.0.3", "vite-plugin-dts": "^4.3.0", - "vitest": "^2.1.3", - "wait-on": "^8.0.1" + "vitest": "^2.1.3" }, "peerDependencies": { "react": "18.3.1", @@ -216,7 +186,8 @@ ] }, "dependencies": { - "@gitcoin/gitcoin-chain-data": "^1.0.43", + "@gitcoin/services": "workspace:*", + "@gitcoin/utils": "workspace:*", "@heroicons/react": "1.0.6", "@hookform/resolvers": "^3.9.0", "@radix-ui/react-accordion": "^1.2.1", @@ -253,7 +224,6 @@ "cmdk": "1.0.0", "decimal.js": "^10.5.0", "embla-carousel-react": "^8.3.0", - "graphql-request": "^7.1.0", "idb": "^8.0.1", "input-otp": "^1.2.4", "lodash": "^4.17.21", @@ -261,10 +231,12 @@ "moment-timezone": "^0.5.46", "next-themes": "^0.3.0", "papaparse": "^5.4.1", + "plotly.js": "^3.0.1", "react-day-picker": "9.3.2", "react-hook-form": "^7.53.0", "react-markdown": "^9.0.3", "react-number-format": "^5.4.3", + "react-plotly.js": "^2.6.0", "react-resizable-panels": "^2.1.4", "react-use": "^17.6.0", "recharts": "^2.15.0", diff --git a/packages/ui/src/client.ts b/packages/ui/src/client.ts index 9ff7dd63..4609f25e 100644 --- a/packages/ui/src/client.ts +++ b/packages/ui/src/client.ts @@ -1,9 +1,8 @@ export * from "./primitives/Accordion"; +export * from "./primitives/Markdown"; export * from "./primitives/MarkdownEditor"; export * from "./components/ProgressForm"; export * from "./components/Form"; export * from "./components/FormWithPersist"; export * from "./components/MultipleSelect"; -export * from "./features/pool/components/PoolList"; -export * from "./features/program/components/ProgramList"; export * from "./components/ProgressModal"; diff --git a/packages/ui/src/components/AllocationSidebar/AllocationSidebar.tsx b/packages/ui/src/components/AllocationSidebar/AllocationSidebar.tsx index 88658f71..6e72a4ed 100644 --- a/packages/ui/src/components/AllocationSidebar/AllocationSidebar.tsx +++ b/packages/ui/src/components/AllocationSidebar/AllocationSidebar.tsx @@ -2,7 +2,8 @@ import { ReactNode } from "react"; -import { cn } from "@/lib/utils"; +import { cn } from "@gitcoin/utils"; + import { ScrollArea, ScrollBar } from "@/primitives/ScrollArea"; import { ProjectAllocation, SortConfig } from "@/types"; diff --git a/packages/ui/src/components/AllocationSidebar/components/AllocationItem.tsx b/packages/ui/src/components/AllocationSidebar/components/AllocationItem.tsx index d18ee0bb..f5df9e25 100644 --- a/packages/ui/src/components/AllocationSidebar/components/AllocationItem.tsx +++ b/packages/ui/src/components/AllocationSidebar/components/AllocationItem.tsx @@ -2,10 +2,11 @@ import { PropsWithChildren } from "react"; -import { cn } from "@/lib/utils"; +import { cn } from "@gitcoin/utils"; + +import { DefaultLogo } from "@/assets"; import { Skeleton } from "@/primitives/Skeleton"; import { ProjectAllocation } from "@/types"; -import { DefaultLogo } from "@/assets"; export const AllocationItem = ({ id, @@ -39,9 +40,7 @@ export const AllocationItem = ({ }} /> ) : ( - + )}
{name || ( diff --git a/packages/ui/src/components/AllocationSidebar/components/SkeletonAllocationItems.tsx b/packages/ui/src/components/AllocationSidebar/components/SkeletonAllocationItems.tsx index 2b3a184e..00a20921 100644 --- a/packages/ui/src/components/AllocationSidebar/components/SkeletonAllocationItems.tsx +++ b/packages/ui/src/components/AllocationSidebar/components/SkeletonAllocationItems.tsx @@ -1,6 +1,7 @@ "use client"; -import { cn } from "@/lib/utils"; +import { cn } from "@gitcoin/utils"; + import { Skeleton } from "@/primitives/Skeleton"; import { AllocationItem } from "./AllocationItem"; diff --git a/packages/ui/src/features/application/components/ApplicationBadge/ApplicationBadge.mdx b/packages/ui/src/components/Application/ApplicationBadge/ApplicationBadge.mdx similarity index 100% rename from packages/ui/src/features/application/components/ApplicationBadge/ApplicationBadge.mdx rename to packages/ui/src/components/Application/ApplicationBadge/ApplicationBadge.mdx diff --git a/packages/ui/src/features/application/components/ApplicationBadge/ApplicationBadge.stories.tsx b/packages/ui/src/components/Application/ApplicationBadge/ApplicationBadge.stories.tsx similarity index 100% rename from packages/ui/src/features/application/components/ApplicationBadge/ApplicationBadge.stories.tsx rename to packages/ui/src/components/Application/ApplicationBadge/ApplicationBadge.stories.tsx diff --git a/packages/ui/src/features/application/components/ApplicationBadge/ApplicationBadge.tsx b/packages/ui/src/components/Application/ApplicationBadge/ApplicationBadge.tsx similarity index 100% rename from packages/ui/src/features/application/components/ApplicationBadge/ApplicationBadge.tsx rename to packages/ui/src/components/Application/ApplicationBadge/ApplicationBadge.tsx diff --git a/packages/ui/src/features/application/components/ApplicationBadge/index.ts b/packages/ui/src/components/Application/ApplicationBadge/index.ts similarity index 100% rename from packages/ui/src/features/application/components/ApplicationBadge/index.ts rename to packages/ui/src/components/Application/ApplicationBadge/index.ts diff --git a/packages/ui/src/components/Application/index.ts b/packages/ui/src/components/Application/index.ts new file mode 100644 index 00000000..11f6b3fe --- /dev/null +++ b/packages/ui/src/components/Application/index.ts @@ -0,0 +1 @@ +export * from "./ApplicationBadge"; diff --git a/packages/ui/src/components/CreateButton/CreateButton.tsx b/packages/ui/src/components/CreateButton/CreateButton.tsx index 3d7ce760..e8fe8050 100644 --- a/packages/ui/src/components/CreateButton/CreateButton.tsx +++ b/packages/ui/src/components/CreateButton/CreateButton.tsx @@ -1,8 +1,8 @@ "use client"; +import { cn } from "@gitcoin/utils"; import { tv, VariantProps } from "tailwind-variants"; -import { cn } from "@/lib"; import { Icon, IconType } from "@/primitives/Icon"; const variants = tv({ diff --git a/packages/ui/src/components/Form/Form.tsx b/packages/ui/src/components/Form/Form.tsx index 50bfa366..2334fd07 100644 --- a/packages/ui/src/components/Form/Form.tsx +++ b/packages/ui/src/components/Form/Form.tsx @@ -3,10 +3,10 @@ import { useRef } from "react"; import { UseFormReturn } from "react-hook-form"; +import { cn } from "@gitcoin/utils"; import { tv, VariantProps } from "tailwind-variants"; import { Form_ } from "@/components/_Form"; -import { cn } from "@/lib/utils"; import { Button } from "@/primitives/Button"; import { FormStep } from "@/types"; diff --git a/packages/ui/src/components/FormWithPersist/FormWithPersist.tsx b/packages/ui/src/components/FormWithPersist/FormWithPersist.tsx index 033ad5c0..f8b54db9 100644 --- a/packages/ui/src/components/FormWithPersist/FormWithPersist.tsx +++ b/packages/ui/src/components/FormWithPersist/FormWithPersist.tsx @@ -3,10 +3,10 @@ import { useRef } from "react"; import { UseFormReturn } from "react-hook-form"; +import { cn } from "@gitcoin/utils"; import { tv, VariantProps } from "tailwind-variants"; import { FormWithPersist_ } from "@/components/_Form"; -import { cn } from "@/lib/utils"; import { Button } from "@/primitives/Button"; import { FormWithPersistStep } from "@/types"; diff --git a/packages/ui/src/components/IconLabel/IconLabel.stories.tsx b/packages/ui/src/components/IconLabel/IconLabel.stories.tsx index 54f14c82..79ab33b5 100644 --- a/packages/ui/src/components/IconLabel/IconLabel.stories.tsx +++ b/packages/ui/src/components/IconLabel/IconLabel.stories.tsx @@ -1,8 +1,8 @@ // IconLabel.stories.tsx +import { DateFormat, formatDate } from "@gitcoin/utils"; import type { Meta, StoryObj } from "@storybook/react"; import { expect, within } from "@storybook/test"; -import { DateFormat, formatDate } from "@/lib/dates/formatDate"; import { IconType } from "@/primitives/Icon"; import { IconLabel } from "./IconLabel"; diff --git a/packages/ui/src/components/IconLabel/IconLabel.tsx b/packages/ui/src/components/IconLabel/IconLabel.tsx index 2512ae7b..5d839302 100644 --- a/packages/ui/src/components/IconLabel/IconLabel.tsx +++ b/packages/ui/src/components/IconLabel/IconLabel.tsx @@ -2,10 +2,10 @@ import React from "react"; +import { getAddressLabel } from "@gitcoin/utils"; +import { formatDate, DateFormat } from "@gitcoin/utils"; import { match } from "ts-pattern"; -import { formatDate, DateFormat } from "@/lib/dates/formatDate"; -import { getAddressLabel } from "@/lib/utils"; import { Icon, IconType } from "@/primitives/Icon"; import { Skeleton } from "@/primitives/Skeleton"; diff --git a/packages/ui/src/components/IconLabel/IconLabelContainer.tsx b/packages/ui/src/components/IconLabel/IconLabelContainer.tsx index 43a9c76b..4030fd6c 100644 --- a/packages/ui/src/components/IconLabel/IconLabelContainer.tsx +++ b/packages/ui/src/components/IconLabel/IconLabelContainer.tsx @@ -1,4 +1,5 @@ -import { cn } from "@/lib/utils"; +import { cn } from "@gitcoin/utils"; + import { Icon, IconType } from "@/primitives/Icon"; import { variants } from "./variants"; diff --git a/packages/ui/src/components/IconLabel/types.ts b/packages/ui/src/components/IconLabel/types.ts index 61d527ac..bbf338bd 100644 --- a/packages/ui/src/components/IconLabel/types.ts +++ b/packages/ui/src/components/IconLabel/types.ts @@ -1,6 +1,7 @@ import { ReactNode } from "react"; -import { DateFormat } from "@/lib/dates/formatDate"; +import { DateFormat } from "@gitcoin/utils"; + import { IconType } from "@/primitives/Icon"; interface CustomVariantProps { diff --git a/packages/ui/src/components/IconWithTooltip/IconWithTooltip.tsx b/packages/ui/src/components/IconWithTooltip/IconWithTooltip.tsx index fd14e138..2b155a9e 100644 --- a/packages/ui/src/components/IconWithTooltip/IconWithTooltip.tsx +++ b/packages/ui/src/components/IconWithTooltip/IconWithTooltip.tsx @@ -5,7 +5,7 @@ import { TooltipTrigger, TooltipProvider, TooltipContentProps, -} from "@/ui-shadcn/tooltip"; +} from "@/primitives/Tooltip"; interface IconWithTooltipProps extends TooltipContentProps { iconType: IconType; diff --git a/packages/ui/src/components/MultipleSelect/MultipleSelect.tsx b/packages/ui/src/components/MultipleSelect/MultipleSelect.tsx index 482fb169..b8b41bac 100644 --- a/packages/ui/src/components/MultipleSelect/MultipleSelect.tsx +++ b/packages/ui/src/components/MultipleSelect/MultipleSelect.tsx @@ -2,9 +2,9 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { ChevronDown, ChevronUp } from "lucide-react"; -import { cn } from "@/lib/utils"; import { Command, CommandList } from "@/ui-shadcn/command"; import { Popover, PopoverContent, PopoverTrigger } from "@/ui-shadcn/popover"; diff --git a/packages/ui/src/components/MultipleSelect/components/MultipleSelectGroupContent.tsx b/packages/ui/src/components/MultipleSelect/components/MultipleSelectGroupContent.tsx index a44a563b..53a58c65 100644 --- a/packages/ui/src/components/MultipleSelect/components/MultipleSelectGroupContent.tsx +++ b/packages/ui/src/components/MultipleSelect/components/MultipleSelectGroupContent.tsx @@ -1,6 +1,6 @@ +import { cn } from "@gitcoin/utils"; import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "@heroicons/react/solid"; -import { cn } from "@/lib/utils"; import { Checkbox } from "@/primitives/Checkbox"; import { CommandItem } from "@/ui-shadcn/command"; import { CommandGroup } from "@/ui-shadcn/command"; diff --git a/packages/ui/src/components/MultipleSelect/components/MultipleSelectItemRow.tsx b/packages/ui/src/components/MultipleSelect/components/MultipleSelectItemRow.tsx index a98676c0..e7bece85 100644 --- a/packages/ui/src/components/MultipleSelect/components/MultipleSelectItemRow.tsx +++ b/packages/ui/src/components/MultipleSelect/components/MultipleSelectItemRow.tsx @@ -1,4 +1,5 @@ -import { cn } from "@/lib/utils"; +import { cn } from "@gitcoin/utils"; + import { Icon } from "@/primitives/Icon"; import { MultipleSelectItem } from "../types"; diff --git a/packages/ui/src/components/Navbar/components/NavbarGeneric.tsx b/packages/ui/src/components/Navbar/components/NavbarGeneric.tsx index 73869999..366ca30f 100644 --- a/packages/ui/src/components/Navbar/components/NavbarGeneric.tsx +++ b/packages/ui/src/components/Navbar/components/NavbarGeneric.tsx @@ -2,10 +2,9 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { tv, type VariantProps } from "tailwind-variants"; -import { cn } from "@/lib"; - import { filterAndSortChildren } from "../utils/filterAndSortChildren"; const navbarVariants = tv({ diff --git a/packages/ui/src/components/Navbar/components/NavbarSections.tsx b/packages/ui/src/components/Navbar/components/NavbarSections.tsx index 892af763..0843f4fe 100644 --- a/packages/ui/src/components/Navbar/components/NavbarSections.tsx +++ b/packages/ui/src/components/Navbar/components/NavbarSections.tsx @@ -1,9 +1,8 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; -import { cn } from "@/lib"; - const navbarSectionStyle = tv({ base: "flex items-center gap-4", variants: { diff --git a/packages/ui/src/components/Navbar/components/NavbarSeparator.tsx b/packages/ui/src/components/Navbar/components/NavbarSeparator.tsx index 9e78179c..8e595989 100644 --- a/packages/ui/src/components/Navbar/components/NavbarSeparator.tsx +++ b/packages/ui/src/components/Navbar/components/NavbarSeparator.tsx @@ -1,9 +1,8 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; -import { cn } from "@/lib"; - const separatorStyle = tv({ base: "h-4 w-0 border-1.5 border-grey-900 bg-grey-900", }); diff --git a/packages/ui/src/components/Navbar/components/NavbarTitle.tsx b/packages/ui/src/components/Navbar/components/NavbarTitle.tsx index e889175d..0c8ad2cd 100644 --- a/packages/ui/src/components/Navbar/components/NavbarTitle.tsx +++ b/packages/ui/src/components/Navbar/components/NavbarTitle.tsx @@ -1,4 +1,4 @@ -import { cn } from "@/lib"; +import { cn } from "@gitcoin/utils"; export interface NavbarTitleProps { text: string; diff --git a/packages/ui/src/features/pool/components/PoolBadge/PoolBadge.mdx b/packages/ui/src/components/Pool/PoolBadge/PoolBadge.mdx similarity index 100% rename from packages/ui/src/features/pool/components/PoolBadge/PoolBadge.mdx rename to packages/ui/src/components/Pool/PoolBadge/PoolBadge.mdx diff --git a/packages/ui/src/features/pool/components/PoolBadge/PoolBadge.stories.tsx b/packages/ui/src/components/Pool/PoolBadge/PoolBadge.stories.tsx similarity index 98% rename from packages/ui/src/features/pool/components/PoolBadge/PoolBadge.stories.tsx rename to packages/ui/src/components/Pool/PoolBadge/PoolBadge.stories.tsx index 6e46626e..baf3cb84 100644 --- a/packages/ui/src/features/pool/components/PoolBadge/PoolBadge.stories.tsx +++ b/packages/ui/src/components/Pool/PoolBadge/PoolBadge.stories.tsx @@ -1,7 +1,6 @@ +import { PoolStatus, PoolType } from "@gitcoin/types"; import { Meta, StoryObj } from "@storybook/react"; -import { PoolStatus, PoolType } from "@/types"; - import { PoolBadge } from "./PoolBadge"; const meta: Meta = { diff --git a/packages/ui/src/features/pool/components/PoolBadge/PoolBadge.tsx b/packages/ui/src/components/Pool/PoolBadge/PoolBadge.tsx similarity index 98% rename from packages/ui/src/features/pool/components/PoolBadge/PoolBadge.tsx rename to packages/ui/src/components/Pool/PoolBadge/PoolBadge.tsx index 001c0ed7..25d6eead 100644 --- a/packages/ui/src/features/pool/components/PoolBadge/PoolBadge.tsx +++ b/packages/ui/src/components/Pool/PoolBadge/PoolBadge.tsx @@ -2,10 +2,10 @@ import * as React from "react"; +import { isPoolStatus, isPoolType, PoolStatus, PoolType } from "@gitcoin/types"; import { match, P } from "ts-pattern"; import { Badge } from "@/primitives/Badge"; -import { isPoolStatus, isPoolType, PoolStatus, PoolType } from "@/types"; import { PoolStatusBadge } from "../PoolStatusBadge"; import { PoolTypeBadge } from "../PoolTypeBadge"; diff --git a/packages/ui/src/features/pool/components/PoolBadge/index.ts b/packages/ui/src/components/Pool/PoolBadge/index.ts similarity index 100% rename from packages/ui/src/features/pool/components/PoolBadge/index.ts rename to packages/ui/src/components/Pool/PoolBadge/index.ts diff --git a/packages/ui/src/features/pool/components/PoolCard/PoolCard.mdx b/packages/ui/src/components/Pool/PoolCard/PoolCard.mdx similarity index 100% rename from packages/ui/src/features/pool/components/PoolCard/PoolCard.mdx rename to packages/ui/src/components/Pool/PoolCard/PoolCard.mdx diff --git a/packages/ui/src/features/pool/components/PoolCard/PoolCard.stories.tsx b/packages/ui/src/components/Pool/PoolCard/PoolCard.stories.tsx similarity index 97% rename from packages/ui/src/features/pool/components/PoolCard/PoolCard.stories.tsx rename to packages/ui/src/components/Pool/PoolCard/PoolCard.stories.tsx index 66b0920c..0b363d84 100644 --- a/packages/ui/src/features/pool/components/PoolCard/PoolCard.stories.tsx +++ b/packages/ui/src/components/Pool/PoolCard/PoolCard.stories.tsx @@ -1,8 +1,8 @@ +import { PoolStatus, PoolType } from "@gitcoin/types"; import { action } from "@storybook/addon-actions"; import { Meta, StoryObj } from "@storybook/react"; import { createQueryState } from "@/lib"; -import { PoolStatus, PoolType } from "@/types"; import { PoolCard, PoolCardProps, PoolCardQueryProps } from "./PoolCard"; diff --git a/packages/ui/src/features/pool/components/PoolCard/PoolCard.tsx b/packages/ui/src/components/Pool/PoolCard/PoolCard.tsx similarity index 97% rename from packages/ui/src/features/pool/components/PoolCard/PoolCard.tsx rename to packages/ui/src/components/Pool/PoolCard/PoolCard.tsx index c960595b..44ea8eb3 100644 --- a/packages/ui/src/features/pool/components/PoolCard/PoolCard.tsx +++ b/packages/ui/src/components/Pool/PoolCard/PoolCard.tsx @@ -1,11 +1,11 @@ "use client"; +import { PoolData } from "@gitcoin/types"; import { UseQueryResult } from "@tanstack/react-query"; import { match, P } from "ts-pattern"; import { Badge } from "@/primitives/Badge"; import { Skeleton } from "@/primitives/Skeleton"; -import { PoolData } from "@/types"; import { PoolDataCard } from "./PoolDataCard"; diff --git a/packages/ui/src/features/pool/components/PoolCard/PoolDataCard.tsx b/packages/ui/src/components/Pool/PoolCard/PoolDataCard.tsx similarity index 98% rename from packages/ui/src/features/pool/components/PoolCard/PoolDataCard.tsx rename to packages/ui/src/components/Pool/PoolCard/PoolDataCard.tsx index 0324141f..a6a20616 100644 --- a/packages/ui/src/features/pool/components/PoolCard/PoolDataCard.tsx +++ b/packages/ui/src/components/Pool/PoolCard/PoolDataCard.tsx @@ -1,10 +1,11 @@ "use client"; +import { PoolData } from "@gitcoin/types"; + import { DefaultLogo } from "@/assets"; import { IconLabel } from "@/components/IconLabel"; import { getChainInfo } from "@/lib"; import { IconType } from "@/primitives/Icon"; -import { PoolData } from "@/types"; import { PoolBadge } from "../PoolBadge"; diff --git a/packages/ui/src/features/pool/components/PoolCard/index.ts b/packages/ui/src/components/Pool/PoolCard/index.ts similarity index 100% rename from packages/ui/src/features/pool/components/PoolCard/index.ts rename to packages/ui/src/components/Pool/PoolCard/index.ts diff --git a/packages/ui/src/features/pool/components/PoolCardGroup/PoolCardGroup.stories.tsx b/packages/ui/src/components/Pool/PoolCardGroup/PoolCardGroup.stories.tsx similarity index 97% rename from packages/ui/src/features/pool/components/PoolCardGroup/PoolCardGroup.stories.tsx rename to packages/ui/src/components/Pool/PoolCardGroup/PoolCardGroup.stories.tsx index 669e0e68..63785596 100644 --- a/packages/ui/src/features/pool/components/PoolCardGroup/PoolCardGroup.stories.tsx +++ b/packages/ui/src/components/Pool/PoolCardGroup/PoolCardGroup.stories.tsx @@ -1,8 +1,7 @@ +import { PoolStatus, PoolType } from "@gitcoin/types"; import { action } from "@storybook/addon-actions"; import type { Meta, StoryObj } from "@storybook/react"; -import { PoolStatus, PoolType } from "@/types"; - import { PoolCardGroup } from "./PoolCardGroup"; const onPoolClick = action("Pool Clicked!"); diff --git a/packages/ui/src/features/pool/components/PoolCardGroup/PoolCardGroup.tsx b/packages/ui/src/components/Pool/PoolCardGroup/PoolCardGroup.tsx similarity index 87% rename from packages/ui/src/features/pool/components/PoolCardGroup/PoolCardGroup.tsx rename to packages/ui/src/components/Pool/PoolCardGroup/PoolCardGroup.tsx index 99e56b1c..219713ad 100644 --- a/packages/ui/src/features/pool/components/PoolCardGroup/PoolCardGroup.tsx +++ b/packages/ui/src/components/Pool/PoolCardGroup/PoolCardGroup.tsx @@ -2,16 +2,9 @@ import { tv } from "tailwind-variants"; -import { PoolCard, PoolCardProps } from "../PoolCard"; +import { JustifyVariants } from "@/types"; -export type JustifyVariants = - | "normal" - | "start" - | "end" - | "center" - | "between" - | "around" - | "evenly"; +import { PoolCard, PoolCardProps } from "../PoolCard"; export interface PoolCardGroupProps { pools: PoolCardProps[]; diff --git a/packages/ui/src/features/pool/components/PoolCardGroup/index.ts b/packages/ui/src/components/Pool/PoolCardGroup/index.ts similarity index 100% rename from packages/ui/src/features/pool/components/PoolCardGroup/index.ts rename to packages/ui/src/components/Pool/PoolCardGroup/index.ts diff --git a/packages/ui/src/features/pool/components/PoolList/PoolList.stories.tsx b/packages/ui/src/components/Pool/PoolList/PoolList.stories.tsx similarity index 95% rename from packages/ui/src/features/pool/components/PoolList/PoolList.stories.tsx rename to packages/ui/src/components/Pool/PoolList/PoolList.stories.tsx index 9d86d619..dc000df7 100644 --- a/packages/ui/src/features/pool/components/PoolList/PoolList.stories.tsx +++ b/packages/ui/src/components/Pool/PoolList/PoolList.stories.tsx @@ -1,9 +1,7 @@ +import { PoolStatus, PoolType } from "@gitcoin/types"; import { action } from "@storybook/addon-actions"; import type { Meta, StoryObj } from "@storybook/react"; -import { PoolType } from "@/types"; -import { PoolStatus } from "@/types/pool"; - import { PoolList } from "./PoolList"; const onPoolClick = action("Pool clicked!"); diff --git a/packages/ui/src/features/pool/components/PoolList/PoolList.tsx b/packages/ui/src/components/Pool/PoolList/PoolList.tsx similarity index 100% rename from packages/ui/src/features/pool/components/PoolList/PoolList.tsx rename to packages/ui/src/components/Pool/PoolList/PoolList.tsx diff --git a/packages/ui/src/features/pool/components/PoolList/hooks/index.ts b/packages/ui/src/components/Pool/PoolList/hooks/index.ts similarity index 100% rename from packages/ui/src/features/pool/components/PoolList/hooks/index.ts rename to packages/ui/src/components/Pool/PoolList/hooks/index.ts diff --git a/packages/ui/src/features/pool/components/PoolList/hooks/useFilteredAndOrderedPools.ts b/packages/ui/src/components/Pool/PoolList/hooks/useFilteredAndOrderedPools.ts similarity index 97% rename from packages/ui/src/features/pool/components/PoolList/hooks/useFilteredAndOrderedPools.ts rename to packages/ui/src/components/Pool/PoolList/hooks/useFilteredAndOrderedPools.ts index e0380a53..70333a68 100644 --- a/packages/ui/src/features/pool/components/PoolList/hooks/useFilteredAndOrderedPools.ts +++ b/packages/ui/src/components/Pool/PoolList/hooks/useFilteredAndOrderedPools.ts @@ -1,6 +1,6 @@ import { useMemo } from "react"; -import { PoolData, PoolStatus } from "@/types/pool"; +import { PoolData, PoolStatus } from "@gitcoin/types"; interface UseFilteredAndOrderedPoolsProps { pools: PoolData[]; diff --git a/packages/ui/src/features/pool/components/PoolList/index.ts b/packages/ui/src/components/Pool/PoolList/index.ts similarity index 100% rename from packages/ui/src/features/pool/components/PoolList/index.ts rename to packages/ui/src/components/Pool/PoolList/index.ts diff --git a/packages/ui/src/features/pool/components/PoolList/utils.ts b/packages/ui/src/components/Pool/PoolList/utils.ts similarity index 97% rename from packages/ui/src/features/pool/components/PoolList/utils.ts rename to packages/ui/src/components/Pool/PoolList/utils.ts index e344da3b..2822616b 100644 --- a/packages/ui/src/features/pool/components/PoolList/utils.ts +++ b/packages/ui/src/components/Pool/PoolList/utils.ts @@ -1,6 +1,7 @@ +import { PoolData } from "@gitcoin/types"; + import { MultipleSelectGroup } from "@/components/MultipleSelect/types"; import { getChainInfo } from "@/lib"; -import { PoolData } from "@/types/pool"; export const getSortFilterOptions = (pools: PoolData[]) => { const orderOptions = [ diff --git a/packages/ui/src/features/pool/components/PoolStatusBadge/PoolStatusBadge.stories.tsx b/packages/ui/src/components/Pool/PoolStatusBadge/PoolStatusBadge.stories.tsx similarity index 97% rename from packages/ui/src/features/pool/components/PoolStatusBadge/PoolStatusBadge.stories.tsx rename to packages/ui/src/components/Pool/PoolStatusBadge/PoolStatusBadge.stories.tsx index b1dc2705..c2ee692f 100644 --- a/packages/ui/src/features/pool/components/PoolStatusBadge/PoolStatusBadge.stories.tsx +++ b/packages/ui/src/components/Pool/PoolStatusBadge/PoolStatusBadge.stories.tsx @@ -1,7 +1,6 @@ +import { PoolStatus } from "@gitcoin/types"; import { Meta, StoryObj } from "@storybook/react"; -import { PoolStatus } from "@/types"; - import { PoolStatusBadge } from "./PoolStatusBadge"; const meta: Meta = { diff --git a/packages/ui/src/features/pool/components/PoolStatusBadge/PoolStatusBadge.tsx b/packages/ui/src/components/Pool/PoolStatusBadge/PoolStatusBadge.tsx similarity index 94% rename from packages/ui/src/features/pool/components/PoolStatusBadge/PoolStatusBadge.tsx rename to packages/ui/src/components/Pool/PoolStatusBadge/PoolStatusBadge.tsx index 90a8813f..8525f967 100644 --- a/packages/ui/src/features/pool/components/PoolStatusBadge/PoolStatusBadge.tsx +++ b/packages/ui/src/components/Pool/PoolStatusBadge/PoolStatusBadge.tsx @@ -2,12 +2,12 @@ import * as React from "react"; +import { isPoolStatus, PoolStatus } from "@gitcoin/types"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; import { match, P } from "ts-pattern"; -import { cn } from "@/lib/utils"; import { Badge } from "@/primitives/Badge"; -import { isPoolStatus, PoolStatus } from "@/types"; const variants = tv({ variants: { diff --git a/packages/ui/src/features/pool/components/PoolStatusBadge/index.ts b/packages/ui/src/components/Pool/PoolStatusBadge/index.ts similarity index 100% rename from packages/ui/src/features/pool/components/PoolStatusBadge/index.ts rename to packages/ui/src/components/Pool/PoolStatusBadge/index.ts diff --git a/packages/ui/src/features/pool/components/PoolSummary/PoolSummary.mdx b/packages/ui/src/components/Pool/PoolSummary/PoolSummary.mdx similarity index 100% rename from packages/ui/src/features/pool/components/PoolSummary/PoolSummary.mdx rename to packages/ui/src/components/Pool/PoolSummary/PoolSummary.mdx diff --git a/packages/ui/src/features/pool/components/PoolSummary/PoolSummary.stories.tsx b/packages/ui/src/components/Pool/PoolSummary/PoolSummary.stories.tsx similarity index 94% rename from packages/ui/src/features/pool/components/PoolSummary/PoolSummary.stories.tsx rename to packages/ui/src/components/Pool/PoolSummary/PoolSummary.stories.tsx index c0b8fc5f..83ae36e4 100644 --- a/packages/ui/src/features/pool/components/PoolSummary/PoolSummary.stories.tsx +++ b/packages/ui/src/components/Pool/PoolSummary/PoolSummary.stories.tsx @@ -1,7 +1,6 @@ +import { PoolType } from "@gitcoin/types"; import type { Meta, StoryObj } from "@storybook/react"; -import { PoolType } from "@/types"; - import { PoolSummary, PoolSummaryProps } from "./PoolSummary"; const defaultProps = { diff --git a/packages/ui/src/features/pool/components/PoolSummary/PoolSummary.tsx b/packages/ui/src/components/Pool/PoolSummary/PoolSummary.tsx similarity index 97% rename from packages/ui/src/features/pool/components/PoolSummary/PoolSummary.tsx rename to packages/ui/src/components/Pool/PoolSummary/PoolSummary.tsx index 7f047469..817fc4eb 100644 --- a/packages/ui/src/features/pool/components/PoolSummary/PoolSummary.tsx +++ b/packages/ui/src/components/Pool/PoolSummary/PoolSummary.tsx @@ -1,23 +1,22 @@ "use client"; +import { PoolStatus, PoolType } from "@gitcoin/types"; +import { cn } from "@gitcoin/utils"; +import { + getApplyLink, + getPoolLinkOnExplorer, + getProgramLinkOnManager, + getManagerUrl, + getVotingInterfaceLinkOnExplorer, +} from "@gitcoin/utils/checker"; import { tv } from "tailwind-variants"; import { IconLabel } from "@/components/IconLabel"; import { useToast } from "@/hooks"; import { getChainInfo } from "@/lib"; -import { cn } from "@/lib/utils"; import { Breadcrumb } from "@/primitives/Breadcrumb"; import { Button } from "@/primitives/Button"; import { Icon, IconType } from "@/primitives/Icon"; -import { PoolStatus, PoolType } from "@/types"; - -import { - getApplyLink, - getPoolLinkOnExplorer, - getProgramLinkOnManager, - getManagerUrl, - getVotingInterfaceLinkOnExplorer, -} from "~checker/utils"; import { PoolBadge } from "../PoolBadge"; diff --git a/packages/ui/src/features/pool/components/PoolSummary/index.ts b/packages/ui/src/components/Pool/PoolSummary/index.ts similarity index 100% rename from packages/ui/src/features/pool/components/PoolSummary/index.ts rename to packages/ui/src/components/Pool/PoolSummary/index.ts diff --git a/packages/ui/src/features/pool/components/PoolTypeBadge/PoolTypeBadge.stories.tsx b/packages/ui/src/components/Pool/PoolTypeBadge/PoolTypeBadge.stories.tsx similarity index 96% rename from packages/ui/src/features/pool/components/PoolTypeBadge/PoolTypeBadge.stories.tsx rename to packages/ui/src/components/Pool/PoolTypeBadge/PoolTypeBadge.stories.tsx index b1b333fb..44b01124 100644 --- a/packages/ui/src/features/pool/components/PoolTypeBadge/PoolTypeBadge.stories.tsx +++ b/packages/ui/src/components/Pool/PoolTypeBadge/PoolTypeBadge.stories.tsx @@ -1,7 +1,6 @@ +import { PoolType } from "@gitcoin/types"; import { Meta, StoryObj } from "@storybook/react"; -import { PoolType } from "@/types"; - import { PoolTypeBadge } from "./PoolTypeBadge"; const meta: Meta = { diff --git a/packages/ui/src/features/pool/components/PoolTypeBadge/PoolTypeBadge.tsx b/packages/ui/src/components/Pool/PoolTypeBadge/PoolTypeBadge.tsx similarity index 93% rename from packages/ui/src/features/pool/components/PoolTypeBadge/PoolTypeBadge.tsx rename to packages/ui/src/components/Pool/PoolTypeBadge/PoolTypeBadge.tsx index e13f4b0d..9542a9fd 100644 --- a/packages/ui/src/features/pool/components/PoolTypeBadge/PoolTypeBadge.tsx +++ b/packages/ui/src/components/Pool/PoolTypeBadge/PoolTypeBadge.tsx @@ -2,12 +2,12 @@ import * as React from "react"; +import { isPoolType, PoolType } from "@gitcoin/types"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; import { match, P } from "ts-pattern"; -import { cn } from "@/lib/utils"; import { Badge } from "@/primitives/Badge"; -import { isPoolType, PoolType } from "@/types"; const variants = tv({ base: "border-transparent", diff --git a/packages/ui/src/features/pool/components/PoolTypeBadge/index.ts b/packages/ui/src/components/Pool/PoolTypeBadge/index.ts similarity index 100% rename from packages/ui/src/features/pool/components/PoolTypeBadge/index.ts rename to packages/ui/src/components/Pool/PoolTypeBadge/index.ts diff --git a/packages/ui/src/features/pool/components/StakePoolCard/StakePoolCard.mdx b/packages/ui/src/components/Pool/StakePoolCard/StakePoolCard.mdx similarity index 100% rename from packages/ui/src/features/pool/components/StakePoolCard/StakePoolCard.mdx rename to packages/ui/src/components/Pool/StakePoolCard/StakePoolCard.mdx diff --git a/packages/ui/src/features/pool/components/StakePoolCard/StakePoolCard.stories.tsx b/packages/ui/src/components/Pool/StakePoolCard/StakePoolCard.stories.tsx similarity index 98% rename from packages/ui/src/features/pool/components/StakePoolCard/StakePoolCard.stories.tsx rename to packages/ui/src/components/Pool/StakePoolCard/StakePoolCard.stories.tsx index ba45796a..f03779c9 100644 --- a/packages/ui/src/features/pool/components/StakePoolCard/StakePoolCard.stories.tsx +++ b/packages/ui/src/components/Pool/StakePoolCard/StakePoolCard.stories.tsx @@ -1,8 +1,7 @@ +import { PoolStatus, PoolType } from "@gitcoin/types"; import { action } from "@storybook/addon-actions"; import { Meta, StoryObj } from "@storybook/react"; -import { PoolStatus, PoolType } from "@/types"; - import { StakePoolCard } from "./StakePoolCard"; import { StakePoolDataCardProps } from "./types"; diff --git a/packages/ui/src/features/pool/components/StakePoolCard/StakePoolCard.tsx b/packages/ui/src/components/Pool/StakePoolCard/StakePoolCard.tsx similarity index 100% rename from packages/ui/src/features/pool/components/StakePoolCard/StakePoolCard.tsx rename to packages/ui/src/components/Pool/StakePoolCard/StakePoolCard.tsx diff --git a/packages/ui/src/features/project/components/StakeProjectCard/components/IconWithDetails.tsx b/packages/ui/src/components/Pool/StakePoolCard/components/IconWithDetails.tsx similarity index 95% rename from packages/ui/src/features/project/components/StakeProjectCard/components/IconWithDetails.tsx rename to packages/ui/src/components/Pool/StakePoolCard/components/IconWithDetails.tsx index 81d03f21..5f7a0b4a 100644 --- a/packages/ui/src/features/project/components/StakeProjectCard/components/IconWithDetails.tsx +++ b/packages/ui/src/components/Pool/StakePoolCard/components/IconWithDetails.tsx @@ -1,5 +1,6 @@ +import { cn } from "@gitcoin/utils"; + import { Icon, IconType } from "@/index"; -import { cn } from "@/lib"; /** * Helper component to display icon with details @@ -23,8 +24,8 @@ export const IconWithDetails = ({
- {value} {label} + {value}
); diff --git a/packages/ui/src/features/pool/components/StakePoolCard/components/PoolMetricsSection.tsx b/packages/ui/src/components/Pool/StakePoolCard/components/PoolMetricsSection.tsx similarity index 100% rename from packages/ui/src/features/pool/components/StakePoolCard/components/PoolMetricsSection.tsx rename to packages/ui/src/components/Pool/StakePoolCard/components/PoolMetricsSection.tsx diff --git a/packages/ui/src/features/pool/components/StakePoolCard/components/StakePoolDataCard.tsx b/packages/ui/src/components/Pool/StakePoolCard/components/StakePoolDataCard.tsx similarity index 97% rename from packages/ui/src/features/pool/components/StakePoolCard/components/StakePoolDataCard.tsx rename to packages/ui/src/components/Pool/StakePoolCard/components/StakePoolDataCard.tsx index 0b2dd32c..f5d4d9b1 100644 --- a/packages/ui/src/features/pool/components/StakePoolCard/components/StakePoolDataCard.tsx +++ b/packages/ui/src/components/Pool/StakePoolCard/components/StakePoolDataCard.tsx @@ -1,7 +1,9 @@ import { useState } from "react"; -import { StakeProjectCard } from "@/features/project/components/StakeProjectCard/StakeProjectCard"; -import { cn, getChainInfo } from "@/lib"; +import { cn } from "@gitcoin/utils"; + +import { StakeProjectCard } from "@/components/Project"; +import { getChainInfo } from "@/lib"; import { Badge } from "@/primitives/Badge"; import { Button } from "@/primitives/Button"; import { IconType } from "@/primitives/Icon"; diff --git a/packages/ui/src/features/pool/components/StakePoolCard/components/StakedSection.tsx b/packages/ui/src/components/Pool/StakePoolCard/components/StakedSection.tsx similarity index 92% rename from packages/ui/src/features/pool/components/StakePoolCard/components/StakedSection.tsx rename to packages/ui/src/components/Pool/StakePoolCard/components/StakedSection.tsx index f1f30157..26b93322 100644 --- a/packages/ui/src/features/pool/components/StakePoolCard/components/StakedSection.tsx +++ b/packages/ui/src/components/Pool/StakePoolCard/components/StakedSection.tsx @@ -1,4 +1,5 @@ -import { formatDate, DateFormat } from "@/lib"; +import { formatDate, DateFormat } from "@gitcoin/utils"; + import { IconType } from "@/primitives/Icon"; import { IconWithDetails } from "./IconWithDetails"; diff --git a/packages/ui/src/features/pool/components/StakePoolCard/components/StakingPeriodSection.tsx b/packages/ui/src/components/Pool/StakePoolCard/components/StakingPeriodSection.tsx similarity index 100% rename from packages/ui/src/features/pool/components/StakePoolCard/components/StakingPeriodSection.tsx rename to packages/ui/src/components/Pool/StakePoolCard/components/StakingPeriodSection.tsx diff --git a/packages/ui/src/features/pool/components/StakePoolCard/components/index.ts b/packages/ui/src/components/Pool/StakePoolCard/components/index.ts similarity index 100% rename from packages/ui/src/features/pool/components/StakePoolCard/components/index.ts rename to packages/ui/src/components/Pool/StakePoolCard/components/index.ts diff --git a/packages/ui/src/features/pool/components/StakePoolCard/index.ts b/packages/ui/src/components/Pool/StakePoolCard/index.ts similarity index 100% rename from packages/ui/src/features/pool/components/StakePoolCard/index.ts rename to packages/ui/src/components/Pool/StakePoolCard/index.ts diff --git a/packages/ui/src/features/pool/components/StakePoolCard/types.ts b/packages/ui/src/components/Pool/StakePoolCard/types.ts similarity index 83% rename from packages/ui/src/features/pool/components/StakePoolCard/types.ts rename to packages/ui/src/components/Pool/StakePoolCard/types.ts index 8e7ff46e..74d7659a 100644 --- a/packages/ui/src/features/pool/components/StakePoolCard/types.ts +++ b/packages/ui/src/components/Pool/StakePoolCard/types.ts @@ -1,4 +1,4 @@ -import { StakeProjectCardProps } from "@/features/project/components/StakeProjectCard/StakeProjectCard"; +import { StakeProjectCardProps } from "~project"; export interface StakePoolDataCardProps { roundName: string; diff --git a/packages/ui/src/components/Pool/index.ts b/packages/ui/src/components/Pool/index.ts new file mode 100644 index 00000000..6ed1fb09 --- /dev/null +++ b/packages/ui/src/components/Pool/index.ts @@ -0,0 +1,9 @@ +export * from "./PoolBadge"; +export * from "./PoolCard"; +export * from "./PoolCardGroup"; +export * from "./PoolList"; +export * from "./PoolStatusBadge"; +export * from "./PoolSummary"; +export * from "./PoolTypeBadge"; +export * from "./StakePoolCard"; +export * from "./StakePoolCard/types"; diff --git a/packages/ui/src/features/program/components/ProgramCard/ProgramCard.mdx b/packages/ui/src/components/Program/ProgramCard/ProgramCard.mdx similarity index 100% rename from packages/ui/src/features/program/components/ProgramCard/ProgramCard.mdx rename to packages/ui/src/components/Program/ProgramCard/ProgramCard.mdx diff --git a/packages/ui/src/features/program/components/ProgramCard/ProgramCard.stories.tsx b/packages/ui/src/components/Program/ProgramCard/ProgramCard.stories.tsx similarity index 100% rename from packages/ui/src/features/program/components/ProgramCard/ProgramCard.stories.tsx rename to packages/ui/src/components/Program/ProgramCard/ProgramCard.stories.tsx diff --git a/packages/ui/src/features/program/components/ProgramCard/ProgramCard.tsx b/packages/ui/src/components/Program/ProgramCard/ProgramCard.tsx similarity index 96% rename from packages/ui/src/features/program/components/ProgramCard/ProgramCard.tsx rename to packages/ui/src/components/Program/ProgramCard/ProgramCard.tsx index af19f1d1..2834e2e0 100644 --- a/packages/ui/src/features/program/components/ProgramCard/ProgramCard.tsx +++ b/packages/ui/src/components/Program/ProgramCard/ProgramCard.tsx @@ -28,7 +28,7 @@ export function ProgramCard(props: ProgramCardProps | ProgramCardQueryProps) { .with({ queryResult: P.not(P.nullish) }, ({ queryResult }) => match(queryResult) .with({ status: "error", error: P.select() }, (error) => ) - .with({ status: "pending" }, () => ) + .with({ status: "pending" }, () => ) .with({ status: "success", data: P.select() }, (data) => ) .otherwise(() => ), ) @@ -64,7 +64,7 @@ export function ProgramDataCard({ data }: ProgramDataCardProps) { ); } -export function LoadingCard() { +export function LoadingProgramCard() { return ( diff --git a/packages/ui/src/features/program/components/ProgramCard/index.ts b/packages/ui/src/components/Program/ProgramCard/index.ts similarity index 100% rename from packages/ui/src/features/program/components/ProgramCard/index.ts rename to packages/ui/src/components/Program/ProgramCard/index.ts diff --git a/packages/ui/src/features/program/components/ProgramCardGroup/ProgramCardGroup.stories.tsx b/packages/ui/src/components/Program/ProgramCardGroup/ProgramCardGroup.stories.tsx similarity index 100% rename from packages/ui/src/features/program/components/ProgramCardGroup/ProgramCardGroup.stories.tsx rename to packages/ui/src/components/Program/ProgramCardGroup/ProgramCardGroup.stories.tsx diff --git a/packages/ui/src/features/program/components/ProgramCardGroup/ProgramCardGroup.tsx b/packages/ui/src/components/Program/ProgramCardGroup/ProgramCardGroup.tsx similarity index 87% rename from packages/ui/src/features/program/components/ProgramCardGroup/ProgramCardGroup.tsx rename to packages/ui/src/components/Program/ProgramCardGroup/ProgramCardGroup.tsx index 2f1fb1d1..81d18776 100644 --- a/packages/ui/src/features/program/components/ProgramCardGroup/ProgramCardGroup.tsx +++ b/packages/ui/src/components/Program/ProgramCardGroup/ProgramCardGroup.tsx @@ -2,16 +2,9 @@ import { tv } from "tailwind-variants"; -import { ProgramCard, ProgramCardProps } from "../ProgramCard"; +import { JustifyVariants } from "@/types"; -export type JustifyVariants = - | "normal" - | "start" - | "end" - | "center" - | "between" - | "around" - | "evenly"; +import { ProgramCard, ProgramCardProps } from "../ProgramCard"; export interface ProgramCardGroupProps { programs: ProgramCardProps[]; diff --git a/packages/ui/src/features/program/components/ProgramCardGroup/index.ts b/packages/ui/src/components/Program/ProgramCardGroup/index.ts similarity index 100% rename from packages/ui/src/features/program/components/ProgramCardGroup/index.ts rename to packages/ui/src/components/Program/ProgramCardGroup/index.ts diff --git a/packages/ui/src/features/program/components/ProgramList/ProgramList.stories.tsx b/packages/ui/src/components/Program/ProgramList/ProgramList.stories.tsx similarity index 100% rename from packages/ui/src/features/program/components/ProgramList/ProgramList.stories.tsx rename to packages/ui/src/components/Program/ProgramList/ProgramList.stories.tsx diff --git a/packages/ui/src/features/program/components/ProgramList/ProgramList.tsx b/packages/ui/src/components/Program/ProgramList/ProgramList.tsx similarity index 100% rename from packages/ui/src/features/program/components/ProgramList/ProgramList.tsx rename to packages/ui/src/components/Program/ProgramList/ProgramList.tsx diff --git a/packages/ui/src/features/program/components/ProgramList/hooks/useFilteredAndOrderedPrograms.ts b/packages/ui/src/components/Program/ProgramList/hooks/useFilteredAndOrderedPrograms.ts similarity index 96% rename from packages/ui/src/features/program/components/ProgramList/hooks/useFilteredAndOrderedPrograms.ts rename to packages/ui/src/components/Program/ProgramList/hooks/useFilteredAndOrderedPrograms.ts index e3295751..05f046d7 100644 --- a/packages/ui/src/features/program/components/ProgramList/hooks/useFilteredAndOrderedPrograms.ts +++ b/packages/ui/src/components/Program/ProgramList/hooks/useFilteredAndOrderedPrograms.ts @@ -1,6 +1,6 @@ import { useMemo } from "react"; -import { ProgramCardProps } from "@/features/program"; +import { ProgramCardProps } from "~program/ProgramCard"; interface UseFilteredAndOrderedProgramsProps { programs: ProgramCardProps[]; diff --git a/packages/ui/src/features/program/components/ProgramList/index.ts b/packages/ui/src/components/Program/ProgramList/index.ts similarity index 100% rename from packages/ui/src/features/program/components/ProgramList/index.ts rename to packages/ui/src/components/Program/ProgramList/index.ts diff --git a/packages/ui/src/features/program/components/ProgramList/utils.ts b/packages/ui/src/components/Program/ProgramList/utils.ts similarity index 95% rename from packages/ui/src/features/program/components/ProgramList/utils.ts rename to packages/ui/src/components/Program/ProgramList/utils.ts index 4a351609..49ca9d07 100644 --- a/packages/ui/src/features/program/components/ProgramList/utils.ts +++ b/packages/ui/src/components/Program/ProgramList/utils.ts @@ -1,7 +1,8 @@ import { MultipleSelectGroup } from "@/components/MultipleSelect"; -import { ProgramCardProps } from "@/features/program"; import { getChainInfo } from "@/lib"; +import { ProgramCardProps } from "~program/ProgramCard"; + export const getOrderAndFilterOptions = (programs: ProgramCardProps[]) => { const orderOptions = [ { diff --git a/packages/ui/src/components/Program/index.ts b/packages/ui/src/components/Program/index.ts new file mode 100644 index 00000000..4455fb5b --- /dev/null +++ b/packages/ui/src/components/Program/index.ts @@ -0,0 +1,3 @@ +export * from "./ProgramCard"; +export * from "./ProgramCardGroup"; +export * from "./ProgramList"; diff --git a/packages/ui/src/components/ProgressForm/ProgressForm.tsx b/packages/ui/src/components/ProgressForm/ProgressForm.tsx index 4d03f0b6..0001335c 100644 --- a/packages/ui/src/components/ProgressForm/ProgressForm.tsx +++ b/packages/ui/src/components/ProgressForm/ProgressForm.tsx @@ -3,11 +3,11 @@ import { useRef } from "react"; import { UseFormReturn } from "react-hook-form"; +import { cn } from "@gitcoin/utils"; import { CheckIcon } from "@heroicons/react/solid"; import { FormWithPersist_ } from "@/components/_Form"; import { useIndexedDB } from "@/hooks"; -import { cn } from "@/lib/utils"; import { Button } from "@/primitives/Button"; import { ProgressBar } from "@/primitives/ProgressBar"; import { FormWithPersistStep } from "@/types"; diff --git a/packages/ui/src/features/project/components/ProjectBanner/ProjectBanner.mdx b/packages/ui/src/components/Project/ProjectBanner/ProjectBanner.mdx similarity index 100% rename from packages/ui/src/features/project/components/ProjectBanner/ProjectBanner.mdx rename to packages/ui/src/components/Project/ProjectBanner/ProjectBanner.mdx diff --git a/packages/ui/src/features/project/components/ProjectBanner/ProjectBanner.stories.tsx b/packages/ui/src/components/Project/ProjectBanner/ProjectBanner.stories.tsx similarity index 100% rename from packages/ui/src/features/project/components/ProjectBanner/ProjectBanner.stories.tsx rename to packages/ui/src/components/Project/ProjectBanner/ProjectBanner.stories.tsx diff --git a/packages/ui/src/features/project/components/ProjectBanner/ProjectBanner.tsx b/packages/ui/src/components/Project/ProjectBanner/ProjectBanner.tsx similarity index 100% rename from packages/ui/src/features/project/components/ProjectBanner/ProjectBanner.tsx rename to packages/ui/src/components/Project/ProjectBanner/ProjectBanner.tsx diff --git a/packages/ui/src/features/project/components/ProjectBanner/index.ts b/packages/ui/src/components/Project/ProjectBanner/index.ts similarity index 100% rename from packages/ui/src/features/project/components/ProjectBanner/index.ts rename to packages/ui/src/components/Project/ProjectBanner/index.ts diff --git a/packages/ui/src/features/project/components/ProjectCard/ProjectCard.mdx b/packages/ui/src/components/Project/ProjectCard/ProjectCard.mdx similarity index 100% rename from packages/ui/src/features/project/components/ProjectCard/ProjectCard.mdx rename to packages/ui/src/components/Project/ProjectCard/ProjectCard.mdx diff --git a/packages/ui/src/features/project/components/ProjectCard/ProjectCard.stories.tsx b/packages/ui/src/components/Project/ProjectCard/ProjectCard.stories.tsx similarity index 100% rename from packages/ui/src/features/project/components/ProjectCard/ProjectCard.stories.tsx rename to packages/ui/src/components/Project/ProjectCard/ProjectCard.stories.tsx diff --git a/packages/ui/src/features/project/components/ProjectCard/ProjectCard.tsx b/packages/ui/src/components/Project/ProjectCard/ProjectCard.tsx similarity index 93% rename from packages/ui/src/features/project/components/ProjectCard/ProjectCard.tsx rename to packages/ui/src/components/Project/ProjectCard/ProjectCard.tsx index 80ec2eba..2a77a4fc 100644 --- a/packages/ui/src/features/project/components/ProjectCard/ProjectCard.tsx +++ b/packages/ui/src/components/Project/ProjectCard/ProjectCard.tsx @@ -8,7 +8,7 @@ import { BannerImage } from "@/primitives/BannerImage"; import { Skeleton } from "@/primitives/Skeleton"; import { Card, CardContent } from "@/ui-shadcn/card"; -import { ProjectData } from "../../types"; +import { ProjectData } from "../types"; export type ProjectCardProps = ProjectData; export interface ProjectCardQueryProps { @@ -20,7 +20,7 @@ export function ProjectCard(props: ProjectCardProps | ProjectCardQueryProps) { .with({ queryResult: P.not(P.nullish) }, ({ queryResult }) => match(queryResult) .with({ status: "error", error: P.select() }, (error) => ) - .with({ status: "pending" }, () => ) + .with({ status: "pending" }, () => ) .with({ status: "success", data: P.select() }, (data) => ) .otherwise(() => ), ) @@ -48,7 +48,7 @@ export function ProjectDataCard({ data }: ProjectDataCardProps) { ); } -export function LoadingCard() { +export function LoadingProjectCard() { return (
diff --git a/packages/ui/src/features/project/components/ProjectCard/index.ts b/packages/ui/src/components/Project/ProjectCard/index.ts similarity index 100% rename from packages/ui/src/features/project/components/ProjectCard/index.ts rename to packages/ui/src/components/Project/ProjectCard/index.ts diff --git a/packages/ui/src/features/project/components/ProjectSummary/ProjectSummary.mdx b/packages/ui/src/components/Project/ProjectSummary/ProjectSummary.mdx similarity index 100% rename from packages/ui/src/features/project/components/ProjectSummary/ProjectSummary.mdx rename to packages/ui/src/components/Project/ProjectSummary/ProjectSummary.mdx diff --git a/packages/ui/src/features/project/components/ProjectSummary/ProjectSummary.stories.tsx b/packages/ui/src/components/Project/ProjectSummary/ProjectSummary.stories.tsx similarity index 92% rename from packages/ui/src/features/project/components/ProjectSummary/ProjectSummary.stories.tsx rename to packages/ui/src/components/Project/ProjectSummary/ProjectSummary.stories.tsx index 90af973c..adeae4c6 100644 --- a/packages/ui/src/features/project/components/ProjectSummary/ProjectSummary.stories.tsx +++ b/packages/ui/src/components/Project/ProjectSummary/ProjectSummary.stories.tsx @@ -1,6 +1,6 @@ +import { ProjectApplicationForManager } from "@gitcoin/types"; import type { Meta, StoryObj } from "@storybook/react"; -import { ProjectApplicationForManager } from "@/features/checker/services/allo"; import { applicationsForManagers } from "@/mocks/mockData/applicationsForManager"; import { ProjectSummary } from "./ProjectSummary"; diff --git a/packages/ui/src/features/project/components/ProjectSummary/ProjectSummary.tsx b/packages/ui/src/components/Project/ProjectSummary/ProjectSummary.tsx similarity index 95% rename from packages/ui/src/features/project/components/ProjectSummary/ProjectSummary.tsx rename to packages/ui/src/components/Project/ProjectSummary/ProjectSummary.tsx index ce6d7337..0dd50ae4 100644 --- a/packages/ui/src/features/project/components/ProjectSummary/ProjectSummary.tsx +++ b/packages/ui/src/components/Project/ProjectSummary/ProjectSummary.tsx @@ -2,9 +2,9 @@ import * as React from "react"; +import { ProjectApplicationForManager, ProjectMetadata } from "@gitcoin/types"; + import { IconLabel } from "@/components/IconLabel"; -// import { useCredentialverification } from "@/features/checker/hooks"; -import { ProjectApplicationForManager, ProjectMetadata } from "@/features/checker/services/allo"; import { useCredentialVerification } from "@/hooks/useCredentialVerification"; import { IconType } from "@/primitives/Icon"; diff --git a/packages/ui/src/features/project/components/ProjectSummary/index.ts b/packages/ui/src/components/Project/ProjectSummary/index.ts similarity index 100% rename from packages/ui/src/features/project/components/ProjectSummary/index.ts rename to packages/ui/src/components/Project/ProjectSummary/index.ts diff --git a/packages/ui/src/features/project/components/StakeProjectCard/StakeProjectCard.stories.tsx b/packages/ui/src/components/Project/StakeProjectCard/StakeProjectCard.stories.tsx similarity index 100% rename from packages/ui/src/features/project/components/StakeProjectCard/StakeProjectCard.stories.tsx rename to packages/ui/src/components/Project/StakeProjectCard/StakeProjectCard.stories.tsx diff --git a/packages/ui/src/features/project/components/StakeProjectCard/StakeProjectCard.tsx b/packages/ui/src/components/Project/StakeProjectCard/StakeProjectCard.tsx similarity index 99% rename from packages/ui/src/features/project/components/StakeProjectCard/StakeProjectCard.tsx rename to packages/ui/src/components/Project/StakeProjectCard/StakeProjectCard.tsx index 482a4cd2..96cd5f68 100644 --- a/packages/ui/src/features/project/components/StakeProjectCard/StakeProjectCard.tsx +++ b/packages/ui/src/components/Project/StakeProjectCard/StakeProjectCard.tsx @@ -1,7 +1,8 @@ +import { cn } from "@gitcoin/utils"; +import { formatDate, DateFormat } from "@gitcoin/utils"; import moment from "moment"; import { match, P } from "ts-pattern"; -import { formatDate, DateFormat, cn } from "@/lib"; import { IconType } from "@/primitives/Icon"; import { diff --git a/packages/ui/src/features/pool/components/StakePoolCard/components/IconWithDetails.tsx b/packages/ui/src/components/Project/StakeProjectCard/components/IconWithDetails.tsx similarity index 95% rename from packages/ui/src/features/pool/components/StakePoolCard/components/IconWithDetails.tsx rename to packages/ui/src/components/Project/StakeProjectCard/components/IconWithDetails.tsx index 9a214679..6545d011 100644 --- a/packages/ui/src/features/pool/components/StakePoolCard/components/IconWithDetails.tsx +++ b/packages/ui/src/components/Project/StakeProjectCard/components/IconWithDetails.tsx @@ -1,5 +1,6 @@ +import { cn } from "@gitcoin/utils"; + import { Icon, IconType } from "@/index"; -import { cn } from "@/lib"; /** * Helper component to display icon with details @@ -23,8 +24,8 @@ export const IconWithDetails = ({
- {label} {value} + {label}
); diff --git a/packages/ui/src/features/project/components/StakeProjectCard/components/StakeInput.tsx b/packages/ui/src/components/Project/StakeProjectCard/components/StakeInput.tsx similarity index 100% rename from packages/ui/src/features/project/components/StakeProjectCard/components/StakeInput.tsx rename to packages/ui/src/components/Project/StakeProjectCard/components/StakeInput.tsx diff --git a/packages/ui/src/features/project/components/StakeProjectCard/components/ViewProjectButton.tsx b/packages/ui/src/components/Project/StakeProjectCard/components/ViewProjectButton.tsx similarity index 100% rename from packages/ui/src/features/project/components/StakeProjectCard/components/ViewProjectButton.tsx rename to packages/ui/src/components/Project/StakeProjectCard/components/ViewProjectButton.tsx diff --git a/packages/ui/src/features/project/components/StakeProjectCard/components/ViewTransactionButton.tsx b/packages/ui/src/components/Project/StakeProjectCard/components/ViewTransactionButton.tsx similarity index 100% rename from packages/ui/src/features/project/components/StakeProjectCard/components/ViewTransactionButton.tsx rename to packages/ui/src/components/Project/StakeProjectCard/components/ViewTransactionButton.tsx diff --git a/packages/ui/src/features/project/components/StakeProjectCard/components/index.ts b/packages/ui/src/components/Project/StakeProjectCard/components/index.ts similarity index 100% rename from packages/ui/src/features/project/components/StakeProjectCard/components/index.ts rename to packages/ui/src/components/Project/StakeProjectCard/components/index.ts diff --git a/packages/ui/src/features/project/components/StakeProjectCard/index.ts b/packages/ui/src/components/Project/StakeProjectCard/index.ts similarity index 100% rename from packages/ui/src/features/project/components/StakeProjectCard/index.ts rename to packages/ui/src/components/Project/StakeProjectCard/index.ts diff --git a/packages/ui/src/components/Project/index.ts b/packages/ui/src/components/Project/index.ts new file mode 100644 index 00000000..fb23fb7d --- /dev/null +++ b/packages/ui/src/components/Project/index.ts @@ -0,0 +1,5 @@ +export * from "./types"; +export * from "./ProjectBanner"; +export * from "./ProjectCard"; +export * from "./ProjectSummary"; +export * from "./StakeProjectCard"; diff --git a/packages/ui/src/features/project/types/types.ts b/packages/ui/src/components/Project/types.ts similarity index 100% rename from packages/ui/src/features/project/types/types.ts rename to packages/ui/src/components/Project/types.ts diff --git a/packages/ui/src/components/RadioGroupList/RadioGroupList.tsx b/packages/ui/src/components/RadioGroupList/RadioGroupList.tsx index 7fc380b0..e0c94a06 100644 --- a/packages/ui/src/components/RadioGroupList/RadioGroupList.tsx +++ b/packages/ui/src/components/RadioGroupList/RadioGroupList.tsx @@ -2,9 +2,9 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; -import { cn } from "@/lib/utils"; import { RadioGroup, RadioGroupItem } from "@/primitives/RadioGroup"; const radioGroupList = tv({ diff --git a/packages/ui/src/components/SideNav/SideNav.tsx b/packages/ui/src/components/SideNav/SideNav.tsx index 9b1d02e7..d54e473d 100644 --- a/packages/ui/src/components/SideNav/SideNav.tsx +++ b/packages/ui/src/components/SideNav/SideNav.tsx @@ -1,9 +1,9 @@ "use client"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; import { AccordionItem, NavItem, InternalSideNavProps } from "@/components/SideNav"; -import { cn } from "@/lib/utils"; /** * Tailwind variants for side navigation hover states diff --git a/packages/ui/src/components/SideNav/components/NavItem.tsx b/packages/ui/src/components/SideNav/components/NavItem.tsx index b4500980..9440a5b7 100644 --- a/packages/ui/src/components/SideNav/components/NavItem.tsx +++ b/packages/ui/src/components/SideNav/components/NavItem.tsx @@ -1,7 +1,8 @@ "use client"; +import { cn } from "@gitcoin/utils"; + import { SideNavItem } from "@/components/SideNav"; -import { cn } from "@/lib/utils"; import { Icon } from "@/primitives/Icon"; interface NavItemProps { diff --git a/packages/ui/src/components/SquarePlot/SquarePlot.tsx b/packages/ui/src/components/SquarePlot/SquarePlot.tsx index cca8b99c..b649c4e3 100644 --- a/packages/ui/src/components/SquarePlot/SquarePlot.tsx +++ b/packages/ui/src/components/SquarePlot/SquarePlot.tsx @@ -3,10 +3,9 @@ import { useMemo } from "react"; import Plotly from "react-plotly.js"; +import { formatAmount } from "@gitcoin/utils"; import { useMediaQuery } from "usehooks-ts"; -import { formatAmount } from "../../lib/utils"; - export function SquarePlot({ width, values, diff --git a/packages/ui/src/components/_Form/FormControllers/AllowlistFormController/AllowlistFormController.tsx b/packages/ui/src/components/_Form/FormControllers/AllowlistFormController/AllowlistFormController.tsx index 31c4967e..0078996f 100644 --- a/packages/ui/src/components/_Form/FormControllers/AllowlistFormController/AllowlistFormController.tsx +++ b/packages/ui/src/components/_Form/FormControllers/AllowlistFormController/AllowlistFormController.tsx @@ -3,11 +3,11 @@ import React, { useRef } from "react"; import { useFormContext, Controller } from "react-hook-form"; +import { cn } from "@gitcoin/utils"; import { UploadIcon } from "@heroicons/react/solid"; import Papa from "papaparse"; import { getAddress, isAddress } from "viem"; -import { cn } from "@/lib/utils"; import { Button } from "@/primitives/Button"; import { TextArea } from "@/primitives/TextArea"; diff --git a/packages/ui/src/components/_Form/FormControllers/WeightedAllowlistFormController/WeightedAllowlistFormController.tsx b/packages/ui/src/components/_Form/FormControllers/WeightedAllowlistFormController/WeightedAllowlistFormController.tsx index 632a5d73..99c8a1c8 100644 --- a/packages/ui/src/components/_Form/FormControllers/WeightedAllowlistFormController/WeightedAllowlistFormController.tsx +++ b/packages/ui/src/components/_Form/FormControllers/WeightedAllowlistFormController/WeightedAllowlistFormController.tsx @@ -3,9 +3,9 @@ import React, { useEffect, useState, useMemo } from "react"; import { useFormContext, useWatch, FieldErrors } from "react-hook-form"; +import { cn } from "@gitcoin/utils"; import { UploadIcon, PencilIcon } from "@heroicons/react/solid"; -import { cn } from "@/lib/utils"; import { Button } from "@/primitives/Button"; import { IconType } from "@/primitives/Icon"; import { Icon } from "@/primitives/Icon"; diff --git a/packages/ui/src/components/_Form/FormControllers/WeightedAllowlistFormController/components/CSVImportModal.tsx b/packages/ui/src/components/_Form/FormControllers/WeightedAllowlistFormController/components/CSVImportModal.tsx index 1bc7f6b0..079a9439 100644 --- a/packages/ui/src/components/_Form/FormControllers/WeightedAllowlistFormController/components/CSVImportModal.tsx +++ b/packages/ui/src/components/_Form/FormControllers/WeightedAllowlistFormController/components/CSVImportModal.tsx @@ -1,8 +1,8 @@ import { useRef, useState } from "react"; +import { cn } from "@gitcoin/utils"; import { UploadIcon } from "@heroicons/react/outline"; -import { cn } from "@/lib/utils"; import { Icon, IconType, Switch } from "@/primitives"; import { Button } from "@/primitives/Button"; import { DialogContent, DialogTitle, Dialog } from "@/primitives/Dialog"; diff --git a/packages/ui/src/features/application/index.ts b/packages/ui/src/features/application/index.ts deleted file mode 100644 index 2b22c2b4..00000000 --- a/packages/ui/src/features/application/index.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from "./components/ApplicationBadge"; -export * from "./components/ApplicationSummary"; diff --git a/packages/ui/src/features/checker/services/allo/types.ts b/packages/ui/src/features/checker/services/allo/types.ts deleted file mode 100644 index cd5977f9..00000000 --- a/packages/ui/src/features/checker/services/allo/types.ts +++ /dev/null @@ -1,113 +0,0 @@ -import { Address } from "viem"; - -import { ApplicationStatusType } from "~checker/types"; - -export interface VerifiableCredential { - "@context": string[]; - type: string[]; - credentialSubject: { - id: string; - "@context": Record[]; - hash?: string; - provider?: string; - address?: string; - challenge?: string; - }; - issuer: string; - issuanceDate: string; - expirationDate: string; - proof: { - type: string; - proofPurpose: string; - verificationMethod: string; - created: string; - jws: string; - }; -} - -export type ProjectCredentials = Record; - -export interface ProjectOwner { - address: string; -} - -export interface ProjectMetadata { - title: string; - description: string; - website: string; - bannerImg?: string; - logoImg?: string; - projectTwitter?: string; - userGithub?: string; - projectGithub?: string; - credentials: ProjectCredentials; - owners: ProjectOwner[]; - recipient?: string; - createdAt: number; - lastUpdated: number; -} - -export interface ApplicationAnswer { - type: string; - hidden: boolean; - question: string; - questionId: number; - encryptedAnswer?: { - ciphertext: string; - encryptedSymmetricKey: string; - }; - answer: string; -} - -export interface ProjectApplicationMetadata { - signature: string; - application: { - round: string; - answers: ApplicationAnswer[]; - project: ProjectMetadata; - recipient: string; - }; -} - -export interface BaseDonorValues { - totalAmountDonatedInUsd: number; - totalDonationsCount: number; - uniqueDonorsCount: number; -} - -export interface ProjectApplication extends BaseDonorValues { - id: string; - projectId: string; - chainId: number; - roundId: string; - status: ApplicationStatusType; - metadataCid: string; - metadata: ProjectApplicationMetadata; - distributionTransaction: string | null; -} - -interface StatusSnapshot { - status: ApplicationStatusType; - updatedAtBlock: string; - updatedAt: string; -} - -export interface ProjectApplicationForManager extends ProjectApplication { - anchorAddress: Address; - statusSnapshots: StatusSnapshot[]; - project: { - projectRoles: { address: Address }[]; - }; -} - -export interface PastApplication { - id: string; - roundId: string; - statusSnapshots: StatusSnapshot[]; - status: ApplicationStatusType; - round: { - roundMetadata: { - name: string; - }; - }; -} diff --git a/packages/ui/src/features/checker/types/application.ts b/packages/ui/src/features/checker/types/application.ts deleted file mode 100644 index 5ca7a0ae..00000000 --- a/packages/ui/src/features/checker/types/application.ts +++ /dev/null @@ -1,12 +0,0 @@ -export enum ApplicationStatus { - APPEAL = "APPEAL", - APPROVED = "APPROVED", - CANCELLED = "CANCELLED", - FRAUD = "FRAUD", - IN_REVIEW = "IN_REVIEW", - PENDING = "PENDING", - RECEIVED = "RECEIVED", - REJECTED = "REJECTED", -} - -export type ApplicationStatusType = keyof typeof ApplicationStatus; diff --git a/packages/ui/src/features/checker/types/index.ts b/packages/ui/src/features/checker/types/index.ts deleted file mode 100644 index db2a91ba..00000000 --- a/packages/ui/src/features/checker/types/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./application"; -export * from "./evaluation"; -export * from "./pool"; -export * from "./project"; -export * from "./review"; diff --git a/packages/ui/src/features/checker/types/pool.ts b/packages/ui/src/features/checker/types/pool.ts deleted file mode 100644 index 45873cdc..00000000 --- a/packages/ui/src/features/checker/types/pool.ts +++ /dev/null @@ -1,5 +0,0 @@ -export enum PoolCategory { - QuadraticFunding, - Direct, - Retrofunding, -} diff --git a/packages/ui/src/features/checker/types/project.ts b/packages/ui/src/features/checker/types/project.ts deleted file mode 100644 index ac72c204..00000000 --- a/packages/ui/src/features/checker/types/project.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Review } from "./review"; - -export type ProjectStatus = "pending" | "approved" | "rejected"; - -export interface ProjectReview { - id: string; - name: string; - date: Date; - avatarUrl: string; - reviews: Review[]; - aiSuggestion: number; - scoreAverage: number; -} diff --git a/packages/ui/src/features/pool/index.ts b/packages/ui/src/features/pool/index.ts deleted file mode 100644 index bc4eea6b..00000000 --- a/packages/ui/src/features/pool/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -export * from "./components/PoolBadge"; -export * from "./components/PoolCard"; -export * from "./components/PoolCardGroup"; -export * from "./components/PoolList"; -export * from "./components/PoolStatusBadge"; -export * from "./components/PoolSummary"; -export * from "./components/PoolTypeBadge"; -export * from "./components/StakePoolCard"; -export * from "./components/StakePoolCard/types"; \ No newline at end of file diff --git a/packages/ui/src/features/program/index.ts b/packages/ui/src/features/program/index.ts deleted file mode 100644 index f5c9a4d8..00000000 --- a/packages/ui/src/features/program/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./components/ProgramCard"; -export * from "./components/ProgramCardGroup"; -export * from "./components/ProgramList"; diff --git a/packages/ui/src/features/project/index.ts b/packages/ui/src/features/project/index.ts deleted file mode 100644 index 2dabf99f..00000000 --- a/packages/ui/src/features/project/index.ts +++ /dev/null @@ -1,5 +0,0 @@ -export * from "./types"; -export * from "./components/ProjectBanner"; -export * from "./components/ProjectCard"; -export * from "./components/ProjectSummary"; -export * from "./components/StakeProjectCard"; \ No newline at end of file diff --git a/packages/ui/src/features/project/types/index.ts b/packages/ui/src/features/project/types/index.ts deleted file mode 100644 index eea524d6..00000000 --- a/packages/ui/src/features/project/types/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./types"; diff --git a/packages/ui/src/features/retrofunding/components/BallotForm/BallotForm.tsx b/packages/ui/src/features/retrofunding/components/BallotForm/BallotForm.tsx index 3a47ddc4..429cb63e 100644 --- a/packages/ui/src/features/retrofunding/components/BallotForm/BallotForm.tsx +++ b/packages/ui/src/features/retrofunding/components/BallotForm/BallotForm.tsx @@ -2,11 +2,11 @@ import { useCallback, useEffect, useMemo, useState } from "react"; +import { cn } from "@gitcoin/utils"; import { debounce } from "lodash"; import { sortFieldsByOrder } from "@/features/retrofunding/utils/metricsBallot"; import { useIndexedDB } from "@/hooks/useIndexedDB"; -import { cn } from "@/lib"; import { Button } from "@/primitives"; import { AlreadyVotedBadge, BallotHeader, BallotItem } from "./components"; @@ -189,10 +189,7 @@ export const BallotForm: React.FC = ({ return (
- +
, - Omit {} + Omit< + LeaderboardProps, + "expandedProject" | "setExpandedProject" | "paginationProps" | "sortConfig" | "setSortConfig" + > {} export const Leaderboard = ({ projects, metrics, ...props }: LeaderboardPropsWithVariants) => { const leaderboardClassNames = leaderboardVariants({ diff --git a/packages/ui/src/features/retrofunding/components/Leaderboard/components/DesktopLeaderboard.tsx b/packages/ui/src/features/retrofunding/components/Leaderboard/components/DesktopLeaderboard.tsx index 92322a17..fadff5c4 100644 --- a/packages/ui/src/features/retrofunding/components/Leaderboard/components/DesktopLeaderboard.tsx +++ b/packages/ui/src/features/retrofunding/components/Leaderboard/components/DesktopLeaderboard.tsx @@ -2,10 +2,10 @@ import { useState, Fragment } from "react"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; import { IconWithTooltip } from "@/components/IconWithTooltip"; -import { cn } from "@/lib/utils"; import { Icon, IconType } from "@/primitives/Icon"; import { Pagination } from "@/primitives/Pagination"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/primitives/Table"; diff --git a/packages/ui/src/features/retrofunding/components/Leaderboard/components/MobileLeaderboard.tsx b/packages/ui/src/features/retrofunding/components/Leaderboard/components/MobileLeaderboard.tsx index 81a30f59..015d3253 100644 --- a/packages/ui/src/features/retrofunding/components/Leaderboard/components/MobileLeaderboard.tsx +++ b/packages/ui/src/features/retrofunding/components/Leaderboard/components/MobileLeaderboard.tsx @@ -1,7 +1,7 @@ +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; import { IconWithTooltip } from "@/components/IconWithTooltip"; -import { cn } from "@/lib/utils"; import { IconType, Icon } from "@/primitives/Icon"; import { Pagination } from "@/primitives/Pagination"; diff --git a/packages/ui/src/features/retrofunding/components/Leaderboard/components/ProjectInfo.tsx b/packages/ui/src/features/retrofunding/components/Leaderboard/components/ProjectInfo.tsx index e9406f7f..f6ad8b1b 100644 --- a/packages/ui/src/features/retrofunding/components/Leaderboard/components/ProjectInfo.tsx +++ b/packages/ui/src/features/retrofunding/components/Leaderboard/components/ProjectInfo.tsx @@ -1,10 +1,10 @@ import { useMemo } from "react"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; import { useMediaQuery } from "usehooks-ts"; import { IconLabel } from "@/components/IconLabel"; -import { cn } from "@/lib"; import { IconType } from "@/primitives/Icon"; import { Markdown } from "@/primitives/Markdown"; diff --git a/packages/ui/src/features/retrofunding/components/MetricCard/MetricCard.tsx b/packages/ui/src/features/retrofunding/components/MetricCard/MetricCard.tsx index 5eaec1f5..fa4771ba 100644 --- a/packages/ui/src/features/retrofunding/components/MetricCard/MetricCard.tsx +++ b/packages/ui/src/features/retrofunding/components/MetricCard/MetricCard.tsx @@ -2,10 +2,10 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; import { match } from "ts-pattern"; -import { cn } from "@/lib"; import { Button } from "@/primitives/Button"; import { Icon, IconType } from "@/primitives/Icon"; import { Skeleton } from "@/primitives/Skeleton"; diff --git a/packages/ui/src/features/retrofunding/components/MetricsBallot/components/BallotForm/MetricsBallotController.tsx b/packages/ui/src/features/retrofunding/components/MetricsBallot/components/BallotForm/MetricsBallotController.tsx index 2f757895..20cbfa2f 100644 --- a/packages/ui/src/features/retrofunding/components/MetricsBallot/components/BallotForm/MetricsBallotController.tsx +++ b/packages/ui/src/features/retrofunding/components/MetricsBallot/components/BallotForm/MetricsBallotController.tsx @@ -4,8 +4,9 @@ import { useEffect, useState } from "react"; import { useFieldArray, useFormContext } from "react-hook-form"; import { FieldArrayPath } from "react-hook-form"; +import { cn } from "@gitcoin/utils"; + import { useMetricsBallot } from "@/features/retrofunding/hooks/useMetricsBallot"; -import { cn } from "@/lib"; import { MetricsBallotFormValues, DB_NAME, STORE_NAME, BallotFieldValues } from "@/types"; import { BallotTab } from "../BallotTab"; diff --git a/packages/ui/src/features/retrofunding/components/MetricsBallot/components/BallotForm/TabButton.tsx b/packages/ui/src/features/retrofunding/components/MetricsBallot/components/BallotForm/TabButton.tsx index b778d24f..a494347f 100644 --- a/packages/ui/src/features/retrofunding/components/MetricsBallot/components/BallotForm/TabButton.tsx +++ b/packages/ui/src/features/retrofunding/components/MetricsBallot/components/BallotForm/TabButton.tsx @@ -1,4 +1,4 @@ -import { cn } from "@/lib/utils"; +import { cn } from "@gitcoin/utils"; interface TabButtonProps { active: boolean; diff --git a/packages/ui/src/features/retrofunding/components/MetricsBallot/components/BallotTab/BallotItem.tsx b/packages/ui/src/features/retrofunding/components/MetricsBallot/components/BallotTab/BallotItem.tsx index 5c5f096d..f47547c1 100644 --- a/packages/ui/src/features/retrofunding/components/MetricsBallot/components/BallotTab/BallotItem.tsx +++ b/packages/ui/src/features/retrofunding/components/MetricsBallot/components/BallotTab/BallotItem.tsx @@ -1,5 +1,6 @@ import { NumericFormat } from "react-number-format"; +import { cn } from "@gitcoin/utils"; import { LockClosedIcon, LockOpenIcon, @@ -16,7 +17,6 @@ import { handleSetAmount, toggleLock, } from "@/features/retrofunding/utils/metricsBallot"; -import { cn } from "@/lib/utils"; import { BallotFieldValues } from "@/types"; interface BallotItemProps { diff --git a/packages/ui/src/features/retrofunding/components/MetricsBallot/components/MetricsTab/MetricButton.tsx b/packages/ui/src/features/retrofunding/components/MetricsBallot/components/MetricsTab/MetricButton.tsx index 0bc90fa9..44ba2ab2 100644 --- a/packages/ui/src/features/retrofunding/components/MetricsBallot/components/MetricsTab/MetricButton.tsx +++ b/packages/ui/src/features/retrofunding/components/MetricsBallot/components/MetricsTab/MetricButton.tsx @@ -1,9 +1,9 @@ +import { cn } from "@gitcoin/utils"; import { PlusIcon } from "@heroicons/react/solid"; -import { cn } from "@/lib/utils"; import { Button, IconType } from "@/primitives"; import { Icon } from "@/primitives"; -import { TooltipContent, Tooltip, TooltipProvider, TooltipTrigger } from "@/ui-shadcn/tooltip"; +import { TooltipContent, Tooltip, TooltipProvider, TooltipTrigger } from "@/primitives/Tooltip"; interface MetricButtonProps { isAdded: boolean; diff --git a/packages/ui/src/features/retrofunding/components/ProgramPickerModal/ProgramPickerModal.stories.tsx b/packages/ui/src/features/retrofunding/components/ProgramPickerModal/ProgramPickerModal.stories.tsx index 8c95f0aa..3aabf2fe 100644 --- a/packages/ui/src/features/retrofunding/components/ProgramPickerModal/ProgramPickerModal.stories.tsx +++ b/packages/ui/src/features/retrofunding/components/ProgramPickerModal/ProgramPickerModal.stories.tsx @@ -4,7 +4,8 @@ import { action } from "@storybook/addon-actions"; import type { Meta, StoryObj } from "@storybook/react"; import { CreateButton } from "@/components/CreateButton"; -import { ProgramCardProps } from "@/features/program/components/ProgramCard"; + +import { ProgramCardProps } from "~program/ProgramCard"; import { ProgramPickerModal, ProgramPickerModalProps } from "./ProgramPickerModal"; diff --git a/packages/ui/src/features/retrofunding/components/ProgramPickerModal/ProgramPickerModal.tsx b/packages/ui/src/features/retrofunding/components/ProgramPickerModal/ProgramPickerModal.tsx index 69265870..04ceb0d4 100644 --- a/packages/ui/src/features/retrofunding/components/ProgramPickerModal/ProgramPickerModal.tsx +++ b/packages/ui/src/features/retrofunding/components/ProgramPickerModal/ProgramPickerModal.tsx @@ -1,6 +1,5 @@ "use client"; -import { ProgramCard, ProgramCardProps } from "@/features/program/components/ProgramCard"; import { Carousel, CarouselContent, @@ -12,6 +11,8 @@ import { Dialog, DialogTitle } from "@/primitives/Dialog"; import { Icon, IconType } from "@/primitives/Icon"; import { Modal } from "@/primitives/Modal"; +import { ProgramCard, ProgramCardProps } from "~program/ProgramCard"; + export interface ProgramPickerModalProps { programs: ProgramCardProps[]; isOpen: boolean; diff --git a/packages/ui/src/hooks/useCredentialVerification.ts b/packages/ui/src/hooks/useCredentialVerification.ts index c824f50c..9b9e4e04 100644 --- a/packages/ui/src/hooks/useCredentialVerification.ts +++ b/packages/ui/src/hooks/useCredentialVerification.ts @@ -2,7 +2,8 @@ import { useState, useEffect } from "react"; -import { ProjectApplicationForManager, verifyCredentials } from "@/features/checker"; +import { verifyCredentials } from "@gitcoin/services/checker"; +import { ProjectApplicationForManager } from "@gitcoin/types"; export function useCredentialVerification( application: Partial | undefined, diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index 8afbaae9..8c7c949a 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -8,7 +8,7 @@ export * from "./primitives/Breadcrumb"; export * from "./primitives/Button"; export * from "./primitives/FileUpload"; export * from "./primitives/Icon"; -export * from "./primitives/Indicators"; +export * from "./primitives/CircleStat"; export * from "./primitives/ListGrid"; export * from "./primitives/Modal"; export * from "./primitives/ProgressBar"; @@ -20,6 +20,7 @@ export * from "./primitives/StatCard"; export * from "./primitives/StatCardGroup"; export * from "./primitives/TextArea"; export * from "./primitives/Toast"; +export * from "./primitives/Tooltip"; export * from "./primitives/Typography"; export * from "./primitives/VerticalTabs"; export * from "./primitives/Switch"; @@ -31,10 +32,15 @@ export * from "./primitives/Input"; export * from "./primitives/Label"; export * from "./primitives/Pagination"; export * from "./components/AllocationSidebar"; +export * from "./components/Application"; export * from "./components/CreateButton"; +export * from "./components/EvaluationForm"; export * from "./components/IconLabel"; export * from "./components/IconWithTooltip"; export * from "./components/Navbar"; +export * from "./components/Pool"; +export * from "./components/Program"; +export * from "./components/Project"; export * from "./components/ProgressModal"; export * from "./components/RadioGroupList"; export * from "./components/SideNav"; diff --git a/packages/ui/src/lib/dates/index.ts b/packages/ui/src/lib/dates/index.ts deleted file mode 100644 index 960c3009..00000000 --- a/packages/ui/src/lib/dates/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./formatDate"; diff --git a/packages/ui/src/lib/index.ts b/packages/ui/src/lib/index.ts index 11007084..52c572df 100644 --- a/packages/ui/src/lib/index.ts +++ b/packages/ui/src/lib/index.ts @@ -1,4 +1,3 @@ -export * from "./dates"; export * from "./icons"; export * from "./tanstack"; export * from "./utils"; diff --git a/packages/ui/src/lib/utils.ts b/packages/ui/src/lib/utils.ts index 0db34cb4..a0cffb29 100644 --- a/packages/ui/src/lib/utils.ts +++ b/packages/ui/src/lib/utils.ts @@ -1,12 +1,3 @@ -import { clsx, type ClassValue } from "clsx"; -import { twMerge } from "tailwind-merge"; -import { match, P } from "ts-pattern"; -import { Hex } from "viem"; - -export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)); -} - export const modularRedirect = ( redirectLink?: string, redirect?: boolean, @@ -30,40 +21,3 @@ export const modularRedirect = ( window.location.href = link; } }; - -export function formatLocalDate(isoDate: string) { - const date = new Date(isoDate); - - return date.toLocaleString(undefined, { - month: "long", - day: "2-digit", - year: "numeric", - hour: "2-digit", - minute: "2-digit", - hour12: true, - }); -} - -export const getAddressLabel = (ens?: string, address?: string) => { - return match({ ens, address }) - .with({ ens: P.string }, ({ ens }) => ens) - .with({ address: P.string }, ({ address }) => address.slice(0, 4) + "..." + address.slice(-4)) - .otherwise(() => ""); -}; - -export function capitalizeWord(word: string): string { - if (!word) return word; - return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase(); -} - -export const addressFrom = (index: number): Hex => { - const address = index.toString(16).padStart(40, "0"); - return `0x${address}`; -}; - -export const formatAmount = (amount: string | number, noDigits?: boolean) => { - return Number(amount).toLocaleString("en-US", { - maximumFractionDigits: noDigits ? 0 : 2, - minimumFractionDigits: noDigits ? 0 : 2, - }); -}; diff --git a/packages/ui/src/mocks/handlers.ts b/packages/ui/src/mocks/handlers.ts index 7b2565e0..c7403e9e 100644 --- a/packages/ui/src/mocks/handlers.ts +++ b/packages/ui/src/mocks/handlers.ts @@ -2,12 +2,9 @@ import { http, HttpResponse } from "msw"; import { graphql } from "msw"; import { applicationsForManagers } from "./mockData/applicationsForManager"; -import { rounds } from "./mockData/rounds"; - -import { checkerApplicationEvaluations } from "./mockData/checkerApplicationEvaluations"; -import { checkerPoolData } from "./mockData/checkerPoolData"; import { getApplicationById } from "./mockData/indexerGetApplicationById"; import { pastApplicationsByApplicationId } from "./mockData/pastApplicationsByApplicationId"; +import { rounds } from "./mockData/rounds"; export const taskListHandler = http.get("https://jsonplaceholder.typicode.com/todos", () => { return HttpResponse.json([ @@ -31,25 +28,10 @@ export const getRoundHandler = graphql.query("getRound", () => { return HttpResponse.json(rounds); }); -export const checkerPoolDataHandler = graphql.query("getCheckerPoolData", () => { - return HttpResponse.json({ - data: { pools: [checkerPoolData] }, - }); -}); - export const indexerGetApplicationByIdHandler = graphql.query("getApplicationByIdQuery", () => { return HttpResponse.json({ data: { applications: [getApplicationById] } }); }); -export const checkerApplicationEvaluationsHandler = graphql.query( - "getCheckerApplicationEvaluations", - () => { - return HttpResponse.json({ - data: { applications: [{ evaluations: checkerApplicationEvaluations }] }, - }); - }, -); - export const getPastApplicationsByApplicationIdHandler = graphql.query( "getPastApplicationsByApplicationId", () => { @@ -60,8 +42,6 @@ export const getPastApplicationsByApplicationIdHandler = graphql.query( export const handlers = [ taskListHandler, applicationForManagerHandler, - checkerPoolDataHandler, indexerGetApplicationByIdHandler, - checkerApplicationEvaluationsHandler, getPastApplicationsByApplicationIdHandler, ]; diff --git a/packages/ui/src/primitives/Accordion/Accordion.tsx b/packages/ui/src/primitives/Accordion/Accordion.tsx index 617c0573..8177f80f 100644 --- a/packages/ui/src/primitives/Accordion/Accordion.tsx +++ b/packages/ui/src/primitives/Accordion/Accordion.tsx @@ -2,12 +2,11 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as AccordionPrimitive from "@radix-ui/react-accordion"; import { ChevronDown } from "lucide-react"; import { tv, type VariantProps } from "tailwind-variants"; -import { cn } from "@/lib/utils"; - const accordionVariants = tv({ slots: { item: "", diff --git a/packages/ui/src/primitives/Badge/Badge.tsx b/packages/ui/src/primitives/Badge/Badge.tsx index d690ef59..84b4daf8 100644 --- a/packages/ui/src/primitives/Badge/Badge.tsx +++ b/packages/ui/src/primitives/Badge/Badge.tsx @@ -2,10 +2,9 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { tv, type VariantProps } from "tailwind-variants"; -import { cn } from "@/lib/utils"; - import { Skeleton } from "../Skeleton"; export type BadgeVariants = diff --git a/packages/ui/src/primitives/Button/Button.tsx b/packages/ui/src/primitives/Button/Button.tsx index ac778e63..cb391ed2 100644 --- a/packages/ui/src/primitives/Button/Button.tsx +++ b/packages/ui/src/primitives/Button/Button.tsx @@ -2,11 +2,10 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { Slot } from "@radix-ui/react-slot"; import { tv } from "tailwind-variants"; -import { cn } from "@/lib/utils"; - export type ButtonVariants = | "primary" | "secondary" diff --git a/packages/ui/src/primitives/Button/index.tsx b/packages/ui/src/primitives/Button/index.ts similarity index 100% rename from packages/ui/src/primitives/Button/index.tsx rename to packages/ui/src/primitives/Button/index.ts diff --git a/packages/ui/src/primitives/Carousel/Carousel.tsx b/packages/ui/src/primitives/Carousel/Carousel.tsx index 4f292eb3..0ad1d570 100644 --- a/packages/ui/src/primitives/Carousel/Carousel.tsx +++ b/packages/ui/src/primitives/Carousel/Carousel.tsx @@ -1,11 +1,11 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { ArrowCircleLeftIcon, ArrowCircleRightIcon } from "@heroicons/react/outline"; import useEmblaCarousel, { type UseEmblaCarouselType } from "embla-carousel-react"; import { ArrowLeft, ArrowRight } from "lucide-react"; import { tv, VariantProps } from "tailwind-variants"; -import { cn } from "@/lib/utils"; import { Button } from "@/primitives/Button/Button"; export const carouselVariants = tv({ diff --git a/packages/ui/src/primitives/Checkbox/Checkbox.tsx b/packages/ui/src/primitives/Checkbox/Checkbox.tsx index 632ab7f3..1779c917 100644 --- a/packages/ui/src/primitives/Checkbox/Checkbox.tsx +++ b/packages/ui/src/primitives/Checkbox/Checkbox.tsx @@ -2,12 +2,11 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { CheckIcon } from "@heroicons/react/solid"; import * as CheckboxPrimitive from "@radix-ui/react-checkbox"; import { tv, VariantProps } from "tailwind-variants"; -import { cn } from "@/lib/utils"; - const checkboxVariants = tv({ slots: { base: "peer size-4 rounded-sm border border-moss-300 text-center ring-offset-white hover:border-moss-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-moss-500 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-moss-500 data-[state=checked]:text-grey-50", diff --git a/packages/ui/src/primitives/Indicators/CircleStat/CircleStat.mdx b/packages/ui/src/primitives/CircleStat/CircleStat.mdx similarity index 100% rename from packages/ui/src/primitives/Indicators/CircleStat/CircleStat.mdx rename to packages/ui/src/primitives/CircleStat/CircleStat.mdx diff --git a/packages/ui/src/primitives/Indicators/CircleStat/CircleStat.stories.tsx b/packages/ui/src/primitives/CircleStat/CircleStat.stories.tsx similarity index 100% rename from packages/ui/src/primitives/Indicators/CircleStat/CircleStat.stories.tsx rename to packages/ui/src/primitives/CircleStat/CircleStat.stories.tsx diff --git a/packages/ui/src/primitives/Indicators/CircleStat/CircleStat.tsx b/packages/ui/src/primitives/CircleStat/CircleStat.tsx similarity index 100% rename from packages/ui/src/primitives/Indicators/CircleStat/CircleStat.tsx rename to packages/ui/src/primitives/CircleStat/CircleStat.tsx diff --git a/packages/ui/src/primitives/CircleStat/index.ts b/packages/ui/src/primitives/CircleStat/index.ts new file mode 100644 index 00000000..2087bf03 --- /dev/null +++ b/packages/ui/src/primitives/CircleStat/index.ts @@ -0,0 +1 @@ +export * from "./CircleStat"; diff --git a/packages/ui/src/primitives/Dialog/Dialog.tsx b/packages/ui/src/primitives/Dialog/Dialog.tsx index a2da575d..4e085b73 100644 --- a/packages/ui/src/primitives/Dialog/Dialog.tsx +++ b/packages/ui/src/primitives/Dialog/Dialog.tsx @@ -1,11 +1,10 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as DialogPrimitive from "@radix-ui/react-dialog"; import { X } from "lucide-react"; import { tv, type VariantProps } from "tailwind-variants"; -import { cn } from "@/lib/utils"; - const Dialog = DialogPrimitive.Root; const DialogTrigger = DialogPrimitive.Trigger; diff --git a/packages/ui/src/primitives/FileUpload/FileUpload.tsx b/packages/ui/src/primitives/FileUpload/FileUpload.tsx index 379faa6a..9d3359a8 100644 --- a/packages/ui/src/primitives/FileUpload/FileUpload.tsx +++ b/packages/ui/src/primitives/FileUpload/FileUpload.tsx @@ -2,10 +2,9 @@ import React, { useEffect, useMemo, useRef, useState } from "react"; +import { cn } from "@gitcoin/utils"; import { CloudUpload, Image } from "lucide-react"; -import { cn } from "@/lib"; - export interface FileUploadProps { value?: Blob | null; onChange?: (file: File | null) => void; diff --git a/packages/ui/src/primitives/Icon/Icon.tsx b/packages/ui/src/primitives/Icon/Icon.tsx index dd538dbc..c34f6e6e 100644 --- a/packages/ui/src/primitives/Icon/Icon.tsx +++ b/packages/ui/src/primitives/Icon/Icon.tsx @@ -1,10 +1,11 @@ +import { cn } from "@gitcoin/utils"; + import { customIconComponents, heroiconsComponents, networkIconComponents, socialMediaIconComponents, } from "@/assets/icons"; -import { cn } from "@/lib/utils"; export enum IconType { // Heroicons diff --git a/packages/ui/src/primitives/Indicators/index.ts b/packages/ui/src/primitives/Indicators/index.ts deleted file mode 100644 index 027095aa..00000000 --- a/packages/ui/src/primitives/Indicators/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./CircleStat/CircleStat"; diff --git a/packages/ui/src/primitives/Input/Input.tsx b/packages/ui/src/primitives/Input/Input.tsx index 62be4ae2..74d7a8f9 100644 --- a/packages/ui/src/primitives/Input/Input.tsx +++ b/packages/ui/src/primitives/Input/Input.tsx @@ -1,6 +1,6 @@ import * as React from "react"; -import { cn } from "@/lib/utils"; +import { cn } from "@gitcoin/utils"; export interface InputProps extends React.InputHTMLAttributes {} diff --git a/packages/ui/src/primitives/Label/Label.tsx b/packages/ui/src/primitives/Label/Label.tsx index 96ebe49f..73f50cec 100644 --- a/packages/ui/src/primitives/Label/Label.tsx +++ b/packages/ui/src/primitives/Label/Label.tsx @@ -1,10 +1,9 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as LabelPrimitive from "@radix-ui/react-label"; import { tv } from "tailwind-variants"; -import { cn } from "@/lib/utils"; - const labelVariants = tv({ base: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", }); diff --git a/packages/ui/src/primitives/MarkdownEditor/MarkdownEditor.tsx b/packages/ui/src/primitives/MarkdownEditor/MarkdownEditor.tsx index 848d455c..0020e2cb 100644 --- a/packages/ui/src/primitives/MarkdownEditor/MarkdownEditor.tsx +++ b/packages/ui/src/primitives/MarkdownEditor/MarkdownEditor.tsx @@ -4,11 +4,11 @@ import { forwardRef, useContext } from "react"; import { Suspense, lazy } from "react"; import { useState, useEffect, ComponentType } from "react"; +import { cn } from "@gitcoin/utils"; import { EditorContext, commands, MDEditorProps } from "@uiw/react-md-editor"; import rehypeSanitize from "rehype-sanitize"; import { IconType } from "@/index"; -import { cn } from "@/lib"; import { Icon } from "@/primitives/Icon"; import "./markdown_editor.css"; diff --git a/packages/ui/src/primitives/Modal/index.tsx b/packages/ui/src/primitives/Modal/index.ts similarity index 100% rename from packages/ui/src/primitives/Modal/index.tsx rename to packages/ui/src/primitives/Modal/index.ts diff --git a/packages/ui/src/primitives/Pagination/Pagination.tsx b/packages/ui/src/primitives/Pagination/Pagination.tsx index 428e3848..ea01c062 100644 --- a/packages/ui/src/primitives/Pagination/Pagination.tsx +++ b/packages/ui/src/primitives/Pagination/Pagination.tsx @@ -1,8 +1,8 @@ +import { cn } from "@gitcoin/utils"; import { ChevronLeft, ChevronRight, LucideChevronsRight, LucideChevronsLeft } from "lucide-react"; import { tv } from "tailwind-variants"; import { useMediaQuery } from "usehooks-ts"; -import { cn } from "@/lib"; import { Select } from "@/primitives"; const paginationVariants = tv({ diff --git a/packages/ui/src/primitives/RadioGroup/RadioGroup.tsx b/packages/ui/src/primitives/RadioGroup/RadioGroup.tsx index 383144c4..6522ceb8 100644 --- a/packages/ui/src/primitives/RadioGroup/RadioGroup.tsx +++ b/packages/ui/src/primitives/RadioGroup/RadioGroup.tsx @@ -2,12 +2,11 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"; import { Circle } from "lucide-react"; import { tv } from "tailwind-variants"; -import { cn } from "@/lib/utils"; - const radioGroup = tv({ slots: { root: "grid gap-5 gap-y-1", diff --git a/packages/ui/src/primitives/RadioGroup/index.tsx b/packages/ui/src/primitives/RadioGroup/index.ts similarity index 100% rename from packages/ui/src/primitives/RadioGroup/index.tsx rename to packages/ui/src/primitives/RadioGroup/index.ts diff --git a/packages/ui/src/primitives/ScrollArea/ScrollArea.tsx b/packages/ui/src/primitives/ScrollArea/ScrollArea.tsx index be6346e1..a6dc13a2 100644 --- a/packages/ui/src/primitives/ScrollArea/ScrollArea.tsx +++ b/packages/ui/src/primitives/ScrollArea/ScrollArea.tsx @@ -2,10 +2,9 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area"; -import { cn } from "@/lib/utils"; - const ScrollArea = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef diff --git a/packages/ui/src/primitives/Select/Label.tsx b/packages/ui/src/primitives/Select/Label.tsx index b0158230..de3d8813 100644 --- a/packages/ui/src/primitives/Select/Label.tsx +++ b/packages/ui/src/primitives/Select/Label.tsx @@ -1,7 +1,7 @@ +import { cn } from "@gitcoin/utils"; import { match, P } from "ts-pattern"; import { stringToBlobUrl } from "@/lib/icons"; -import { cn } from "@/lib/utils"; export interface LabelProps { icon?: React.ReactNode; diff --git a/packages/ui/src/primitives/Select/Select.tsx b/packages/ui/src/primitives/Select/Select.tsx index 8176113b..374773aa 100644 --- a/packages/ui/src/primitives/Select/Select.tsx +++ b/packages/ui/src/primitives/Select/Select.tsx @@ -2,10 +2,10 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { SelectGroup } from "@radix-ui/react-select"; import { tv, type VariantProps } from "tailwind-variants"; -import { cn } from "@/lib/utils"; import { IconType } from "@/primitives/Icon"; import { Select as ShadcnSelect, diff --git a/packages/ui/src/primitives/Skeleton/Skeleton.tsx b/packages/ui/src/primitives/Skeleton/Skeleton.tsx index e60dc59f..b72fd277 100644 --- a/packages/ui/src/primitives/Skeleton/Skeleton.tsx +++ b/packages/ui/src/primitives/Skeleton/Skeleton.tsx @@ -1,6 +1,6 @@ "use client"; -import { cn } from "@/lib/utils"; +import { cn } from "@gitcoin/utils"; function Skeleton({ className, ...props }: React.HTMLAttributes) { return
; diff --git a/packages/ui/src/primitives/Spinner/Spinner.tsx b/packages/ui/src/primitives/Spinner/Spinner.tsx index d6ae2404..83939d43 100644 --- a/packages/ui/src/primitives/Spinner/Spinner.tsx +++ b/packages/ui/src/primitives/Spinner/Spinner.tsx @@ -1,7 +1,7 @@ +import { cn } from "@gitcoin/utils"; import { tv, VariantProps } from "tailwind-variants"; import { SpinnerIcon } from "@/assets"; -import { cn } from "@/lib"; const variants = tv({ base: "shrink-0 animate-spin fill-black dark:fill-white", diff --git a/packages/ui/src/primitives/StatCard/StatCard.tsx b/packages/ui/src/primitives/StatCard/StatCard.tsx index 3d3ec474..e75172fd 100644 --- a/packages/ui/src/primitives/StatCard/StatCard.tsx +++ b/packages/ui/src/primitives/StatCard/StatCard.tsx @@ -1,9 +1,9 @@ "use client"; +import { cn } from "@gitcoin/utils"; import { tv, VariantProps } from "tailwind-variants"; import { match } from "ts-pattern"; -import { cn } from "@/lib"; import { Skeleton } from "@/primitives/Skeleton"; import { Card } from "@/ui-shadcn/card"; diff --git a/packages/ui/src/primitives/StatCardGroup/StatCardGroup.tsx b/packages/ui/src/primitives/StatCardGroup/StatCardGroup.tsx index bedeaf55..353b9516 100644 --- a/packages/ui/src/primitives/StatCardGroup/StatCardGroup.tsx +++ b/packages/ui/src/primitives/StatCardGroup/StatCardGroup.tsx @@ -1,8 +1,8 @@ "use client"; +import { cn } from "@gitcoin/utils"; import { tv, VariantProps } from "tailwind-variants"; -import { cn } from "@/lib/utils"; import { StatCard, StatCardProps } from "@/primitives/StatCard"; const statCardGroupVariants = tv({ diff --git a/packages/ui/src/primitives/Switch/Switch.tsx b/packages/ui/src/primitives/Switch/Switch.tsx index 65898fd7..ba9e44de 100644 --- a/packages/ui/src/primitives/Switch/Switch.tsx +++ b/packages/ui/src/primitives/Switch/Switch.tsx @@ -2,11 +2,10 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as SwitchPrimitives from "@radix-ui/react-switch"; import { tv, VariantProps } from "tailwind-variants"; -import { cn } from "@/lib/utils"; - const switchVariants = tv({ slots: { base: "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-black focus-visible:ring-offset-2 focus-visible:ring-offset-white disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-moss-700 data-[state=unchecked]:bg-grey-100", diff --git a/packages/ui/src/primitives/Table/Table.tsx b/packages/ui/src/primitives/Table/Table.tsx index d3717b54..9476a62b 100644 --- a/packages/ui/src/primitives/Table/Table.tsx +++ b/packages/ui/src/primitives/Table/Table.tsx @@ -1,6 +1,6 @@ import * as React from "react"; -import { cn } from "@/lib/utils"; +import { cn } from "@gitcoin/utils"; const Table = React.forwardRef>( ({ className, ...props }, ref) => ( diff --git a/packages/ui/src/primitives/TextArea/TextArea.tsx b/packages/ui/src/primitives/TextArea/TextArea.tsx index 881bef22..80617be6 100644 --- a/packages/ui/src/primitives/TextArea/TextArea.tsx +++ b/packages/ui/src/primitives/TextArea/TextArea.tsx @@ -2,10 +2,9 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; -import { cn } from "@/lib/utils"; - const textareaVariants = tv({ base: "flex w-full rounded-md border border-grey-100 bg-white text-sm placeholder:text-grey-500 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-grey-300 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", variants: { diff --git a/packages/ui/src/primitives/TextArea/index.tsx b/packages/ui/src/primitives/TextArea/index.ts similarity index 100% rename from packages/ui/src/primitives/TextArea/index.tsx rename to packages/ui/src/primitives/TextArea/index.ts diff --git a/packages/ui/src/primitives/Toast/Toast.tsx b/packages/ui/src/primitives/Toast/Toast.tsx index a83aeddc..e878e97b 100644 --- a/packages/ui/src/primitives/Toast/Toast.tsx +++ b/packages/ui/src/primitives/Toast/Toast.tsx @@ -2,12 +2,12 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as ToastPrimitives from "@radix-ui/react-toast"; import { X } from "lucide-react"; import { tv, type VariantProps } from "tailwind-variants"; import { ToasterToast } from "@/hooks/useToast"; -import { cn } from "@/lib/utils"; import { Icon, IconType } from "@/primitives/Icon"; // Define variant styles for the Toast viewport diff --git a/packages/ui/src/ui-shadcn/tooltip.tsx b/packages/ui/src/primitives/Tooltip/Tooltip.tsx similarity index 97% rename from packages/ui/src/ui-shadcn/tooltip.tsx rename to packages/ui/src/primitives/Tooltip/Tooltip.tsx index bab96951..c541a948 100644 --- a/packages/ui/src/ui-shadcn/tooltip.tsx +++ b/packages/ui/src/primitives/Tooltip/Tooltip.tsx @@ -1,9 +1,8 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as TooltipPrimitive from "@radix-ui/react-tooltip"; -import { cn } from "@/lib/utils"; - const TooltipProvider = TooltipPrimitive.Provider; const Tooltip = TooltipPrimitive.Root; diff --git a/packages/ui/src/primitives/Tooltip/index.ts b/packages/ui/src/primitives/Tooltip/index.ts new file mode 100644 index 00000000..46bb2f24 --- /dev/null +++ b/packages/ui/src/primitives/Tooltip/index.ts @@ -0,0 +1 @@ +export * from "./Tooltip"; diff --git a/packages/ui/src/primitives/Typography/Typography.tsx b/packages/ui/src/primitives/Typography/Typography.tsx index 5a570199..b2d92077 100644 --- a/packages/ui/src/primitives/Typography/Typography.tsx +++ b/packages/ui/src/primitives/Typography/Typography.tsx @@ -1,9 +1,8 @@ "use client"; +import { cn } from "@gitcoin/utils"; import { tv, VariantProps } from "tailwind-variants"; -import { cn } from "@/lib"; - // TODO: Add variant (h1, h2, h3, p, body, caption, label, link, div), size, weight, etc const styles = tv({ diff --git a/packages/ui/src/primitives/VerticalTabs/VerticalTabs.tsx b/packages/ui/src/primitives/VerticalTabs/VerticalTabs.tsx index 0c5a07f5..663f4328 100644 --- a/packages/ui/src/primitives/VerticalTabs/VerticalTabs.tsx +++ b/packages/ui/src/primitives/VerticalTabs/VerticalTabs.tsx @@ -1,8 +1,8 @@ "use client"; +import { cn } from "@gitcoin/utils"; import { tv } from "tailwind-variants"; -import { cn } from "@/lib"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/ui-shadcn/tabs"; const variants = tv({ diff --git a/packages/ui/src/primitives/index.ts b/packages/ui/src/primitives/index.ts index 3a4ae181..85fc8662 100644 --- a/packages/ui/src/primitives/index.ts +++ b/packages/ui/src/primitives/index.ts @@ -6,7 +6,7 @@ export * from "./Breadcrumb"; export * from "./Button"; export * from "./FileUpload"; export * from "./Icon"; -export * from "./Indicators"; +export * from "./CircleStat"; export * from "./ListGrid"; export * from "./Markdown"; export * from "./MarkdownEditor"; diff --git a/packages/ui/src/types/distribute.ts b/packages/ui/src/types/distribute.ts index 9c07cbae..d0aa5c21 100644 --- a/packages/ui/src/types/distribute.ts +++ b/packages/ui/src/types/distribute.ts @@ -1,7 +1,6 @@ +import { PoolStatus } from "@gitcoin/types"; import Decimal from "decimal.js"; -import { PoolStatus } from "@/types"; - export interface ApplicationPayout { id: string; title: string; diff --git a/packages/ui/src/types/index.ts b/packages/ui/src/types/index.ts index 91092247..abd7170d 100644 --- a/packages/ui/src/types/index.ts +++ b/packages/ui/src/types/index.ts @@ -1,9 +1,9 @@ export * from "./allocationSidebar"; export * from "./form"; export * from "./indexedDB"; +export * from "./justifyVariants"; export * from "./markdown"; export * from "./metricsBallot"; export * from "./onClickProps"; -export * from "./pool"; export * from "./progressModal"; export * from "./distribute"; diff --git a/packages/ui/src/types/justifyVariants.ts b/packages/ui/src/types/justifyVariants.ts new file mode 100644 index 00000000..476bb206 --- /dev/null +++ b/packages/ui/src/types/justifyVariants.ts @@ -0,0 +1,8 @@ +export type JustifyVariants = + | "normal" + | "start" + | "end" + | "center" + | "between" + | "around" + | "evenly"; diff --git a/packages/ui/src/ui-shadcn/alert-dialog.tsx b/packages/ui/src/ui-shadcn/alert-dialog.tsx index fbca142f..58c152a4 100644 --- a/packages/ui/src/ui-shadcn/alert-dialog.tsx +++ b/packages/ui/src/ui-shadcn/alert-dialog.tsx @@ -1,8 +1,8 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"; -import { cn } from "@/lib/utils"; import { buttonVariants } from "@/primitives/Button/Button"; const AlertDialog = AlertDialogPrimitive.Root; @@ -35,7 +35,7 @@ const AlertDialogContent = React.forwardRef< svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-black dark:[&>svg]:text-grey-50 [&>svg~*]:pl-7", variants: { diff --git a/packages/ui/src/ui-shadcn/avatar.tsx b/packages/ui/src/ui-shadcn/avatar.tsx index c41d15a9..c2d40d9f 100644 --- a/packages/ui/src/ui-shadcn/avatar.tsx +++ b/packages/ui/src/ui-shadcn/avatar.tsx @@ -1,9 +1,8 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as AvatarPrimitive from "@radix-ui/react-avatar"; -import { cn } from "@/lib/utils"; - const Avatar = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef diff --git a/packages/ui/src/ui-shadcn/breadcrumb.tsx b/packages/ui/src/ui-shadcn/breadcrumb.tsx index 5ebfaa07..8b826e09 100644 --- a/packages/ui/src/ui-shadcn/breadcrumb.tsx +++ b/packages/ui/src/ui-shadcn/breadcrumb.tsx @@ -1,10 +1,9 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { Slot } from "@radix-ui/react-slot"; import { ChevronRight, MoreHorizontal } from "lucide-react"; -import { cn } from "@/lib/utils"; - const Breadcrumb = React.forwardRef< HTMLElement, React.ComponentPropsWithoutRef<"nav"> & { diff --git a/packages/ui/src/ui-shadcn/calendar.tsx b/packages/ui/src/ui-shadcn/calendar.tsx index 763258ef..4129637a 100644 --- a/packages/ui/src/ui-shadcn/calendar.tsx +++ b/packages/ui/src/ui-shadcn/calendar.tsx @@ -1,9 +1,9 @@ import * as React from "react"; import { DayPicker } from "react-day-picker"; +import { cn } from "@gitcoin/utils"; import { ChevronLeft, ChevronRight } from "lucide-react"; -import { cn } from "@/lib/utils"; import { buttonVariants } from "@/primitives/Button/Button"; export type CalendarProps = React.ComponentProps; diff --git a/packages/ui/src/ui-shadcn/card.tsx b/packages/ui/src/ui-shadcn/card.tsx index 9a4de580..bce4ef3f 100644 --- a/packages/ui/src/ui-shadcn/card.tsx +++ b/packages/ui/src/ui-shadcn/card.tsx @@ -1,6 +1,6 @@ import * as React from "react"; -import { cn } from "@/lib/utils"; +import { cn } from "@gitcoin/utils"; const Card = React.forwardRef>( ({ className, ...props }, ref) => ( diff --git a/packages/ui/src/ui-shadcn/chart.tsx b/packages/ui/src/ui-shadcn/chart.tsx index 14211525..88579192 100644 --- a/packages/ui/src/ui-shadcn/chart.tsx +++ b/packages/ui/src/ui-shadcn/chart.tsx @@ -1,9 +1,8 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as RechartsPrimitive from "recharts"; -import { cn } from "@/lib/utils"; - // Format: { THEME_NAME: CSS_SELECTOR } const THEMES = { light: "", dark: ".dark" } as const; diff --git a/packages/ui/src/ui-shadcn/command.tsx b/packages/ui/src/ui-shadcn/command.tsx index 5adbd539..de6d4b2c 100644 --- a/packages/ui/src/ui-shadcn/command.tsx +++ b/packages/ui/src/ui-shadcn/command.tsx @@ -1,10 +1,10 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { type DialogProps } from "@radix-ui/react-dialog"; import { Command as CommandPrimitive } from "cmdk"; import { Search } from "lucide-react"; -import { cn } from "@/lib/utils"; import { Dialog, DialogContent } from "@/primitives/Dialog"; const Command = React.forwardRef< diff --git a/packages/ui/src/ui-shadcn/context-menu.tsx b/packages/ui/src/ui-shadcn/context-menu.tsx index 9f89b1bb..de919804 100644 --- a/packages/ui/src/ui-shadcn/context-menu.tsx +++ b/packages/ui/src/ui-shadcn/context-menu.tsx @@ -1,10 +1,9 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"; import { Check, ChevronRight, Circle } from "lucide-react"; -import { cn } from "@/lib/utils"; - const ContextMenu = ContextMenuPrimitive.Root; const ContextMenuTrigger = ContextMenuPrimitive.Trigger; diff --git a/packages/ui/src/ui-shadcn/drawer.tsx b/packages/ui/src/ui-shadcn/drawer.tsx index fbf86ba6..016f46f3 100644 --- a/packages/ui/src/ui-shadcn/drawer.tsx +++ b/packages/ui/src/ui-shadcn/drawer.tsx @@ -1,9 +1,8 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { Drawer as DrawerPrimitive } from "vaul"; -import { cn } from "@/lib/utils"; - const Drawer = ({ shouldScaleBackground = true, ...props diff --git a/packages/ui/src/ui-shadcn/dropdown-menu.tsx b/packages/ui/src/ui-shadcn/dropdown-menu.tsx index 153d931e..d576ec53 100644 --- a/packages/ui/src/ui-shadcn/dropdown-menu.tsx +++ b/packages/ui/src/ui-shadcn/dropdown-menu.tsx @@ -1,10 +1,9 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"; import { Check, ChevronRight, Circle } from "lucide-react"; -import { cn } from "@/lib/utils"; - const DropdownMenu = DropdownMenuPrimitive.Root; const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger; diff --git a/packages/ui/src/ui-shadcn/form.tsx b/packages/ui/src/ui-shadcn/form.tsx index 0fd15f0d..5f3881ea 100644 --- a/packages/ui/src/ui-shadcn/form.tsx +++ b/packages/ui/src/ui-shadcn/form.tsx @@ -8,10 +8,10 @@ import { useFormContext, } from "react-hook-form"; +import { cn } from "@gitcoin/utils"; import * as LabelPrimitive from "@radix-ui/react-label"; import { Slot } from "@radix-ui/react-slot"; -import { cn } from "@/lib/utils"; import { Label } from "@/primitives/Label"; const Form = FormProvider; diff --git a/packages/ui/src/ui-shadcn/hover-card.tsx b/packages/ui/src/ui-shadcn/hover-card.tsx index 607e3512..a5e453d9 100644 --- a/packages/ui/src/ui-shadcn/hover-card.tsx +++ b/packages/ui/src/ui-shadcn/hover-card.tsx @@ -1,9 +1,8 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as HoverCardPrimitive from "@radix-ui/react-hover-card"; -import { cn } from "@/lib/utils"; - const HoverCard = HoverCardPrimitive.Root; const HoverCardTrigger = HoverCardPrimitive.Trigger; diff --git a/packages/ui/src/ui-shadcn/input-otp.tsx b/packages/ui/src/ui-shadcn/input-otp.tsx index 7a9804e8..6b7ac640 100644 --- a/packages/ui/src/ui-shadcn/input-otp.tsx +++ b/packages/ui/src/ui-shadcn/input-otp.tsx @@ -1,10 +1,9 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { OTPInput, OTPInputContext } from "input-otp"; import { Dot } from "lucide-react"; -import { cn } from "@/lib/utils"; - const InputOTP = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef diff --git a/packages/ui/src/ui-shadcn/navigation-menu.tsx b/packages/ui/src/ui-shadcn/navigation-menu.tsx index ce8a9526..e0d3d0af 100644 --- a/packages/ui/src/ui-shadcn/navigation-menu.tsx +++ b/packages/ui/src/ui-shadcn/navigation-menu.tsx @@ -1,11 +1,10 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"; import { ChevronDown } from "lucide-react"; import { tv } from "tailwind-variants"; -import { cn } from "@/lib/utils"; - const NavigationMenu = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef diff --git a/packages/ui/src/ui-shadcn/pagination.tsx b/packages/ui/src/ui-shadcn/pagination.tsx index 8f1ea872..a12846cb 100644 --- a/packages/ui/src/ui-shadcn/pagination.tsx +++ b/packages/ui/src/ui-shadcn/pagination.tsx @@ -1,9 +1,10 @@ import * as React from "react"; +import { cn } from "@gitcoin/utils"; import { ChevronLeft, ChevronRight, MoreHorizontal } from "lucide-react"; -import { cn } from "@/lib/utils"; import { ButtonProps, ButtonSizes, buttonVariants } from "@/primitives/Button/Button"; + const Pagination = ({ className, ...props }: React.ComponentProps<"nav">) => (