-
-
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
Merge main to develop #4997
base: develop
Are you sure you want to change the base?
Merge main to develop #4997
Conversation
Release: Recurring Donations on Base
…roject single page" This reverts commit f79c543.
New release: Vouched projects & and superfluid Base improvements
HOTFIX: update docs links + update hardcoded docs links
HOTFIX: adjust height of project card on mobile qf view
HOTFIX: change catalan locale & route to ct from ca
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThis pull request introduces a comprehensive update to the language handling and localization strategy for the application, primarily focusing on changing the Catalan language code from Changes
Sequence DiagramsequenceDiagram
participant User
participant LanguageSystem
participant JSONFiles
participant Components
User->>LanguageSystem: Select Language
LanguageSystem->>JSONFiles: Retrieve Language Data
JSONFiles-->>LanguageSystem: Return Translations (ct)
LanguageSystem->>Components: Apply Translations
Components->>User: Display Localized Content
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
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.
Actionable comments posted: 2
🔭 Outside diff range comments (1)
lang/translate.js (1)
Line range hint
4-4
: Secure the API key.The API key is currently empty. This could lead to runtime errors when attempting translations. Consider using environment variables to securely manage API keys.
-const apiKey = ''; // Replace with your ChatGPT API key +const apiKey = process.env.OPENAI_API_KEY;
🧹 Nitpick comments (1)
src/components/views/project/projectActionCard/ProjectEligibleQFChains.tsx (1)
60-63
: Consider removing unnecessary max-height property.The changes improve responsiveness by allowing content to wrap. However,
max-height: 100%
is unnecessary here as it won't affect the wrapping behavior and the parent container doesn't have a fixed height.Apply this diff to remove the unnecessary property:
flex-wrap: wrap; /* Allow content to wrap to the next line */ max-width: 100%; /* Ensure the content does not exceed the width of the parent */ - max-height: 100%; /* Ensure the content does not exceed the height of the parent */
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (10)
public/images/banners/qf-round/loving-PG/GivethDonors.svg
is excluded by!**/*.svg
public/images/banners/qf-round/loving-PG/GloDollar.svg
is excluded by!**/*.svg
public/images/banners/qf-round/loving-PG/MUX.svg
is excluded by!**/*.svg
public/images/banners/qf-round/loving-PG/PublicNouns.svg
is excluded by!**/*.svg
public/images/flags/ct.svg
is excluded by!**/*.svg
public/images/icons/clock.svg
is excluded by!**/*.svg
public/images/tokens/TRUMP.png
is excluded by!**/*.png
public/images/tokens/TRUMP.svg
is excluded by!**/*.svg
public/images/tokens/cCOP.png
is excluded by!**/*.png
public/images/tokens/cCOP.svg
is excluded by!**/*.svg
📒 Files selected for processing (38)
lang/ct.json
(1 hunks)lang/en.json
(1 hunks)lang/es.json
(1 hunks)lang/find.js
(2 hunks)lang/index.ts
(1 hunks)lang/translate.js
(2 hunks)lang/update.js
(2 hunks)next.config.js
(1 hunks)pages/_app.tsx
(2 hunks)src/components/GIVeconomyPages/GIVstream.tsx
(2 hunks)src/components/givfarm/RegenStreamSection.tsx
(2 hunks)src/components/modals/HarvestAll.sc.tsx
(0 hunks)src/components/modals/LanguageModal.tsx
(1 hunks)src/components/modals/VerificationModal.tsx
(2 hunks)src/components/project-card/ProjectCard.tsx
(4 hunks)src/components/views/about/AboutHistory.tsx
(0 hunks)src/components/views/claim/cards/Connect.tsx
(2 hunks)src/components/views/donate/DonatePageProjectDescription.tsx
(3 hunks)src/components/views/donate/OneTime/EstimatedMatchingToast.tsx
(0 hunks)src/components/views/donate/QFEligibleNetworks.tsx
(1 hunks)src/components/views/donate/Recurring/RecurringDonationCard.tsx
(1 hunks)src/components/views/homepage/InformationBlock.tsx
(2 hunks)src/components/views/homepage/TorusBanner.tsx
(0 hunks)src/components/views/homepage/aboutGiveconomy/index.tsx
(2 hunks)src/components/views/landings/onboarding/main/WhatIsGIV.tsx
(2 hunks)src/components/views/nft/overview/EligibilityModal.tsx
(2 hunks)src/components/views/nft/overview/WhatElse.tsx
(1 hunks)src/components/views/project/ProjectDevouchBox.tsx
(1 hunks)src/components/views/project/projectActionCard/DonationSection.tsx
(2 hunks)src/components/views/project/projectActionCard/ProjectEligibleQFChains.tsx
(1 hunks)src/components/views/project/projectDonations/ProjectTotalFundCard.tsx
(1 hunks)src/components/views/projects/qfBanner/ActiveQFProjectsBanner.tsx
(6 hunks)src/config/production.tsx
(1 hunks)src/content/FAQ.tsx
(0 hunks)src/helpers/qf.ts
(0 hunks)src/helpers/time.ts
(0 hunks)src/lib/constants/links.ts
(3 hunks)src/lib/helpers.ts
(1 hunks)
💤 Files with no reviewable changes (7)
- src/components/modals/HarvestAll.sc.tsx
- src/helpers/time.ts
- src/components/views/about/AboutHistory.tsx
- src/helpers/qf.ts
- src/components/views/homepage/TorusBanner.tsx
- src/components/views/donate/OneTime/EstimatedMatchingToast.tsx
- src/content/FAQ.tsx
✅ Files skipped from review due to trivial changes (3)
- lang/index.ts
- lang/ct.json
- lang/en.json
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: build
🔇 Additional comments (27)
src/components/views/nft/overview/WhatElse.tsx (1)
55-55
: LGTM! Verify the NFT_DOCS constant.Good practice to use centralized link constants instead of hardcoded URLs.
Let's verify that the constant exists and points to the correct URL:
✅ Verification successful
✅ Constant verification successful
The
NFT_DOCS
constant is properly defined in the links module and points to 'https://docs.giveth.io/pfpcollection'.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the NFT_DOCS constant exists and check its value # Expected: Should find the constant definition with the correct URL rg -A 1 "NFT_DOCS.*=" src/Length of output: 233
Script:
#!/bin/bash # Find and display the links constant file content fd links.ts -t f -x cat {}Length of output: 3747
src/components/givfarm/RegenStreamSection.tsx (1)
8-8
: LGTM! Good use of centralized link management.The changes improve maintainability by replacing hardcoded URLs with constants from a centralized module.
Also applies to: 47-47
lang/update.js (1)
10-11
: LGTM! Consistent language code update.The changes correctly update all references from 'ca' to 'ct' while maintaining the existing functionality.
Also applies to: 75-75, 78-78, 82-82, 85-85, 89-89
lang/translate.js (1)
51-52
: LGTM! Language code changes are consistent.The changes from
ca
toct
for Catalan language code are consistent with the PR objectives. Both commented and active code sections have been updated appropriately.Also applies to: 71-84
src/components/views/landings/onboarding/main/WhatIsGIV.tsx (1)
16-16
: LGTM! Improved URL management.Good refactoring to use centralized URL constants instead of hardcoded values. This improves maintainability.
Also applies to: 44-44
src/components/views/nft/overview/EligibilityModal.tsx (1)
15-15
: LGTM! Improved URL management.Good refactoring to use centralized URL constants instead of hardcoded values. This improves maintainability.
Also applies to: 59-59
src/components/views/homepage/InformationBlock.tsx (1)
17-17
: LGTM! Improved routing management.Good refactoring to use the appropriate routing constant from
Routes
instead oflinks
. This maintains consistency in routing management.Also applies to: 46-46
src/components/modals/LanguageModal.tsx (1)
14-14
: Verify language code change impact.The change from 'ca' to 'ct' for Catalan needs to be consistently applied across the codebase to avoid localization issues.
Let's verify the language code change is consistently applied:
✅ Verification successful
Language code change is consistently applied
The change from 'ca' to 'ct' for Catalan has been properly implemented across the codebase. All relevant files are using the new 'ct' code:
- Configuration files (next.config.js)
- Language selection components (LanguageModal.tsx)
- Helper functions (helpers.ts)
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for any remaining instances of 'ca' language code # and verify 'ct' is properly set up # Check for any remaining 'ca' language code references echo "Checking for remaining 'ca' language code references..." rg --type-add 'config:*.{js,ts,tsx,json}' -t config '"ca"' # Check for proper 'ct' language code setup echo "Checking 'ct' language code setup..." rg --type-add 'config:*.{js,ts,tsx,json}' -t config '"ct"' # Check language JSON files echo "Checking language JSON files..." fd -e json -x cat {} \; -E "package*.json" | jq -r 'keys[]' | grep -E 'ca|ct'Length of output: 66030
Script:
#!/bin/bash # Search for language/i18n related files and configurations echo "Searching for language configuration files..." fd -e ts -e tsx -e json . | grep -i "lang\|i18n\|translat\|local" echo -e "\nChecking language-related code..." # Look for language code definitions and selectors rg -t typescript -t tsx "language.*=.*\[.*'.*'" -g "!**/node_modules/**" rg -t typescript -t tsx "locale.*=.*\[.*'.*'" -g "!**/node_modules/**" rg -t typescript -t tsx "const.*Lang.*=.*" -g "!**/node_modules/**" echo -e "\nChecking i18n configuration..." # Look for i18n configuration rg -t typescript -t tsx -t json "i18n.*config" -g "!**/node_modules/**"Length of output: 979
Script:
#!/bin/bash # Check language file contents and references echo "Checking language file contents..." cat lang/t_ca.json lang/nt_ca.json lang/ct.json 2>/dev/null || echo "Some files not found" echo -e "\nSearching for references to language files..." rg --type=ts --type=tsx --type=json "t_ca|nt_ca|\.ca\." -g "!**/node_modules/**" echo -e "\nSearching for language code usage..." rg --type=ts --type=tsx --type=json "['\"](ca|ct)['\"]" -g "!**/node_modules/**"Length of output: 79420
Script:
#!/bin/bash # Search for language code references without file type restrictions echo "Searching for language code references..." rg "['\"](ca|ct)['\"]" -g "!**/node_modules/**" -g "!*.json" echo -e "\nSearching for imports of language files..." rg "import.*['\"].*/(t_ca|nt_ca|ct)['\"]" -g "!**/node_modules/**"Length of output: 515
src/components/modals/VerificationModal.tsx (1)
19-19
: LGTM! Good improvement in link management.The changes improve maintainability by centralizing link management through the
links
constant.Also applies to: 59-59
src/components/views/project/ProjectDevouchBox.tsx (1)
48-48
: Verify documentation reference change.The link has been changed from
DEVOUCH_DOCS
toPROJECT_VERIFICATION
. Please confirm this is the intended documentation for users learning about the devouch feature.Let's verify the documentation references:
✅ Verification successful
Documentation reference change is correct.
The change from
DEVOUCH_DOCS
toPROJECT_VERIFICATION
is appropriate as it points to the verification typeform which is the intended documentation for users learning about the devouch feature and project verification process. This aligns with the UI text that mentions "Learn more about DeVouch & Decentralized Verification".🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check the content of both documentation pages # to ensure we're pointing to the correct documentation # Get both documentation URLs echo "Fetching URLs from links constant..." rg "DEVOUCH_DOCS.*=.*'(.*)'" -or '$1' rg "PROJECT_VERIFICATION.*=.*'(.*)'" -or '$1'Length of output: 182
Script:
#!/bin/bash # Find potential files containing link definitions echo "Looking for files that might contain link definitions..." fd -t f -e ts -e js "links" -e "constants" # Once we find the files, let's look at their content echo -e "\nSearching for DEVOUCH or PROJECT_VERIFICATION related constants..." rg -i "devouch|project.*verif" -A 2 -B 2Length of output: 116201
Script:
#!/bin/bash # Find TYPEFORM constant definition echo "Looking for TYPEFORM constant..." rg "TYPEFORM.*=.*'(.*)'" -or '$1' # Also look for any other verification documentation URLs echo -e "\nLooking for verification documentation URLs..." rg "VERIFICATION_DOCS.*=.*'(.*)'" -or '$1'Length of output: 332
src/components/views/donate/QFEligibleNetworks.tsx (1)
98-100
: LGTM! Good improvement in responsive layout.The added CSS properties enhance the layout behavior:
flex-wrap: wrap
allows icons to wrap when neededmax-width/height: 100%
prevents overflow issuessrc/components/views/project/projectActionCard/DonationSection.tsx (1)
23-23
: LGTM! Good improvement in URL management.The changes improve maintainability by centralizing URL management in the
links
constant instead of using hardcoded URLs.Also applies to: 85-85
src/lib/constants/links.ts (1)
6-6
: Verify accessibility of updated URLs.Please ensure that all updated and new URLs are valid and accessible, particularly:
- Updated documentation paths (e.g., '/givdrop', '/givfarm', etc.)
- New bridge URL ('https://bridge.gnosischain.com/')
- New documentation links (e.g., '/zero-fees', '/regenfarms', etc.)
Run this script to verify URL accessibility:
Also applies to: 34-52, 65-65, 67-68
✅ Verification successful
All URLs are valid and accessible
All documentation paths and the bridge URL return successful HTTP 200 responses, confirming their accessibility.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check if the URLs are accessible # Function to check URL check_url() { local url="$1" local response=$(curl -s -o /dev/null -w "%{http_code}" "$url") if [ "$response" -eq 200 ] || [ "$response" -eq 301 ] || [ "$response" -eq 302 ]; then echo "✓ $url is accessible (HTTP $response)" else echo "✗ $url is not accessible (HTTP $response)" fi } # Check documentation URLs check_url "https://docs.giveth.io/givdrop" check_url "https://docs.giveth.io/givfarm" check_url "https://docs.giveth.io/givstream" check_url "https://docs.giveth.io/givbacks" check_url "https://docs.giveth.io/givpower" check_url "https://docs.giveth.io/zero-fees" check_url "https://docs.giveth.io/regenfarms" check_url "https://bridge.gnosischain.com/"Length of output: 2665
src/components/views/projects/qfBanner/ActiveQFProjectsBanner.tsx (2)
1-1
: LGTM! Clean up of imports.Good cleanup of imports by removing unused components and adding necessary ones.
Also applies to: 12-13
Line range hint
137-147
: Verify sponsor image paths.Please ensure that all sponsor SVG images exist at the specified paths:
- '/images/banners/qf-round/loving-PG/GloDollar.svg'
- '/images/banners/qf-round/loving-PG/PublicNouns.svg'
- '/images/banners/qf-round/loving-PG/MUX.svg'
- '/images/banners/qf-round/loving-PG/GivethDonors.svg'
Run this script to verify image paths:
Also applies to: 176-193
✅ Verification successful
All sponsor SVG images are present at the specified paths
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check if sponsor image files exist # Find all SVG files in the public directory echo "Searching for sponsor SVG files..." fd -t f "GloDollar.svg|PublicNouns.svg|MUX.svg|GivethDonors.svg" public/images/banners/qf-round/loving-PG/Length of output: 406
next.config.js (1)
14-14
: Verify language code update impact.The change from 'ca' to 'ct' for Catalan is part of a broader language code update. Please ensure:
- All language files are updated accordingly
- All components using language codes are updated
- User preferences handling is updated
- No hardcoded 'ca' references remain
Run this script to check for any remaining 'ca' references:
✅ Verification successful
Language code update is properly implemented
The codebase has been successfully updated to use 'ct' for Catalan:
- Language files and configurations use the new 'ct' code
- Language selection and user preferences handle 'ct' correctly
- No remaining 'ca' references found in critical paths
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Find any remaining 'ca' language code references echo "Searching for 'ca' language code references..." # Search in TypeScript/JavaScript files rg -i "['\"](ca)['\"]" --type ts --type js # Search in JSON files rg -i "\"lang\.ca\"" --type jsonLength of output: 190
Script:
#!/bin/bash # Find language/locale related files and directories echo "=== Looking for language/locale files ===" fd -t f -e json -e yaml -e js "lang|locale|i18n|translations" echo -e "\n=== Searching for language codes ===" # Broader search for 'ca' in all text files echo "--- Searching for 'ca' ---" rg -i "ca" --type-add 'config:*.{js,json,yaml,yml}' --type config -l # Search for 'ct' to see the transition echo -e "\n--- Searching for 'ct' ---" rg -i "ct" --type-add 'config:*.{js,json,yaml,yml}' --type config -l # Look for language selection or switching code echo -e "\n=== Checking language selection patterns ===" rg -i "language|locale" --type js --type ts -A 2Length of output: 66039
Script:
#!/bin/bash echo "=== Checking language selection and user preferences ===" # Look for language selection/switching code rg -i "setLanguage|language.*=|locale.*=|useLanguage" --type ts --type js -A 2 echo -e "\n=== Checking components for language codes ===" # Search for language code usage in components rg -i "['\"](ca|ct)['\"]" --type ts --type js --type jsx --type tsx -g "src/components/**" echo -e "\n=== Checking user preferences handling ===" # Look for user preferences/settings code rg -i "userPreferences|settings.*language|localStorage.*lang" --type ts --type js -A 2Length of output: 16358
src/components/views/homepage/aboutGiveconomy/index.tsx (1)
17-17
: LGTM! Improved link management.The changes enhance maintainability by replacing the hardcoded URL with a centralized link constant.
Also applies to: 149-149
src/components/views/donate/DonatePageProjectDescription.tsx (1)
29-29
: LGTM! Code improvements.The changes:
- Enhance maintainability by using centralized link constants
- Simplify the destructuring of the
estimatedMatching
objectAlso applies to: 53-54, 197-197
src/components/views/claim/cards/Connect.tsx (1)
20-20
: LGTM! Improved link management.The changes enhance maintainability by replacing the hardcoded URL with a centralized link constant.
Also applies to: 175-175
src/components/views/project/projectDonations/ProjectTotalFundCard.tsx (1)
Line range hint
216-224
: Verify error handling for undefined matchFund.The removal of the default value for
matchFund
in theformatDonation
call could lead to potential issues ifmatchFund
is undefined. Consider adding a fallback value or validating the input.-formatDonation( - matchFund, - allocatedFundUSDPreferred ? '$' : '', - locale, - !!selectedQFData?.isActive, -) +formatDonation( + matchFund ?? 0, + allocatedFundUSDPreferred ? '$' : '', + locale, + !!selectedQFData?.isActive, +)src/components/GIVeconomyPages/GIVstream.tsx (1)
67-67
: LGTM! Good use of centralized link management.Moving the hardcoded URL to a constant improves maintainability and makes it easier to update documentation links across the application.
Also applies to: 244-244
src/components/project-card/ProjectCard.tsx (2)
485-489
: LGTM! Good type safety improvement.Adding the
IWrapperProps
interface improves type safety and makes the component's props more maintainable.
94-95
: Verify the impact of dynamic height adjustment.The card height now depends on
$activeStartedRound
. Ensure this change doesn't cause layout shifts or affect the user experience when rounds change status.Also applies to: 539-539
✅ Verification successful
Height adjustment implementation appears safe and controlled.
The 24px height difference between active/inactive states is minimal and explicitly defined, with no evidence of cascading layout impacts. The laptop breakpoint maintains a consistent height, providing additional stability.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for potential layout issues with dynamic height # Look for other components that might be affected by height changes # Search for components that reference ProjectCard's height rg -A 3 "height.*(?:472|536|560)px" # Search for grid or flex containers that might be affected ast-grep --pattern 'grid-template-rows: $_'Length of output: 66082
src/lib/helpers.ts (1)
154-154
: LGTM! Consistent language code update.The change from 'ca' to 'ct' for Catalan aligns with the broader language code standardization across the application.
src/components/views/donate/Recurring/RecurringDonationCard.tsx (1)
144-147
: Verify the impact of modified token decimals handling.The condition for resetting
amount
andperMonthAmount
has been changed to only trigger for tokens with 6 decimals, whereas previously it also included tokens with 8 decimals. This change could affect how donations are handled for tokens with 8 decimals.Let's verify the tokens that might be affected:
src/config/production.tsx (1)
666-666
: LGTM! Token name correctly updated.The token name has been properly updated to "Super Dai Stablecoin" to match its symbol (DAIx) and underlying token (DAI).
lang/es.json (1)
1359-1359
: LGTM! The Catalan language code translation has been updated.The addition of
"lang.ct": "Catalán"
is consistent with the broader change of updating the Catalan language code fromca
toct
across the application.Let's verify that this change is consistent with other language files:
✅ Verification successful
✅ Catalan language code change is consistently implemented
The change from
ca
toct
has been properly implemented across all language files (en, es, ct), with appropriate translations in each language.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check if the Catalan language code has been updated consistently across all language files # Test: Search for both old and new Catalan language codes echo "Checking for old Catalan language code (ca)..." rg '"lang\.ca"' lang/ echo "Checking for new Catalan language code (ct)..." rg '"lang\.ct"' lang/Length of output: 360
Summary by CodeRabbit
Based on the comprehensive summary, here are the release notes:
Localization
Documentation Links
links
moduleUI/UX Improvements
Miscellaneous