-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Release 17 sep #4743
Release 17 sep #4743
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe pull request introduces updates across multiple JSON language files to enhance user communication regarding network eligibility and donation processes. New labels are added to inform users about checking their network connections and Stellar's eligibility for matching rounds. Additionally, several components are modified to improve functionality, including the introduction of a new GraphQL query for fetching allocated GIV tokens and adjustments to donation-related components for better user experience. Changes
Possibly related PRs
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Caution
Inline review comments failed to post
Actionable comments posted: 1
Outside diff range and nitpick comments (2)
src/components/views/donate/DonationCard.tsx (2)
56-56
: LGTM! Remember to uncomment theuseEffect
hook when the feature is ready.The
isEndaomentProject
variable is correctly checking the project's organization label. The variable name is clear and descriptive.Please remember to uncomment the
useEffect
hook at lines 99-103 when the feature is ready to be enabled.
97-103
: Acknowledge the temporary disabling of the feature.The comment clearly indicates that this feature needs more refinement. Commenting out the
useEffect
hook effectively disables the automatic setting of the active tab based on the provided conditions.Consider creating a GitHub issue to track the refinement of this feature. This will ensure that the feature is not forgotten and can be re-enabled once the necessary refinements are made. Do you want me to open a GitHub issue for this?
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
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 (13)
- lang/ca.json (4 hunks)
- lang/en.json (7 hunks)
- lang/es.json (2 hunks)
- package.json (2 hunks)
- src/apollo/gql/gqlGivbacks.ts (1 hunks)
- src/components/GIVeconomyPages/GIVbacks.tsx (3 hunks)
- src/components/views/donate/DonateIndex.tsx (4 hunks)
- src/components/views/donate/DonationCard.tsx (2 hunks)
- src/components/views/donate/OnTime/DonateQFEligibleNetworks.tsx (4 hunks)
- src/components/views/donate/OnTime/SelectTokenModal/QRCodeDonation/QRDonationCard.tsx (4 hunks)
- src/components/views/project/ProjectGIVbackToast.tsx (2 hunks)
- src/content/metatags.ts (1 hunks)
- src/wagmiConfigs.ts (2 hunks)
Files skipped from review due to trivial changes (2)
- lang/ca.json
- src/content/metatags.ts
Additional context used
Biome
src/components/GIVeconomyPages/GIVbacks.tsx
[error] 274-275: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
src/components/views/donate/OnTime/SelectTokenModal/QRCodeDonation/QRDonationCard.tsx
[error] 147-147: Avoid the use of spread (
...
) syntax on accumulators.Spread syntax should be avoided on accumulators (like those in
.reduce
) because it causes a time complexity ofO(n^2)
.
Consider methods such as .splice or .push instead.(lint/performance/noAccumulatingSpread)
Additional comments not posted (36)
src/apollo/gql/gqlGivbacks.ts (1)
1-12
: LGTM!The GraphQL query
FETCH_ALLOCATED_GIVBACKS
is well-defined and follows the correct syntax. It fetches relevant fields related to allocated givbacks and provides an optionalrefreshCache
parameter to control the caching behavior.The query can be used to fetch and display the necessary data to the user, enhancing the user experience by providing accurate and up-to-date information about givbacks.
src/wagmiConfigs.ts (2)
2-2
: LGTM!The import statement for the
safe
connector is syntactically correct and aligns with the PR objective of enhancing wallet integration capabilities.
31-33
: LGTM!The configuration for the
safe
connector is correct and theallowedDomains
property is effectively used to restrict its usage to the Safe application domain. This enhances security by preventing unauthorized usage of the connector.package.json (2)
38-38
: LGTM!Updating the
@web3modal/wagmi
dependency to version^5.1.7
is a good practice to keep the project up to date with the latest changes in the package.
75-75
: LGTM!Updating the
wagmi
dependency to version^2.12.10
is a good practice to keep the project up to date with the latest changes in the package.src/components/views/donate/OnTime/DonateQFEligibleNetworks.tsx (5)
20-22
: LGTM!The type definition for
TDonateQFEligibleNetworksProps
is correctly defined with an optionalgoBack
prop of type function.
24-26
: LGTM!The
DonateQFEligibleNetworks
component is correctly defined as a functional component (FC) with TypeScript typing for its props. ThegoBack
prop is correctly destructured from the props object.
31-32
: LGTM!The
useRouter
hook is correctly used to access the router object, and theisQRDonation
variable is correctly set based on thechain
query parameter in the URL.
48-50
: LGTM!The
goBackToNetworkSelection
function correctly invokes thegoBack
prop function using the optional chaining operator?.
to avoid errors if the prop is not provided.
62-105
: LGTM!The component correctly renders different donation eligibility messages based on the donation method (QR code or not). The "Go back and check network" link and the "Switch Network" option are appropriately shown based on the condition. The modal for switching networks is correctly displayed only for non-QR donations.
src/components/views/project/ProjectGIVbackToast.tsx (2)
330-330
: LGTM!Changing the button width to
100%
improves the responsiveness of the layout by allowing it to adapt to the width of the parent container. This is a good change that enhances the flexibility of the component across different screen sizes.
357-357
: LGTM!Changing the media query breakpoint from
tablet
tolaptopL
for theWrapper
component is a good adjustment. It means the component's flex direction will switch from column to row at a higher screen width, potentially improving the layout for users on laptops or larger devices. This change aligns with the goal of enhancing the user interface on bigger screens.src/components/GIVeconomyPages/GIVbacks.tsx (5)
47-48
: LGTM!The import statements are syntactically correct and the imported entities are likely used for fetching data in the component.
152-160
: LGTM!The interface
GivbackAllocations
is correctly defined and the state variablegivbackAllocations
is correctly typed using the interface. The initial value ofnull
indicates that the data is not available initially.
162-171
: LGTM!The
useEffect
hook is correctly defined to fetch allocated GIVbacks data using theFETCH_ALLOCATED_GIVBACKS
query and update thegivbackAllocations
state. ThefetchPolicy
is set to'no-cache'
to ensure that the data is always fetched from the server.
274-277
: LGTM!The conditional rendering logic is correctly defined to render the allocated GIV tokens or a placeholder
'?'
based on the availability ofgivbackAllocations
data. The optional chaining operator?.
is correctly used to handle the case whengivbackAllocations
is not available.Tools
Biome
[error] 274-275: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
274-275
: Skipping the static analysis hint.The code segment at line range 274-275 already uses the optional chaining operator
?.
correctly to handle the case whengivbackAllocations
is not available. The static analysis hint is a false positive and can be safely ignored.Tools
Biome
[error] 274-275: Change to an optional chain.
Unsafe fix: Change to an optional chain.
(lint/complexity/useOptionalChain)
src/components/views/donate/DonateIndex.tsx (4)
83-83
: LGTM!The
isQRDonation
constant is correctly set based on thechain
query parameter to determine if the current donation is being made via the Stellar blockchain. This will be useful for conditionally rendering components specific to QR code donations.
Line range hint
233-241
: LGTM!The
AlreadyDonatedWrapper
component is now conditionally rendered based on both thealreadyDonated
state and theisQRDonation
variable. This ensures that the "already donated" message is not shown for QR code donations, improving the user experience for users making donations via QR code.
243-246
: LGTM!The
PassportBanner
component's visibility is now also conditional on theisQRDonation
variable. This ensures that thePassportBanner
component is not shown for QR code donations, in addition to the existing conditions, aligning with the PR objective of tailoring the interface based on the type of donation being made.
272-274
: LGTM!The logic for rendering the
QFSection
component has been adjusted to exclude theisQRDonation
condition. This ensures that theQFSection
component is only shown when the donation is not a QR donation, not recurring, and there is an active QF round, aligning with the PR objective of tailoring the interface based on the type of donation being made.src/components/views/donate/OnTime/SelectTokenModal/QRCodeDonation/QRDonationCard.tsx (7)
42-42
: LGTM!The import statement looks good.
66-66
: LGTM!The
isQRDonation
variable is correctly set based on the current query chain.
74-74
: LGTM!The
hasActiveQFRound
prop is correctly added and destructured from theuseDonateData
hook.
154-160
: LGTM!The code correctly handles the case when the draft donation status is 'matched' by updating the QR donation status and draft donation data.
164-169
: LGTM!The code correctly marks the draft donation as failed, updates the state, and navigates back with the updated router query.
172-175
: LGTM!The code correctly sets
isQRDonation
tofalse
and navigates back with the updated router query.
339-341
: LGTM!The code correctly renders the
DonateQFEligibleNetworks
component based on the presence of an active QF round and QR donation.lang/en.json (6)
182-182
: LGTM!The new label clearly communicates that Stellar is not eligible for matching in the current round.
341-341
: Looks good!The new label provides a clear call-to-action for users to check their network connection.
358-358
: Enhancements look good!The label changes improve clarity by:
- Specifying "GIVbacks Rewards"
- Mentioning the reward dependency on the donation amount
- Stating the maximum reward amount of 1 million GIV
This sets the right expectations for users regarding the GIVbacks round rewards.
439-439
: Nice update!The label change enhances clarity and incentive by:
- Specifying the minimum donation amount of $5 to qualify for GIV
- Stating that donors qualify to get GIV for donating to eligible projects
This provides a clear and attractive value proposition to potential donors.
484-484
: Good terminology update!Changing the label to "GIVbacks Rewards" aligns it with the overall branding and makes it more specific and clear compared to the previous generic text.
1156-1156
: Nice simplification!The label change simplifies the text, makes it more concise, and adds emphasis with the exclamation mark. This improves readability and engagement.
lang/es.json (2)
341-341
: LGTM!The new label is clear, grammatically correct, and will help guide users to check their network connection when needed.
342-342
: Looks good!The new label clearly communicates that Stellar is not eligible for the current round, providing transparency to users.
Comments failed to post (1)
src/components/views/donate/OnTime/SelectTokenModal/QRCodeDonation/QRDonationCard.tsx (1)
142-149: Avoid using spread syntax on accumulators for better performance.
The
updateQuery
function uses the spread syntax on the accumulator object in thereduce
callback. This can cause a time complexity of O(n^2) and impact performance.Consider using
Object.assign
orObject.fromEntries
instead:- return key !== excludeKey - ? { ...acc, [key]: prevQuery[key] } - : acc; + return key !== excludeKey + ? Object.assign(acc, { [key]: prevQuery[key] }) + : acc;or
- }, {}); + }, Object.fromEntries( + Object.entries(prevQuery).filter(([key]) => key !== excludeKey) + ));Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.const prevQuery = router.query; const updateQuery = (excludeKey: string) => Object.keys(prevQuery).reduce((acc, key) => { return key !== excludeKey ? Object.assign(acc, { [key]: prevQuery[key] }) : acc; }, {});
Tools
Biome
[error] 147-147: Avoid the use of spread (
...
) syntax on accumulators.Spread syntax should be avoided on accumulators (like those in
.reduce
) because it causes a time complexity ofO(n^2)
.
Consider methods such as .splice or .push instead.(lint/performance/noAccumulatingSpread)
related to #4382
# Conflicts: # src/components/views/donate/OnTime/OneTimeDonationCard.tsx
Summary by CodeRabbit
Release Notes
New Features
Improvements
Bug Fixes