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

Hotfix - fix stellar doante card UI #4734

Merged
merged 9 commits into from
Sep 16, 2024
Merged

Conversation

mohammadranjbarz
Copy link
Contributor

@mohammadranjbarz mohammadranjbarz commented Sep 15, 2024

related to #4732

Summary by CodeRabbit

  • New Features

    • Added a message indicating Stellar is not eligible for matching donations, enhancing user feedback.
    • Introduced a new wallet connection option for Safe, a multi-signature wallet solution.
    • Updated donation interface to conditionally display information based on donation type (QR or non-QR).
  • Bug Fixes

    • Improved responsiveness of button components and layout adjustments for better user experience on larger screens.
  • Chores

    • Updated dependency versions to improve performance and potentially introduce new features.

Copy link

vercel bot commented Sep 15, 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 16, 2024 1:26pm

@mohammadranjbarz mohammadranjbarz changed the base branch from develop to main September 15, 2024 11:15
Copy link
Contributor

coderabbitai bot commented Sep 15, 2024

Walkthrough

The pull request introduces several changes across multiple files, primarily focusing on enhancing user feedback related to donation eligibility and improving the user interface for donation processes. Key modifications include the addition of new labels in the localization file, updates to dependency versions, and the introduction of conditional rendering logic in various components to differentiate between donation types, particularly concerning the Stellar blockchain.

Changes

File Change Summary
lang/en.json Added a new label "label.stellar_is_not_eligible_for_matching" to clarify that "Stellar is not eligible for this round" and instruct users to check their network settings.
package.json Updated versions of dependencies: @web3modal/wagmi from ^5.0.7 to ^5.1.7 and wagmi from ^2.11.3 to ^2.12.10.
src/components/views/donate/DonateIndex.tsx Introduced a new state variable isQRDonation to manage rendering logic based on donation type, affecting the display of PassportBanner and QFSection components.
src/components/views/donate/DonationCard.tsx Added a boolean variable isEndaomentProject to influence the active tab state in the useEffect hook, with logic related to Endaoment projects.
src/components/views/donate/OnTime/DonateQFEligibleNetworks.tsx Introduced isQRDonation state variable to conditionally render the MakeDonationDescription component based on donation type.
src/components/views/donate/OnTime/SelectTokenModal/QRCodeDonation/QRDonationCard.tsx Added a new component DonateQFEligibleNetworks with conditional rendering based on hasActiveQFRound and isQRDonation states.
src/components/views/project/ProjectGIVbackToast.tsx Modified styling of ButtonWrapper for responsive design and updated media query for Wrapper component to improve layout on larger screens.
src/wagmiConfigs.ts Introduced a new connector safe in wagmiConfig for integrating with Safe multi-signature wallet, enhancing wallet connection options.

Possibly related PRs

Suggested labels

Code Review

Poem

🐇 In the meadow where donations bloom,
A label added to dispel the gloom.
With QR codes and Stellar in sight,
User feedback shines ever so bright!
Hopping along, we enhance the way,
For every donation, come what may! 🌼


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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Outside diff range and nitpick comments (1)
src/components/views/donate/DonateIndex.tsx (1)

81-83: LGTM!

The code segment correctly initializes the isQRDonation state variable based on the router.query.chain value to differentiate between donation types.

Consider using a constant for the comparison value 'stellar' to improve readability and maintainability. For example:

+const STELLAR_CHAIN_TYPE = 'stellar';

const [isQRDonation, _setIsQRDonation] = useState(
-  router.query.chain === ChainType.STELLAR.toLowerCase(),
+  router.query.chain === STELLAR_CHAIN_TYPE,
);
Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 9020bb9 and 168889c.

Files ignored due to path filters (2)
  • public/images/banners/qf-round/giv-palooza.svg is excluded by !**/*.svg
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
Files selected for processing (8)
  • lang/en.json (1 hunks)
  • package.json (2 hunks)
  • src/components/views/donate/DonateIndex.tsx (3 hunks)
  • src/components/views/donate/DonationCard.tsx (2 hunks)
  • src/components/views/donate/OnTime/DonateQFEligibleNetworks.tsx (3 hunks)
  • src/components/views/donate/OnTime/SelectTokenModal/QRCodeDonation/QRDonationCard.tsx (3 hunks)
  • src/components/views/project/ProjectGIVbackToast.tsx (2 hunks)
  • src/wagmiConfigs.ts (2 hunks)
Files skipped from review due to trivial changes (1)
  • package.json
Additional comments not posted (16)
src/wagmiConfigs.ts (1)

31-33: LGTM!

The addition of the safe connector to the wagmiConfig configuration is a valuable enhancement to the wallet connection options. It allows users to connect through Safe, a multi-signature wallet solution, expanding the functionality and flexibility of the application.

The allowedDomains property is correctly configured with a regular expression that restricts connections to the Safe application hosted at app.safe.global. This configuration helps ensure that connections are only allowed from the trusted Safe application domain, enhancing security.

Overall, the code changes are well-implemented and should provide a seamless integration with Safe for wallet connections.

src/components/views/donate/OnTime/DonateQFEligibleNetworks.tsx (4)

12-12: LGTM!

The useRouter hook is correctly imported from next/router. It is a standard Next.js hook used to access the router object.


25-28: LGTM!

The code correctly initializes the isQRDonation state based on the chain query parameter from the router. It uses the router.query object to access the query parameters and compares it with the lowercase value of ChainType.STELLAR for case-insensitive matching.


54-60: LGTM!

The code correctly conditionally renders the MakeDonationDescription component based on the value of isQRDonation. When isQRDonation is false, it displays a message indicating that donations made on certain chains (obtained from chainsString) are eligible for matching.


61-70: LGTM!

The code correctly conditionally renders the MakeDonationDescription component based on the value of isQRDonation. When isQRDonation is true, it displays an additional message indicating that donations made on the Stellar network are not eligible for matching, while still showing the eligible chain names obtained from chainsString.

src/components/views/donate/DonationCard.tsx (2)

56-56: LGTM!

The variable declaration is correct, and the logic to determine if the project is associated with Endaoment is accurate.


97-103: Verify the intended behavior and track the refinement of this feature.

The commented-out code suggests that the default active tab should not be set to 'RECURRING' for Endaoment projects. Please confirm if this is the intended behavior.

Also, the comment indicates that this feature needs more refinement. Consider creating a separate issue or task to track the polish and re-enablement of this feature.

Do you want me to open a GitHub issue to track the refinement and re-enablement of this feature?

src/components/views/project/ProjectGIVbackToast.tsx (2)

330-330: LGTM!

The change to set the width of the ButtonWrapper component to 100% is a good improvement for responsiveness. It allows the button wrapper to adapt to the width of its parent container, enhancing adaptability across different screen sizes.


357-357: Verify the layout on larger screens.

Updating the media query for the Wrapper component from tablet to laptopL is a reasonable change. It modifies the breakpoint at which the layout switches from a column to a row direction, targeting larger screens.

Please ensure that the layout appears as intended on devices that fall within the laptopL category after this change.

src/components/views/donate/DonateIndex.tsx (2)

244-247: LGTM!

The code segment correctly updates the rendering logic for the PassportBanner component by adding a new condition !isQRDonation. This ensures that the banner is not displayed for QR donations while still considering the existing conditions.


275-275: LGTM!

The code segment correctly updates the rendering logic for the QFSection component by adding a new condition !isQRDonation. This ensures that the section is not displayed for QR donations while still considering the existing conditions.

src/components/views/donate/OnTime/SelectTokenModal/QRCodeDonation/QRDonationCard.tsx (4)

42-42: LGTM!

The import statement for the DonateQFEligibleNetworks component is correctly added.


66-68: LGTM!

The isQRDonation state variable is correctly introduced and initialized based on the router query.


76-76: LGTM!

The hasActiveQFRound prop is correctly added to the useDonateData hook.


319-321: LGTM!

The conditional rendering of the DonateQFEligibleNetworks component based on hasActiveQFRound and isQRDonation is correctly implemented.

lang/en.json (1)

182-182: LGTM!

The added key-value pair provides a clear and informative message to users about Stellar's ineligibility for the current round and guides them to verify their network settings.

@mohammadranjbarz mohammadranjbarz changed the title 4732 fix stellar doante card UI Hotfix - fix stellar doante card UI Sep 15, 2024
Copy link
Collaborator

@kkatusic kkatusic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM ;) thx @mohammadranjbarz

@Meriem-BM
Copy link
Collaborator

Another related issue #4733

@Meriem-BM Meriem-BM merged commit e81845a into main Sep 16, 2024
3 checks passed
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.

3 participants