Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify givbacks page to be compatible with givback v2 #4727

Conversation

mohammadranjbarz
Copy link
Contributor

@mohammadranjbarz mohammadranjbarz commented Sep 12, 2024

related to #4679

Summary by CodeRabbit

  • New Features

    • Enhanced clarity in user interface text regarding GIVbacks eligibility across multiple languages (Catalan, English, Spanish).
    • Added a GraphQL query for fetching allocated GIVbacks data, improving insights into donations.
  • Bug Fixes

    • Updated terminology to ensure users understand that donations must be made to GIVbacks eligible projects.
  • Documentation

    • Refined metadata descriptions to clarify project eligibility and rewards associated with GIVbacks.
  • Chores

    • Removed unused components and streamlined UI elements for better user experience.

Copy link

vercel bot commented Sep 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
giveth-dapps-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 13, 2024 10:10pm

@mohammadranjbarz mohammadranjbarz marked this pull request as ready for review September 16, 2024 18:16
@mohammadranjbarz mohammadranjbarz changed the base branch from main to develop September 16, 2024 18:17
@mohammadranjbarz mohammadranjbarz requested review from MohammadPCh, mateodaza and RamRamez and removed request for MohammadPCh September 16, 2024 18:17
Copy link
Contributor

coderabbitai bot commented Sep 16, 2024

Walkthrough

The pull request introduces textual modifications across various localization files and components within the Giveth platform. The primary focus is on clarifying the eligibility criteria for receiving GIV tokens through donations, specifically emphasizing the distinction between "verified projects" and "GIVbacks eligible projects." Additionally, a new GraphQL query for fetching allocated GIVbacks data is added, and unused components are removed to streamline the user interface.

Changes

File Path Change Summary
lang/ca.json, lang/en.json, lang/es.json Updated descriptions to specify "GIVbacks eligible projects" instead of "verified projects" for clarity.
src/apollo/gql/gqlGivbacks.ts Added a new GraphQL query FETCH_ALLOCATED_GIVBACKS to retrieve data related to allocated GIVbacks.
src/components/GIVeconomyPages/GIVbacks.tsx Removed unused components and implemented a new data-fetching mechanism for allocated GIVbacks.
src/components/modals/StakeLock/LockInfo.tsx, src/components/views/claim/cards/Connect.tsx, src/components/views/claim/cards/Donate.tsx, src/components/views/landings/GIVBacks/HowGIVbacksWork.tsx, src/components/views/landings/GIVBacks/WhatAreGIVbacks.tsx, src/components/views/landings/GIVBacks/WhatCanYouDo.tsx, src/components/views/landings/GIVBacks/WhatMakesGIVbacks.tsx, src/components/views/landings/GIVBacks/YouKnowHow.tsx, src/components/views/landings/onboarding/GIVeconomy/GIVeconomySteps.tsx, src/components/views/landings/onboarding/donor/donorSteps.tsx, src/components/views/landings/onboarding/main/WhatIsGIV.tsx, src/components/views/landings/onboarding/main/WhatIsGiveth.tsx, src/components/views/landings/onboarding/project-owner/projectOwnerSteps.tsx, src/components/views/landings/publicGoods/PublicGoodsFunding.tsx, src/components/views/landings/web3CryptoDonation/numberedItems.tsx Replaced "verified projects" with "GIVbacks eligible projects" in various components for consistency.
src/content/metatags.ts Updated metadata descriptions to clarify the focus on "GIVbacks eligible projects" for various contexts.
src/context/verification.context.tsx Modified error handling to focus on "givbacks eligibility forms" instead of general project verification.
src/lib/constants/shareContent.ts Changed messaging to specify "GIVbacks eligible project" in the share content for clarity.

Possibly related PRs

Poem

🐰 In the garden where GIV tokens bloom,
Projects now shine with eligibility's loom.
"GIVbacks" they say, with a hop and a cheer,
Donors rejoice, for the clarity's here!
With each little change, our message is bright,
Join us in giving, let’s spread the delight! 🌼


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9020bb9 and 9343a9d.

Files selected for processing (24)
  • lang/ca.json (1 hunks)
  • lang/en.json (29 hunks)
  • lang/es.json (1 hunks)
  • src/apollo/gql/gqlGivbacks.ts (1 hunks)
  • src/components/GIVeconomyPages/GIVbacks.tsx (3 hunks)
  • src/components/modals/StakeLock/LockInfo.tsx (1 hunks)
  • src/components/views/claim/cards/Connect.tsx (1 hunks)
  • src/components/views/claim/cards/Donate.tsx (1 hunks)
  • src/components/views/landings/GIVBacks/HowGIVbacksWork.tsx (1 hunks)
  • src/components/views/landings/GIVBacks/WhatAreGIVbacks.tsx (1 hunks)
  • src/components/views/landings/GIVBacks/WhatCanYouDo.tsx (1 hunks)
  • src/components/views/landings/GIVBacks/WhatMakesGIVbacks.tsx (1 hunks)
  • src/components/views/landings/GIVBacks/YouKnowHow.tsx (1 hunks)
  • src/components/views/landings/onboarding/GIVeconomy/GIVeconomySteps.tsx (2 hunks)
  • src/components/views/landings/onboarding/GIVeconomy/index.tsx (1 hunks)
  • src/components/views/landings/onboarding/donor/donorSteps.tsx (1 hunks)
  • src/components/views/landings/onboarding/main/WhatIsGIV.tsx (1 hunks)
  • src/components/views/landings/onboarding/main/WhatIsGiveth.tsx (1 hunks)
  • src/components/views/landings/onboarding/project-owner/projectOwnerSteps.tsx (1 hunks)
  • src/components/views/landings/publicGoods/PublicGoodsFunding.tsx (1 hunks)
  • src/components/views/landings/web3CryptoDonation/numberedItems.tsx (1 hunks)
  • src/content/metatags.ts (1 hunks)
  • src/context/verification.context.tsx (1 hunks)
  • src/lib/constants/shareContent.ts (1 hunks)
Files skipped from review due to trivial changes (14)
  • lang/ca.json
  • lang/es.json
  • src/components/modals/StakeLock/LockInfo.tsx
  • src/components/views/claim/cards/Connect.tsx
  • src/components/views/landings/GIVBacks/HowGIVbacksWork.tsx
  • src/components/views/landings/GIVBacks/WhatAreGIVbacks.tsx
  • src/components/views/landings/GIVBacks/WhatCanYouDo.tsx
  • src/components/views/landings/onboarding/GIVeconomy/GIVeconomySteps.tsx
  • src/components/views/landings/onboarding/GIVeconomy/index.tsx
  • src/components/views/landings/onboarding/donor/donorSteps.tsx
  • src/components/views/landings/onboarding/main/WhatIsGIV.tsx
  • src/components/views/landings/onboarding/main/WhatIsGiveth.tsx
  • src/components/views/landings/publicGoods/PublicGoodsFunding.tsx
  • src/components/views/landings/web3CryptoDonation/numberedItems.tsx
Additional context used
GitHub Check: build
src/components/views/landings/GIVBacks/WhatMakesGIVbacks.tsx

[failure] 16-16:
Delete ·just


[failure] 17-17:
Replace create·societal·value,·but·also·earns·you·GIV·tokens.⏎↹↹↹↹↹↹When·you·donate·to·GIVbacks·eligible·projects·you·qualify·to⏎↹↹↹↹↹↹receive·GIV·tokens.·Through·GIVbacks,·GIV·empowers⏎↹↹↹↹↹↹ with just·create·societal·value,·but·also·earns·you·GIV⏎↹↹↹↹↹↹tokens.·When·you·donate·to·GIVbacks·eligible·projects⏎↹↹↹↹↹↹you·qualify·to·receive·GIV·tokens.·Through·GIVbacks,·GIV⏎↹↹↹↹↹↹empowers·

src/components/views/landings/GIVBacks/YouKnowHow.tsx

[failure] 29-29:
Delete ·on

src/components/views/claim/cards/Donate.tsx

[failure] 146-146:
Replace ·<b>GIVbacks</b>.⏎↹↹↹↹↹The·project·gets·100%·of·your·donation,·and·you·get·rewarded⏎↹↹↹↹↹ with {'·'}⏎↹↹↹↹↹<b>GIVbacks</b>.·The·project·gets·100%·of·your·donation,·and⏎↹↹↹↹↹you·get·rewarded·

Biome
src/components/GIVeconomyPages/GIVbacks.tsx

[error] 274-275: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

Additional comments not posted (23)
src/apollo/gql/gqlGivbacks.ts (1)

3-12: LGTM!

The FETCH_ALLOCATED_GIVBACKS query is well-structured and fetches relevant data fields for managing and displaying givback allocations. The optional refreshCache parameter provides flexibility to control the caching behavior.

src/lib/constants/shareContent.ts (1)

31-31: LGTM!

The updated message provides better clarity about the project application type, emphasizing the focus on GIVbacks eligibility. This change aligns well with the PR objective of making the givbacks page compatible with givback v2.

src/components/views/landings/GIVBacks/WhatMakesGIVbacks.tsx (2)

16-16: LGTM!

The change from "verified projects" to "GIVbacks eligible projects" improves clarity by specifying that only certain projects qualify for GIVbacks. This helps users better understand the criteria for earning GIV tokens through donations.

Tools
GitHub Check: build

[failure] 16-16:
Delete ·just


17-18: Ignore the static analysis hint and keep the split sentences.

Splitting the long sentence into two separate sentences enhances readability and comprehension. The static analysis tool incorrectly flags this as a failure, but the change is an improvement. Keep the sentences split as is.

Tools
GitHub Check: build

[failure] 17-17:
Replace create·societal·value,·but·also·earns·you·GIV·tokens.⏎↹↹↹↹↹↹When·you·donate·to·GIVbacks·eligible·projects·you·qualify·to⏎↹↹↹↹↹↹receive·GIV·tokens.·Through·GIVbacks,·GIV·empowers⏎↹↹↹↹↹↹ with just·create·societal·value,·but·also·earns·you·GIV⏎↹↹↹↹↹↹tokens.·When·you·donate·to·GIVbacks·eligible·projects⏎↹↹↹↹↹↹you·qualify·to·receive·GIV·tokens.·Through·GIVbacks,·GIV⏎↹↹↹↹↹↹empowers·

src/components/views/landings/GIVBacks/YouKnowHow.tsx (1)

29-29: LGTM!

The textual modification clarifies the eligibility criteria for receiving GIV tokens through donations, emphasizing the distinction between "verified projects" and "GIVbacks eligible projects". This change enhances user understanding of the program's scope and the conditions under which rewards are granted.

The static analysis hint to delete ·on is a false positive and can be safely ignored, as the on is part of the sentence and should not be deleted.

Tools
GitHub Check: build

[failure] 29-29:
Delete ·on

src/components/views/landings/onboarding/project-owner/projectOwnerSteps.tsx (2)

19-19: LGTM!

The change in the title of the second step from "Get Your Project Verified" to "Make your project GIVbacks Eligible" accurately reflects the shift in focus towards GIVbacks eligibility, which aligns with the overall objective of this PR.


21-21: LGTM!

The updated description effectively communicates the benefits of becoming GIVbacks eligible, such as increased legitimacy and rewards for donors, while also emphasizing the simplicity and human-centered nature of the application process. This change provides clear and compelling information to project owners, encouraging them to pursue GIVbacks eligibility.

src/context/verification.context.tsx (1)

87-87: LGTM! The change aligns with the shift in context.

The updated error message and the corresponding action of setting the step to 0 indicate a shift in the context from handling project verification forms to handling givbacks eligibility forms. This change appears to be intentional and aligns with the overall context of the file.

The modification is localized to the error handling logic and does not introduce any apparent bugs or issues.

src/components/views/claim/cards/Donate.tsx (1)

146-146: LGTM! The text change clarifies the eligibility criteria for GIVbacks.

The modification in the description text helps users understand that donations must be made to GIVbacks eligible projects specifically, and not just any verified project, in order to earn GIV rewards through the GIVbacks program.

This change enhances the precision of the information provided to users regarding the donation process and the associated rewards, which aligns well with the overall objective of making the givbacks page compatible with givback v2.

The formatting of the text, with "GIVbacks" in bold, looks good as is. The static analysis hint about replacing the text seems to be a false positive in this case.

Tools
GitHub Check: build

[failure] 146-146:
Replace ·<b>GIVbacks</b>.⏎↹↹↹↹↹The·project·gets·100%·of·your·donation,·and·you·get·rewarded⏎↹↹↹↹↹ with {'·'}⏎↹↹↹↹↹<b>GIVbacks</b>.·The·project·gets·100%·of·your·donation,·and⏎↹↹↹↹↹you·get·rewarded·

src/content/metatags.ts (4)

31-31: Clarify the terminology change and its implications.

The change from "verified projects" to "vouched projects" may indicate a shift in the project endorsement process. Please clarify:

  • What is the difference between "verified" and "vouched" projects?
  • Is this change in terminology consistent with the rest of the platform?
  • Does this change have any implications on the project eligibility criteria or the user experience?

38-38: LGTM!

The change from "verified projects" to "GIVbacks eligible projects" helps clarify the focus on projects that qualify for GIVbacks rewards. This aligns well with the overall objective of providing clearer guidance on project eligibility and rewards.


45-45: LGTM!

The updated description simplifies the message while emphasizing the $5 donation threshold for qualifying for GIV rewards. This change enhances user understanding of the conditions under which rewards are granted.


52-52: LGTM!

The updated description clarifies that GIVbacks rewards are specifically tied to GIVbacks eligible projects. This reinforces the connection between the GIVbacks program and project eligibility, enhancing user understanding of the reward system.

src/components/GIVeconomyPages/GIVbacks.tsx (3)

47-48: LGTM!

The import statements are syntactically correct and the imported entities are likely used for data fetching in the component.


152-171: LGTM!

The code segment correctly defines an interface for the fetched data, uses it to type the state variable, and fetches the data asynchronously in a useEffect hook when the component mounts. The fetched data is then correctly set in the state.


274-277: LGTM!

The code segment correctly uses optional chaining to safely access the allocatedGivTokens property from the givbackAllocations state. The rendering logic is sound.

The static analysis hint is a false positive as the code already uses optional chaining. No changes are necessary.

Tools
Biome

[error] 274-275: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

lang/en.json (7)

41-41: Looks good!

The updated description provides clarity by specifying "GIVbacks eligible projects."


60-60: Approved.

The tooltip text has been appropriately updated to reflect the new "GIVbacks eligible" terminology.


218-218: Looks good!

The updated text clearly communicates that donating to GIVbacks eligible projects is the way to get GIV.


274-274: Approved.

The label text has been appropriately updated to reflect the "GIVbacks Eligibility application" process.


321-328: Great updates!

The changes consistently replace "verified projects" with "GIVbacks eligible projects" across these donation-related labels and descriptions. This improves clarity and reinforces the specific criteria for projects to qualify for GIV rewards.


348-349: Looks good!

The updated texts effectively communicate the benefits of donating to higher ranked and GIVbacks eligible projects, specifically mentioning the increased GIVbacks rewards for donors. This provides clarity and encourages users to prioritize their donations accordingly.


356-356: Excellent work on maintaining consistency!

The changes consistently replace "verified" and "verification" with "GIVbacks eligible" and "GIVbacks eligibility" across multiple labels, descriptions, and messages throughout the file. This ensures a coherent user experience and reinforces the new terminology related to the GIVbacks program.

The updates provide clarity and accuracy in describing the GIVbacks eligibility process, criteria, and benefits, which will help users better understand and engage with the program.

Also applies to: 426-426, 437-437, 453-453, 498-498, 674-674, 751-751, 886-886, 1049-1049, 1098-1098, 1106-1106, 1109-1109, 1112-1114, 1118-1119, 1127-1127, 1130-1130, 1151-1151, 1154-1154, 1172-1172, 1205-1205, 1207-1207, 1434-1434, 1446-1446, 1493-1493, 1603-1603


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    -- I pushed a fix in commit <commit_id>, please review it.
    -- Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    -- @coderabbitai generate unit testing code for this file.
    -- @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    -- @coderabbitai generate interesting stats about this repository and render them as a table.
    -- @coderabbitai read src/utils.ts and generate unit testing code.
    -- @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    -- @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: QA
Development

Successfully merging this pull request may close these issues.

2 participants