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

Added Review Us Page #536

Open
wants to merge 121 commits into
base: main
Choose a base branch
from
Open

Conversation

komal-agarwal5
Copy link

@komal-agarwal5 komal-agarwal5 commented Jul 21, 2024

Description

  • I have designed and added a review us page
  • Using this page the user can convey their view point to the devs for any improvement,suggestions or other problems
  • Design theme is like that of paws
  • Form contains required details
  • Design is mobile responsive also

Related Issue

#487

Screenshots / GIFs (if applicable)

Screenshot 2024-07-21 230952

Checklist:

  • I have performed a self-review of my code
  • I have added/updated relevant documentation (if needed)
  • I have tested the changes locally and they function as expected
  • I have ensured my code follows the project's coding standards

Additional Notes

[Add any additional notes or context about the changes made]

Summary by CodeRabbit

  • New Features

    • Introduced a dedicated "Review" page for user feedback accessible via the new /review route.
    • Enhanced the navigation bar with a new option to access the "Review" page.
    • Added a new component for collecting user reviews, featuring a form for name, email, and review text.
  • User Experience Improvements

    • Implemented form validation to ensure all fields are completed before submission.

suhanipaliwal and others added 30 commits May 11, 2024 20:27
removed unnecessary commented part.
…ModuleFile

[FIX] - Module.css files removed and Tailwind CSS applied.
Added Nearest NGO Info in Success Page
uniyall and others added 20 commits July 5, 2024 17:19
* added a happy recovery story page

* updated

* original Navbar.jsx
	modified:   src/pages/user/ReportIncidentPages/FeedbackForm/Feedback.jsx
	modified:   src/App.jsx
* Updated Error Page.

* new
Copy link

coderabbitai bot commented Jul 21, 2024

Walkthrough

The changes significantly enhance the application's routing by adding a dedicated review page and improving user navigation. A new Reviewus component is introduced for collecting user feedback, while the Navbar is updated to include direct access to this feature. Additionally, a simple Review component lays the groundwork for future enhancements. Overall, these updates improve user engagement by providing a clear platform for reviews.

Changes

Files Change Summary
src/App.jsx, src/Components/shared/Navbar.jsx, src/pages/shared/Reviewus/Reviewus.jsx Introduced a new route (/review) and navigation option for user reviews. Added Reviewus component to manage feedback collection styled with Tailwind CSS.
src/Components/shared/Review.jsx Added a basic Review component serving as a template for future review functionalities.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Navbar
    participant App
    participant Reviewus

    User->>Navbar: Clicks "Review"
    Navbar->>App: Navigate to /review
    App->>Reviewus: Render Reviewus component
    Reviewus->>User: Display review form
Loading

🐇 In a world of reviews, we now take a leap,
To hear your thoughts, your joy, or your weep.
With a simple new route, so easy to find,
We welcome your feedback, so sweet and so kind.
Come share your story, let your voice sprout,
In our cozy corner, we want to hear out! ✨


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>.
    • 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 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

@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, codebase verification and nitpick comments (2)
src/pages/shared/Reviewus/Reviewus.jsx (2)

21-86: Improve accessibility and user experience.

Ensure that all form elements have associated labels and consider adding ARIA attributes for better accessibility.

-                  <label htmlFor="name" className="text-[#40025D] font-bold">
+                  <label htmlFor="name" className="text-[#40025D] font-bold" aria-label="Name">
-                  <label htmlFor="email" className="text-[#40025D] font-bold">
+                  <label htmlFor="email" className="text-[#40025D] font-bold" aria-label="Email">
-                  <label htmlFor="review" className="text-[#40025D] font-bold">
+                  <label htmlFor="review" className="text-[#40025D] font-bold" aria-label="Review">

1-5: Remove unused import.

The axios import in src/pages/shared/Reviewus/Reviewus.jsx is not used and should be removed to clean up the code.

  • src/pages/shared/Reviewus/Reviewus.jsx: Remove the unused axios import.
Analysis chain

Ensure all imports are necessary.

Verify that all imported modules are used in the code. Currently, axios is imported but not utilized.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of imported modules.

# Test: Search for the usage of `axios`. Expect: No occurrences.
rg --type js --word-regex '\baxios\b'

Length of output: 483


Script:

#!/bin/bash
# Description: Verify the usage of imported modules.

# Test: Search for the usage of `axios`. Expect: No occurrences.
rg --type js --word-regexp '\baxios\b'

Length of output: 3201


Script:

#!/bin/bash
# Description: Verify the usage of `axios` in the Reviewus.jsx file.

# Test: Search for the usage of `axios` in the specific file.
rg --word-regexp '\baxios\b' src/pages/shared/Reviewus/Reviewus.jsx

Length of output: 96

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between aeec142 and 297c245.

Files selected for processing (4)
  • src/App.jsx (2 hunks)
  • src/Components/shared/Navbar.jsx (3 hunks)
  • src/Components/shared/Review.jsx (1 hunks)
  • src/pages/shared/Reviewus/Reviewus.jsx (1 hunks)
Files skipped from review due to trivial changes (1)
  • src/Components/shared/Review.jsx
Additional comments not posted (6)
src/Components/shared/Navbar.jsx (4)

Line range hint 1-5:
Ensure all imports are necessary.

Verify that all imported modules are used in the code. Currently, all imported modules seem to be utilized.


54-54: LGTM!

The addition of the review navigation option is correctly implemented for general users.


62-62: LGTM!

The addition of the review navigation option is correctly implemented for NGO users.


75-75: LGTM!

The addition of the review navigation option is correctly implemented for unauthenticated users.

src/App.jsx (2)

28-28: LGTM!

The import statement for Reviewus is correctly added.


64-64: LGTM!

The new route for the review page is correctly integrated into the routing structure.

Comment on lines 21 to 86
return (
<>
<Background />
{!isLoading && (
<>
<div className="flex flex-col items-center font-breeSerif justify-center gap-6 mb-20 w-full px-4 md:px-0">
<h1 className="text-center mt-10 pb-1 z-3 text-[#40025D] font-extrabold tracking-widest text-3xl sm:text-4xl drop-shadow-xl flex flex-col">
<span className="mb-1">Review Us</span>
<span>Drop in your review!</span>
</h1>
<div className="mt-[-15px] pb-1 z-3 text-[#40025D] font-bold tracking-widest text-lg sm:text-xl drop-shadow-xl flex flex-col w-full max-w-lg">
<form action="" method="POST">
{/* add formspree link linked with your mail here to get the responses */}
<div className="flex flex-col gap-4">
<label htmlFor="name" className="text-[#40025D] font-bold">
Name
</label>
<input
type="text"
name="name"
id="name"
className="p-2 border-2 border-[#40025D] rounded-lg w-full"
placeholder="Your name"
/>
<label htmlFor="email" className="text-[#40025D] font-bold">
Email
</label>
<input
type="email"
name="email"
id="email"
className="p-2 border-2 border-[#40025D] rounded-lg w-full"
placeholder="Your email"
/>
<label htmlFor="review" className="text-[#40025D] font-bold">
Review
</label>
<textarea
name="review"
id="review"
className="p-2 border-2 border-[#40025D] rounded-lg h-32 w-full"
placeholder="Write your review here"
/>
</div>
<button className="border-2 mt-6 bg-cyan-800 p-2 text-white w-full sm:w-80 mx-auto">
Submit
</button>
</form>
</div>
</div>
</>
)}
{isLoading && (
<>
<div className="flex flex-col gap-[15px] justify-center items-center my-[45px]">
<Skeleton width="calc(100vw - 40px)" height={150} />
<Skeleton width="calc(100vw - 60px)" height={120} />
<Skeleton width="calc(100vw - 60px)" height={120} />
<Skeleton width="calc(100vw - 60px)" height={120} />
<Skeleton width="calc(100vw - 60px)" height={120} />
<Skeleton width="calc(100vw - 60px)" height={120} />
</div>
</>
)}
</>
);
Copy link

Choose a reason for hiding this comment

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

Ensure proper form handling and validation.

The form lacks action and method attributes, and there is no form validation. Consider adding form validation and specifying the form action and method.

-              <form action="" method="POST">
+              <form action="your_formspree_link" method="POST">
+                {/* Add form validation logic here */}

Committable suggestion was skipped due to low confidence.

Comment on lines 7 to 19
const Reviewus = () => {
const [isLoading, setIsLoading] = useState(true);
useEffect(() => {
const fetchData = async () => {
try {
const url = import.meta.env.VITE_BACKEND_URL;
setIsLoading(false);
} catch (error) {
console.error("Error fetching data:", error);
}
};
fetchData();
}, []);
Copy link

Choose a reason for hiding this comment

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

Consider handling loading state more effectively.

The loading state is set to false immediately after setting the URL, which might not be the intended behavior. Consider setting the loading state after the data is fetched.

-        setIsLoading(false);
+        // Assuming data fetching logic here
+        // setIsLoading(false) should be called after data is fetched

Committable suggestion was skipped due to low confidence.

Copy link

@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, codebase verification and nitpick comments (2)
src/pages/shared/Reviewus/Reviewus.jsx (2)

1-2: Remove unused imports.

The useState and useEffect hooks are imported but not used in the component. Remove these unused imports to clean up the code.

- import React, { useState, useEffect } from "react";
+ import React from "react";

21-27: Add accessibility attributes to form elements.

Ensure that all form elements have necessary accessibility attributes such as aria-label or aria-required.

- <input
+ <input
+  aria-label="Name"
+  aria-required="true"
- <input
+ <input
+  aria-label="Email"
+  aria-required="true"
- <textarea
+ <textarea
+  aria-label="Review"
+  aria-required="true"

Also applies to: 31-37, 41-46

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 297c245 and d7e345d.

Files selected for processing (1)
  • src/pages/shared/Reviewus/Reviewus.jsx (1 hunks)
Additional comments not posted (1)
src/pages/shared/Reviewus/Reviewus.jsx (1)

58-58: LGTM!

The export statement is correct.

src/pages/shared/Reviewus/Reviewus.jsx Outdated Show resolved Hide resolved
src/pages/shared/Reviewus/Reviewus.jsx Outdated Show resolved Hide resolved
Copy link

@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

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between d7e345d and 9cdf7f8.

Files selected for processing (2)
  • src/App.jsx (2 hunks)
  • src/pages/shared/Reviewus/Reviewus.jsx (1 hunks)
Files skipped from review as they are similar to previous changes (2)
  • src/App.jsx
  • src/pages/shared/Reviewus/Reviewus.jsx

@komal-agarwal5
Copy link
Author

@itsekta
@codewarnab
Can u pls merge this pr for gssoc?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.