Giveth / giveth-dapps-v2

This project is the aggregation of GIVeconomy and Giveth.io DApps in a single repo
https://staging.giveth.io
GNU General Public License v3.0
54 stars 32 forks source link

Add bookmark #4347

Closed MohammadPCh closed 5 days ago

MohammadPCh commented 5 days ago

Summary by CodeRabbit

vercel[bot] commented 5 days ago

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 Jun 26, 2024 9:49am
coderabbitai[bot] commented 5 days ago

Walkthrough

Overall changes focus on replacing the "liked projects" feature with "bookmarked projects" and involve updating labels, GraphQL queries, and components accordingly. This transition affects the user interface by modifying icons, labels, and functionality related to project interactions, such as bookmarking instead of liking. Additionally, there are updates to the package dependencies and minor adjustments to project action components, aligning the application more consistently with the new bookmarking functionality.

Changes

File/Directory Summary of Changes
lang/ca.json, lang/en.json, lang/es.json Added label for "Bookmarked Projects", removed "Liked Projects", adjusted sharing options
package.json Updated @giveth/ui-design-system from 1.11.31 to 1.11.33
src/apollo/gql/gqlHomePage.ts, src/apollo/gql/gqlProjects.ts, src/apollo/types/types.ts Removed totalReactions field from queries and IProject interface
src/components/DonateSocialBox.tsx, src/components/badges/ShareLikeBadge.tsx Removed type prop logic, updated badge display to always share
src/components/project-card/ProjectCard.tsx, .../ProjectCardBadgeButtons.tsx Renamed and updated badge buttons, removed like/unlike functionality
src/components/views/project/projectActionCard/ProjectPublicActions.tsx Swapped heart icons for bookmark icons, updated like to bookmark actions
src/components/views/projects/sort/ProjectsSortSelect.tsx Removed MOST_LIKED sorting option and icon
src/components/views/userProfile/ProfileContributes.tsx Updated label to "Bookmarked Projects"
src/components/views/userProfile/projectsTab/ProfileProjectsTab.tsx, .../ProjectItem.tsx Removed changeOrder function and heart icon import
src/components/views/verification/projectContact/ProjectContactIndex.tsx Removed type='share' prop from ShareLikeBadge
src/features/user/user.slice.ts Removed incrementLikedProjectsCount and decrementLikedProjectsCount functions
src/lib/reaction.ts Renamed likeProject to bookmarkProject, unlikeProject to unBookmarkProject

Poem

In code we trust, a shift we make,
From hearts to bookmarks, a change we take.
Reactions gone, new stories told,
Bookmarked projects, new and bold.
Bugs we've banished, features new,
🎉 Here's to updates, and to you!

— 🐰 A Rabbit Dev


Recent review details **Configuration used: CodeRabbit UI** **Review profile: CHILL**
Commits Files that changed from the base of the PR and between 884743d1c51f7b4c25e322dff4563f263fd289fc and efd01d263e3baf5a9f8663b377384143e35e87ee.
Files ignored due to path filters (1) * `yarn.lock` is excluded by `!**/yarn.lock`, `!**/*.lock`
Files selected for processing (19) * lang/ca.json (3 hunks) * lang/en.json (3 hunks) * lang/es.json (3 hunks) * package.json (1 hunks) * src/apollo/gql/gqlHomePage.ts (1 hunks) * src/apollo/gql/gqlProjects.ts (5 hunks) * src/apollo/types/types.ts (1 hunks) * src/components/DonateSocialBox.tsx (1 hunks) * src/components/badges/ShareLikeBadge.tsx (1 hunks) * src/components/project-card/ProjectCard.tsx (1 hunks) * src/components/project-card/ProjectCardBadgeButtons.tsx (4 hunks) * src/components/views/project/projectActionCard/ProjectPublicActions.tsx (6 hunks) * src/components/views/projects/sort/ProjectsSortSelect.tsx (2 hunks) * src/components/views/userProfile/ProfileContributes.tsx (1 hunks) * src/components/views/userProfile/projectsTab/ProfileProjectsTab.tsx (1 hunks) * src/components/views/userProfile/projectsTab/ProjectItem.tsx (2 hunks) * src/components/views/verification/projectContact/ProjectContactIndex.tsx (1 hunks) * src/features/user/user.slice.ts (2 hunks) * src/lib/reaction.ts (2 hunks)
Files not reviewed due to errors (1) * src/components/project-card/ProjectCardBadgeButtons.tsx (no review received)
Files skipped from review due to trivial changes (7) * lang/ca.json * lang/es.json * package.json * src/apollo/gql/gqlProjects.ts * src/components/views/projects/sort/ProjectsSortSelect.tsx * src/components/views/userProfile/ProfileContributes.tsx * src/features/user/user.slice.ts
Additional comments not posted (14)
src/components/badges/ShareLikeBadge.tsx (1)
`18-33`: **Simplified Badge Component Review.** The refactoring of `ShareLikeBadge` to always display a share icon and label is in line with the PR's objectives. The prop destructuring and conditional rendering logic are correctly implemented.
src/apollo/gql/gqlHomePage.ts (1)
Line range hint `1-46`: **GraphQL Query Review for Homepage Data.** The GraphQL query `FETCH_HOMEPAGE_DATA` appears to be correctly updated, removing all instances of `totalReactions`. This aligns well with the PR's goal of removing reaction-related fields.
src/components/DonateSocialBox.tsx (1)
Line range hint `1-50`: **Review of DonateSocialBox Component Integration.** The `DonateSocialBox` component integrates the updated `ShareLikeBadge` correctly. It handles modal visibility and provides links for learning more about donating, which are appropriate given the context.
src/components/views/userProfile/projectsTab/ProfileProjectsTab.tsx (2)
Line range hint `1-1`: **Ensure proper import ordering and grouping.** Imports should be grouped and ordered: external libraries, internal modules, styles, and types. This enhances readability and maintainability. --- Line range hint `22-22`: **Consider using a more descriptive variable name.** The variable `itemPerPage` could be renamed to `itemsPerPage` to better reflect that it represents multiple items.
src/components/views/userProfile/projectsTab/ProjectItem.tsx (2)
`1-1`: **Ensure consistent import ordering.** Imports should be grouped and ordered: external libraries, internal modules, styles, and types. This enhances readability and maintainability. --- Line range hint `22-22`: **Consider adding type annotations for state hooks.** For state hooks like `useState`, adding type annotations can improve type safety and code readability.
src/components/views/verification/projectContact/ProjectContactIndex.tsx (2)
Line range hint `1-1`: **Optimize import statements.** Imports should be grouped and ordered: external libraries, internal modules, styles, and types. This enhances readability and maintainability. --- Line range hint `20-20`: **Use a more descriptive variable name for `BtnContainer`.** The name `BtnContainer` is too generic. Consider renaming it to `ButtonContainer` for better readability and maintainability.
src/apollo/types/types.ts (1)
Line range hint `1-1`: **Review import statements for consistency.** Ensure that all necessary types are imported and used correctly throughout the file to maintain type safety and consistency.
src/components/project-card/ProjectCard.tsx (2)
`22-22`: **Updated import path reflects component renaming.** The import path change from `ProjectCardLikeAndShareButtons` to `ProjectCardBadgeButtons` aligns with the PR's goal of transitioning from "like" functionality to "bookmark". This is consistent with the renaming of the component to better reflect its new functionality. --- Line range hint `22-329`: **Comprehensive Component Review: `ProjectCard`.** The `ProjectCard` component appears well-structured and follows best practices for React functional components. It utilizes hooks effectively for state management and routing, and styled-components for dynamic styling based on props and state. 1. **State Management and Hooks:** The use of `useState` and `useRouter` is appropriate for handling component state and routing. The component's state management logic, particularly for handling hover states and modal visibility, is clear and concise. 2. **Conditional Rendering:** The component uses conditional rendering effectively to manage different UI states based on the project's verification status and whether the round has started. 3. **Internationalization and Styling:** The use of `react-intl` for internationalization ensures that the component can support multiple languages. The styled-components are used effectively to adjust styles based on the component's state and props. Overall, the component is well-implemented with attention to performance, maintainability, and user experience.
lang/en.json (2)
`206-206`: **Addition of "label.bookmarked_projects" is appropriate.** The addition of the key "label.bookmarked_projects" with the value "Bookmarked Projects" aligns with the PR objectives to transition from "liked" projects to "bookmarked" projects. The key and value are correctly formatted and follow the consistent naming convention used throughout the file. --- `873-873`: **Reordering of "label.share_on_linkedin" is handled correctly.** The key "label.share_on_linkedin" has been moved to appear before "label.share_on_farcaster", aligning with the PR objectives to adjust the position of sharing options. This change is correctly implemented and reflects a potential change in UI priorities.
--- 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 - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `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 show all the console.log statements in this repository.` - `@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 as 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. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.