-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
Login/signup responsive #366
Login/signup responsive #366
Conversation
Someone is attempting to deploy a commit to the bunty's projects Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe pull request introduces several modifications across multiple components in the frontend. Key changes include the addition of client-side rendering directives, enhancements to user experience through loading states and error handling in the login component, and various styling adjustments across components like Signup and Navbar. The Navbar component also sees changes in state management and the addition of new menu items. Overall, the changes are primarily focused on improving user interaction, styling consistency, and maintaining existing functionalities. Changes
Possibly related PRs
Suggested labels
Suggested reviewers
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 (
|
Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our CONTRIBUTING.md. If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊 |
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: 0
🧹 Outside diff range and nitpick comments (8)
frontend/src/components/Pages/Login.jsx (4)
Line range hint
41-48
: Enhanced error handling and loading state managementThe updates to
handleSubmit
function significantly improve error handling and user feedback. The use of try-catch-finally block ensures that the loading state is properly managed regardless of the outcome.Consider adding a more specific error message for network-related issues:
} catch (err) { setError(err.message || (err.name === 'TypeError' ? 'Network error. Please check your connection.' : 'An error occurred. Please try again.')); }
66-67
: Enhanced form styling and input usabilityThe updates to form and input styling improve visual consistency and usability. The increased input height and consistent styling across elements enhance the overall user experience, aligning well with the PR objectives.
Consider adding
aria-label
attributes to the input fields for improved accessibility:<input className="w-full h-12 rounded-md border-2 border-black bg-beige shadow-[4px_4px_0px_0px_black] text-[15px] font-semibold text-[#323232] p-2.5 focus:outline-none focus:border-[#2d8cf0] placeholder-[#666]" name="email" placeholder="Email" type="email" onChange={handleChange} + aria-label="Email" />
Also applies to: 77-81, 86-90
Line range hint
93-101
: Improved password visibility toggle stylingThe updated styling for the password visibility toggle button enhances visual consistency with the rest of the form while maintaining the existing functionality.
Consider adding an
aria-label
to the button for improved accessibility:<button className="absolute top-1/2 transform -translate-y-1/2 right-4" onClick={(e) => { e.preventDefault(); setHidden(!hidden); }} + aria-label={hidden ? "Show password" : "Hide password"} > {hidden ? <FaEyeSlash /> : <FaEye />} </button>
132-139
: Enhanced error handling and submit button feedbackThe addition of error message display and loading state for the submit button greatly improves user feedback during the login process. These changes align well with the PR's objective of enhancing user experience.
Consider adding an
aria-live
attribute to the error message for better accessibility:- {error && <p className="text-red-500 mt-2">{error}</p>} + {error && <p className="text-red-500 mt-2" aria-live="polite">{error}</p>}This ensures that screen readers announce the error message when it appears.
frontend/src/components/Pages/Signup.jsx (2)
83-90
: LGTM: Improved responsive layout.The changes to the container and image layout significantly enhance the component's responsiveness, aligning well with the PR objectives. The use of Tailwind classes and absolute positioning for the image ensures a consistent look across different screen sizes.
One suggestion for improvement:
Consider adding an
aria-hidden="true"
attribute to the background image to improve accessibility, as it's decorative and not essential for screen readers.<img src={photo} alt="login" loading="lazy" className="w-3/4 absolute inset-0" + aria-hidden="true" />
Line range hint
91-155
: LGTM: Enhanced form styling and responsiveness.The styling changes to form inputs, buttons, and text elements significantly improve the component's responsiveness and visual consistency. The use of Tailwind's responsive classes ensures a smooth transition between mobile and desktop layouts, aligning perfectly with the PR objectives.
Suggestion for improvement:
Consider adding
aria-label
attributes to the input fields to enhance accessibility. For example:<input className="input w-full h-10 rounded-md border-2 border-black bg-beige p-2.5 shadow-[4px_4px_0px_0px_black] focus:outline-none" name="name" placeholder="Name" type="text" onChange={handleChange} + aria-label="Enter your name" />
Apply similar
aria-label
attributes to email and password inputs as well.frontend/src/components/Shared/Navbar.jsx (2)
Line range hint
25-27
: Add dependency array to useEffect hook.The current implementation of the useEffect hook for setting the token state will run on every render, which may lead to unnecessary re-renders and potential performance issues.
Consider adding an empty dependency array to ensure the effect only runs once on component mount:
useEffect(() => { setToken(Cookies.get('authToken')); -}); +}, []);If you intend to update the token when it changes in cookies, consider using the
Cookies.get('authToken')
as a dependency:useEffect(() => { setToken(Cookies.get('authToken')); -}); +}, [Cookies.get('authToken')]);
Line range hint
46-52
: Approve logout process improvements and suggest code cleanup.The changes to the
handleLogout
function provide a more comprehensive logout process, including token removal, UI state updates, and navigation to the login page.Consider removing the commented-out
setisloggedIn(false)
line for code cleanliness:const handleLogout = () => { - // setisloggedIn(false); // Set isLoggedIn to false on confirmation //managing log in , logout using jwt tokens Cookies.remove('authToken'); setToken(null); setIsModalOpen(false); // Close the modal setIsMenuOpen(false); // after getting logged out close the menu if it is open navigate('/login'); //navigate to login after get logged out };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (5)
- frontend/src/components/Pages/About.jsx (1 hunks)
- frontend/src/components/Pages/Login.jsx (4 hunks)
- frontend/src/components/Pages/Signup.jsx (4 hunks)
- frontend/src/components/Shared/Navbar.jsx (2 hunks)
- frontend/src/components/ui/Landing.jsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
- frontend/src/components/Pages/About.jsx
🧰 Additional context used
🔇 Additional comments (15)
frontend/src/components/ui/Landing.jsx (1)
42-42
: Approved: Responsive font size adjustmentThe change from
text-6xl
totext-5xl
for the main heading on smaller screens aligns well with the PR objective of improving responsiveness. This adjustment should enhance readability on mobile devices while maintaining the existing layout for larger screens (as themd:text-9xl
class is unchanged). Good job on making this subtle yet effective improvement.frontend/src/components/Pages/Login.jsx (4)
16-17
: Improved user feedback with loading and error statesThe addition of
isLoading
anderror
state variables enhances the user experience by providing feedback during the login process and handling errors more effectively. This aligns well with the PR's objective of improving responsiveness and user interaction.
56-63
: Improved responsive layout and visual designThe adjustments to the form layout and the addition of a responsive background image enhance the overall visual appeal and responsiveness of the login page. The use of Tailwind classes for responsive design is effective and aligns well with the PR's objective of improving the page's responsiveness across different screen sizes.
103-108
: Enhanced "Forgot Password?" link stylingThe updated styling for the "Forgot Password?" link improves readability and visual consistency. The added hover effect enhances user interaction, contributing to a better overall user experience.
122-130
: Improved Google sign-in button consistencyThe updates to the Google sign-in button styling enhance visual consistency with other form elements. The adjusted height and styling create a more cohesive look, improving the overall user interface.
frontend/src/components/Pages/Signup.jsx (7)
3-3
: LGTM: Import statement consolidation.The consolidation of imports from 'react-router-dom' improves code readability and follows best practices.
6-6
: LGTM: Improved comment clarity.The updated comment for the zxcvbn import provides a clearer description of its purpose.
13-14
: LGTM: Concise state declarations.The reformatted state declarations for
passwordStrength
anddata
are more concise and align with modern React practices.
21-21
: LGTM: Improved readability in handleChange.Moving
setPasswordStrength
to its own line enhances code readability without affecting functionality.
51-51
: LGTM: Concise fetch headers.Consolidating the headers in the fetch request improves code conciseness without compromising readability or functionality.
156-163
: LGTM: Consistent button styling.The styling changes to the Google sign-up and main submit buttons maintain consistency with the overall form design. The use of Tailwind classes ensures responsiveness and a cohesive look across different screen sizes, aligning well with the PR objectives.
Line range hint
1-174
: Overall assessment: Excellent improvements to responsiveness and design consistency.The changes in this file significantly enhance the signup component's responsiveness and visual consistency across different screen sizes. The modifications align perfectly with the PR objectives of improving the mobile experience while maintaining the desktop layout.
Key improvements:
- Responsive layout adjustments using Tailwind classes.
- Consistent styling of form elements and buttons.
- Improved code readability and organization.
Minor suggestions were made to enhance accessibility, but overall, this is a well-executed update to the signup component.
frontend/src/components/Shared/Navbar.jsx (3)
110-110
: LGTM: Enhanced hover effect for desktop menu button.The addition of the
hover:bg-lime-200
class to the desktop menu button improves the visual feedback for user interactions, enhancing the overall user experience.
Line range hint
1-238
: Overall changes align well with PR objectives.The modifications to the Navbar component successfully address the PR objectives:
- The addition of the 'MEMBERSHIP' menu item enhances the navigation options.
- The refined logout process and consistent use of token-based authentication improve the user experience and security.
- The styling changes, including the hover effect on the desktop menu button, contribute to better responsiveness and visual feedback.
These changes maintain the existing layout for web and desktop views while potentially improving the mobile experience. Good job on addressing the responsiveness requirements!
To ensure the responsive design works as intended, please provide screenshots of the navbar on various screen sizes (mobile, tablet, and desktop) to visually confirm the layout adjustments.
23-23
: LGTM: New 'MEMBERSHIP' menu item added.The addition of the 'MEMBERSHIP' menu item aligns with the PR objectives. The path '/membership' is consistent with the naming convention of other menu items.
Please ensure that the '/membership' route is properly implemented and accessible. You can verify this by running the following script:
✅ Verification successful
Verified: '/membership' route is correctly implemented.
The '/membership' route is properly defined in
frontend/src/components/Shared/Navbar.jsx
at line 23.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the existence of the '/membership' route in the router configuration. # Test: Search for the '/membership' route definition rg -i "path.*['\"]\/membership['\"]" --type jsLength of output: 155
Script:
#!/bin/bash # Description: Verify the existence of the '/membership' route in the router configuration. # Test: Search for the '/membership' route definition rg -i 'path\s*:\s*["'\''"]/membership["'\''"]' --type jsLength of output: 172
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
solved for the issue no #330
Changes Made:
-Adjusted CSS styles to ensure components fit properly on smaller screens.
-Refactored form structure to align inputs and buttons responsively.
login page responsive..
signup page responsive
Summary by CodeRabbit
Release Notes
New Features
Improvements
Bug Fixes