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

Fix UI issues#4726 #4771

Merged
merged 7 commits into from
Oct 1, 2024
Merged

Fix UI issues#4726 #4771

merged 7 commits into from
Oct 1, 2024

Conversation

lovelgeorge99
Copy link
Collaborator

@lovelgeorge99 lovelgeorge99 commented Sep 24, 2024

Issue #4726
made changes for 1,2,3,4,6
i am still working on 5

Summary by CodeRabbit

  • New Features

    • Adjusted text display for the ShareLikeBadge based on donation status.
    • Simplified layout and spacing for various project components, enhancing visual presentation.
  • Bug Fixes

    • Improved icon visibility in ProjectPublicActions based on user interaction.
  • Style

    • Updated height and spacing properties for ProjectHeader and other components for better alignment and aesthetics.
    • Modified margin and padding properties in multiple components to improve layout consistency.

Copy link

vercel bot commented Sep 24, 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 Oct 1, 2024 7:19pm

Copy link
Contributor

coderabbitai bot commented Sep 24, 2024

Walkthrough

The pull request introduces several modifications across multiple components in the codebase. Key changes include updates to styling properties such as text-transform, overflow-x, margin, and height in various styled components. Additionally, certain elements related to user interactions have been removed or simplified, impacting the rendering of links and icons. Overall, these changes focus on adjusting the visual layout and presentation of components without altering their core functionality.

Changes

File Path Change Summary
src/components/badges/ShareLikeBadge.tsx Modified text-transform in BadgeText to remove 'uppercase' transformation based on $fromDonate.
src/components/views/project/ProjectBadges.tsx Removed overflow-x, updated margin-bottom from -3px to 24px, and removed padding-top in CustomFlex.
src/components/views/project/ProjectHeader.tsx Increased height of ProjectImage and GradientOverlay from 380px to 430px.
src/components/views/project/ProjectIndex.tsx Added style prop to two Col components to set margin to 0.
src/components/views/project/projectActionCard/ProjectActionCard.tsx Removed Subline component and IconChevronRight16 from the Link, leaving it empty.
src/components/views/project/projectActionCard/ProjectPublicActions.tsx Specified color '#525f7f' for IconBookmark16 based on user reaction condition.
src/components/views/project/projectActionCard/QFSection.tsx Simplified gap in DonationSectionWrapper to a consistent '8px' and removed margin-bottom for Description.

Possibly related PRs

  • Main #4340: This PR includes changes to the lang/en.json file that involve updates to text descriptions and labels, which may relate to how badges are displayed or described in the UI.
  • merge main into develop #4342: Similar to Main #4340, this PR also updates text in lang/en.json, which could impact the display of badges or related components.
  • Add bookmark #4347: This PR modifies the ShareLikeBadge component, which is directly related to the changes made in the main PR regarding the ShareLikeBadge.tsx file.
  • Decentralized Verification Feedback: Badges Tooltips + Filters #4765: This PR enhances the ProjectBadges.tsx file by integrating tooltips for badges, which aligns with the changes made in the main PR that also affects badge display.
  • Fix/givbacks verification form #4769: This PR addresses issues related to the verification form for givbacks, which may indirectly relate to the display and functionality of badges in the context of project verification.

Suggested labels

Code Review

Suggested reviewers

  • mohammadranjbarz
  • kkatusic

Poem

🐇 In the garden where changes bloom,
Badges and headers find more room.
With colors bright and spaces wide,
A simpler path for all to glide.
Hooray for tweaks, both big and small,
Let’s hop along, we’ll cheer for all! 🌼


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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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: 2

Outside diff range and nitpick comments (2)
src/components/views/project/ProjectHeader.tsx (1)

Line range hint 80-94: Consider adjusting Title component positioning

With the increased height of ProjectImage and GradientOverlay, it might be beneficial to review the positioning of the Title component. Currently, it's positioned 40px from the bottom:

const Title = styled(H3)`
  position: absolute;
  bottom: 40px;
  left: 40px;
  // ... other styles
`;

Consider adjusting this value to maintain the desired visual balance within the taller header. For example, you might want to increase the bottom value to keep the title's relative position consistent with the previous design.

src/components/views/project/projectActionCard/ProjectPublicActions.tsx (1)

152-152: Approved: Color specification improves UI clarity

The addition of the color prop to IconBookmark16 enhances the visual distinction between bookmarked and non-bookmarked states, which aligns with the PR objective of fixing UI issues. This change improves the user interface by providing clearer visual feedback.

For better maintainability and consistency, consider using a color variable from your design system instead of a hard-coded hex value. For example:

-<IconBookmark16 color='#525f7f' />
+<IconBookmark16 color={semanticColors.neutral[500]} />

This assumes that semanticColors.neutral[500] corresponds to the desired shade. Adjust the specific color token as needed to match your design system.

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between bc9a866 and d0eaa92.

Files selected for processing (7)
  • src/components/badges/ShareLikeBadge.tsx (1 hunks)
  • src/components/views/project/ProjectBadges.tsx (1 hunks)
  • src/components/views/project/ProjectHeader.tsx (2 hunks)
  • src/components/views/project/ProjectIndex.tsx (2 hunks)
  • src/components/views/project/projectActionCard/ProjectActionCard.tsx (1 hunks)
  • src/components/views/project/projectActionCard/ProjectPublicActions.tsx (1 hunks)
  • src/components/views/project/projectActionCard/QFSection.tsx (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/components/views/project/ProjectIndex.tsx
Additional comments not posted (4)
src/components/views/project/projectActionCard/ProjectActionCard.tsx (1)

Line range hint 1-85: Verify alignment with PR objectives

The removal of the "Learn More" link functionality aligns with the PR objective of fixing UI issues. However, please ensure that this change specifically addresses one of the items (1, 2, 3, 4, or 6) mentioned in issue #4726.

To confirm that all intended changes have been implemented, please run the following script:

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

59-59: Approved: Increased ProjectImage height improves visual prominence

The change from 380px to 430px for the ProjectImage height enhances the visual impact of the project header. This aligns well with the PR objective of fixing UI issues and likely addresses one of the items (1, 2, or 3) from issue #4726.

The use of object-fit: cover ensures that the image will still fill the container appropriately, maintaining the aspect ratio while accommodating various image sizes.


68-68: Approved: GradientOverlay height adjusted for consistency

The increase in GradientOverlay height from 380px to 430px maintains consistency with the ProjectImage height change. This ensures that the gradient effect covers the entire image area, preserving the visual design intent.

This change is a necessary complement to the ProjectImage modification and contributes to the overall UI improvement targeted by this PR.

src/components/views/project/ProjectBadges.tsx (1)

97-97: Approved margin change, but concerns about other removals

The increase in margin-bottom from -3px to 24px is a good change that will provide better separation between this component and the next element.

However, I have some concerns:

  1. The removal of overflow-x: auto; might lead to layout issues if the badges overflow horizontally. Was this intentional?
  2. Removing padding-top: 24px; will reduce the space above the badges, potentially affecting their vertical alignment. What was the reasoning behind this change?

Could you provide more context about the specific UI issues from #4726 that these changes are addressing? This would help in understanding if the modifications fully resolve the intended fixes.

To verify the impact of these changes, please run the following script:

This script will help us understand the context in which ProjectBadges is used and if there are any width constraints or responsive design implementations that might be affected by the removal of overflow-x: auto;.

<IconChevronRight16 />
</LearnLink>
</Link>
<Link href={Routes.Onboarding + '/donors'}></Link>
Copy link
Contributor

@coderabbitai coderabbitai bot Sep 24, 2024

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove the empty Link component

The Link component on line 58 is empty and serves no purpose. This appears to be a remnant from the removal of the "Learn More" link functionality.

Consider removing this line entirely:

-<Link href={Routes.Onboarding + '/donors'}></Link>

If there's a specific reason to keep a link to the donors onboarding page, consider adding it elsewhere in the component with proper content and accessibility considerations.

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.

Suggested change
<Link href={Routes.Onboarding + '/donors'}></Link>

Copy link
Collaborator

Choose a reason for hiding this comment

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

@lovelgeorge99 can you check why this link is empty? thx

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes i removed the empty link on later commit.

@@ -138,7 +138,7 @@ const QFSection: FC<IQFSectionProps> = ({ projectData }) => {
);

return (
<DonationSectionWrapper gap={isOnDonatePage ? '8px' : '24px'}>
<DonationSectionWrapper gap={'8px'}>
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Codebase verification

Inconsistent gap values in DonationSectionWrapper

Multiple instances of DonationSectionWrapper use different gap values (24px, 16px, 8px) across the codebase:

  • src/components/views/project/projectActionCard/DonationSection.tsx uses gap='24px'
  • src/components/views/donate/DonatePageProjectDescription.tsx uses gap='16px'
  • src/components/views/project/projectActionCard/QFSection.tsx uses gap={'8px'}

This inconsistency may lead to uneven spacing in the UI. Additionally, the removal of margin-bottom for the Description component was not detected in the codebase.

Analysis chain

Simplified gap property in DonationSectionWrapper

The gap property in the DonationSectionWrapper component has been simplified from a conditional expression to a fixed value of '8px'. This change ensures consistent spacing across all use cases of the component.

While this change improves consistency, it's important to verify that it doesn't negatively impact the layout in scenarios where a different gap was previously applied. Please run the following script to check for any other occurrences of DonationSectionWrapper with different gap values:

Additionally, the AI summary mentions the removal of a margin-bottom for the Description component, which is not visible in the provided code. To verify this:

Please review the results of these searches to ensure that the changes don't introduce any unintended layout issues.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other occurrences of DonationSectionWrapper with gap prop
rg --type typescript --type tsx 'DonationSectionWrapper.*gap' src

Length of output: 102


Script:

#!/bin/bash
# Search for Description styled component with margin-bottom
rg --type typescript --type tsx 'const Description.*margin-bottom' src

Length of output: 107


Script:

#!/bin/bash
# Search for other occurrences of DonationSectionWrapper with gap prop
rg --type ts --type tsx 'DonationSectionWrapper.*gap' src

Length of output: 87


Script:

#!/bin/bash
# Search for Description styled component with margin-bottom
rg --type ts --type tsx 'const Description.*margin-bottom' src

Length of output: 92


Script:

#!/bin/bash
# Search for other occurrences of DonationSectionWrapper with gap prop in .ts and .tsx files
rg 'DonationSectionWrapper.*gap' --glob '*.ts' --glob '*.tsx' src

Length of output: 371


Script:

#!/bin/bash
# Search for Description styled component with margin-bottom in .ts and .tsx files
rg 'const Description.*margin-bottom' --glob '*.ts' --glob '*.tsx' src

Length of output: 72

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 @lovelgeorge99

Copy link
Collaborator

@MohammadPCh MohammadPCh left a comment

Choose a reason for hiding this comment

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

Thanks @lovelgeorge99 LGTM

@lovelgeorge99 lovelgeorge99 merged commit a3fc152 into develop Oct 1, 2024
3 checks passed
@lovelgeorge99 lovelgeorge99 deleted the fix-ui-issues#4726 branch October 1, 2024 19:38
@coderabbitai coderabbitai bot mentioned this pull request Oct 1, 2024
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