-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Adding Custom Modal in Menu Page #321
Conversation
WalkthroughThe changes in this pull request primarily involve updates to the 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! 😊 |
@github-actions[bot] is attempting to deploy a commit to the bunty's projects Team on Vercel. A member of the Team first needs to authorize it. |
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 (1)
README.md (1)
201-202
: Replace hard tabs with spaces for consistency.The static analysis tool detected hard tabs in the HTML table structure for the contributors list. To ensure consistent rendering across different platforms, please replace these hard tabs with spaces.
This can be easily fixed with most text editors or IDEs. Here's an example of how to replace tabs with spaces:
- </tr> - <tr> + </tr> + <tr>Apply this change to lines 201-202, 289-290, and 333-334.
Also applies to: 289-290, 333-334
🧰 Tools
🪛 Markdownlint
201-201: Column: 1
Hard tabs(MD010, no-hard-tabs)
202-202: Column: 1
Hard tabs(MD010, no-hard-tabs)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
- README.md (8 hunks)
🧰 Additional context used
🪛 Markdownlint
README.md
201-201: Column: 1
Hard tabs(MD010, no-hard-tabs)
202-202: Column: 1
Hard tabs(MD010, no-hard-tabs)
289-289: Column: 1
Hard tabs(MD010, no-hard-tabs)
290-290: Column: 1
Hard tabs(MD010, no-hard-tabs)
333-333: Column: 1
Hard tabs(MD010, no-hard-tabs)
334-334: Column: 1
Hard tabs(MD010, no-hard-tabs)
🔇 Additional comments (5)
README.md (5)
188-191
: LGTM: Contributor information updated correctly.The GitHub link and avatar for Ashwini_ab have been updated accurately.
218-221
: LGTM: Contributor information updated correctly.The GitHub link and avatar for Vishnu Prasad Korada have been updated accurately.
232-235
: LGTM: Contributor information updated correctly.The GitHub link and avatar for Mahera Nayan have been updated accurately.
364-367
: LGTM: New contributor added correctly.The addition of dev129 as a contributor is formatted correctly and aligns with the PR objectives.
Line range hint
1-367
: Verify: Changes don't align with PR objectives.The changes in this file are limited to updates in the contributors list, which don't align with the stated PR objectives of "Adding Custom Modal in Menu Page". There are no changes related to adding a custom modal or enhancing user engagement as described in the PR summary.
Please clarify:
- Are there other files in this PR that contain the changes related to the custom modal?
- If not, should the PR objectives and summary be updated to reflect the actual changes made?
To verify the existence of changes related to the custom modal, you can run the following script:
This script will help identify any files or code changes related to the custom modal implementation.
🧰 Tools
🪛 Markdownlint
333-333: Column: 1
Hard tabs(MD010, no-hard-tabs)
334-334: Column: 1
Hard tabs(MD010, no-hard-tabs)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@dev129 you didn't do anything in this PR just update readme.md which is not required |
No wait I actually did it , lemme just check once again |
This contains the code for incentive offers the component file is added in ui folder alongwith the the updation of splidejs as the dependency
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: 4
🧹 Outside diff range and nitpick comments (5)
frontend/src/components/Pages/Menu.jsx (1)
78-79
: Consider moving inline style to a CSS classThe inline style
style={{ paddingBottom: '80px' }}
on theTodaysSpecial
wrapper div could be moved to a CSS class for better maintainability and separation of concerns.Consider replacing the inline style with a CSS class:
-<div className="w-full md:flex md:items-center md:justify-center" style={{ paddingBottom: '80px' }}> +<div className="w-full md:flex md:items-center md:justify-center pb-20">Then add the following to your CSS file:
.pb-20 { padding-bottom: 80px; }frontend/src/components/ui/IncentiveOffers.jsx (2)
1-6
: Consider renaming the component to match the file name.The component is named
ImageModal
, but the file is namedIncentiveOffers.jsx
. To improve clarity and maintainability, it's recommended to rename the component toIncentiveOffers
or adjust the file name to match the component name.
17-25
: OptimizeformatTime
function.The
formatTime
function can be slightly optimized by using template literals. This change would make the code more concise and potentially more readable.Consider refactoring the
formatTime
function as follows:const formatTime = (time) => { const minutes = Math.floor(time / 60); const seconds = time % 60; return `${minutes}:${seconds.toString().padStart(2, '0')}`; };frontend/src/components/Pages/Signup.jsx (2)
Line range hint
24-30
: Broken functionality: Password strength calculation in handleChangeThe
handleChange
function still attempts to use thezxcvbn
function to calculate password strength, butzxcvbn
is no longer imported. This will cause a runtime error when the password field is changed.To fix this, either:
- Restore the
zxcvbn
import and keep the current functionality, or- Remove the password strength calculation logic. Here's how you can do that:
const handleChange = (e) => { setData({ ...data, [e.target.name]: e.target.value }); - if (e.target.name === 'password') { - const result = zxcvbn(e.target.value); - setPasswordStrength(result.score); // Update password strength score - } };Make sure to also remove or update any UI elements that depend on the
passwordStrength
state if you choose option 2.
I'm sorry, but I can't provide internal monologue or hidden reasoning. However, I can help you address the review comment based on the information you've provided.
Non-functional UI: Password Strength Meter
The password strength meter UI elements are still present, but they won't function correctly without the
zxcvbn
library and the related logic inhandleChange
.Issue Found:
- The
zxcvbn
import is commented out:// import zxcvbn from 'zxcvbn'; // Import zxcvbn for password strength check
- The
passwordStrength
state and related functions (getPasswordStrengthColor
,getPasswordStrengthText
) are still present, but without the activezxcvbn
integration, the password strength meter won't update based on user input.Recommended Actions:
Restore
zxcvbn
Integration:
- Uncomment the
zxcvbn
import.- Ensure that the
handleChange
function properly utilizeszxcvbn
to updatepasswordStrength
.- // import zxcvbn from 'zxcvbn'; // Import zxcvbn for password strength check + import zxcvbn from 'zxcvbn'; // Import zxcvbn for password strength checkRemove Password Strength Meter UI:
- If you decide not to use
zxcvbn
, remove the password strength meter UI elements to prevent confusion.- {/* Password Strength Meter */} - <div className="w-full mt-2"> - <div - className="h-2 rounded-full" - style={{ - backgroundColor: getPasswordStrengthColor(passwordStrength), - width: `${(passwordStrength + 1) * 20}%`, - }} - ></div> - <p className="text-sm text-[#666] mt-1"> - Strength: {getPasswordStrengthText(passwordStrength)} - </p> - </div>
- Additionally, remove the
getPasswordStrengthColor
andgetPasswordStrengthText
functions if you choose to remove the password strength meter.Category:
🔗 Analysis chain
Line range hint
134-146
: Non-functional UI: Password strength meterThe password strength meter UI elements are still present, but they won't function correctly without the
zxcvbn
library and the related logic inhandleChange
.To address this, either:
- Restore the
zxcvbn
import and related logic to keep the password strength meter functional, or- Remove the password strength meter UI elements. Here's how you can do that:
- {/* Password Strength Meter */} - <div className="w-full mt-2"> - <div - className="h-2 rounded-full" - style={{ - backgroundColor: getPasswordStrengthColor(passwordStrength), - width: `${(passwordStrength + 1) * 20}%`, - }} - ></div> - <p className="text-sm text-[#666] mt-1"> - Strength: {getPasswordStrengthText(passwordStrength)} - </p> - </div>Also, remember to remove the
getPasswordStrengthColor
andgetPasswordStrengthText
functions if you choose to remove the password strength meter.To confirm the presence of password strength-related functions, run:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for password strength-related functions rg 'getPasswordStrength(Color|Text)' frontend/src/components/Pages/Signup.jsxLength of output: 604
📜 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 (4)
- frontend/src/components/Pages/Menu.jsx (4 hunks)
- frontend/src/components/Pages/Signup.jsx (1 hunks)
- frontend/src/components/ui/IncentiveOffers.jsx (1 hunks)
- package.json (1 hunks)
🧰 Additional context used
🔇 Additional comments (8)
frontend/src/components/Pages/Menu.jsx (6)
1-8
: LGTM: Import statements updated correctlyThe changes to the import statements are consistent with the modifications made to the component. The removal of
MainHOC
and addition ofIncentiveOffers
align well with the new functionality introduced in this update.
22-23
: LGTM: Modal state management implemented correctlyThe addition of the
isModalOpen
state variable and the correspondingopenModal
andcloseModal
functions is a clean implementation for managing the modal's visibility. This approach follows React best practices for state management.Also applies to: 38-40
67-67
: LGTM: Image click handler added for modal interactionThe addition of the
onClick
event handler to themotion.img
element, calling theopenModal
function, provides a clear and intuitive way for users to interact with the new modal functionality.
82-84
: LGTM: Modal implementation, but clarify image usageThe
IncentiveOffers
component is correctly implemented with the necessary props for controlling its visibility. However, I noticed that the same image (Cafe3dImg
) is used both in the main view and inside the modal. Is this intentional, or should the modal display a different image?
89-89
: LGTM: Export statement simplifiedThe change in the export statement, removing the
MainHOC
wrapper and directly exportingParallaxImage
, is consistent with the import changes and simplifies the component structure.
Line range hint
1-89
: Overall: Good implementation of modal functionality, aligns with PR objectivesThe changes in this file successfully introduce the custom modal functionality as described in the PR objectives. The implementation enhances user engagement by allowing users to interact with the parallax image to open the modal. The code is generally well-structured and follows React best practices.
Key points:
- The modal state management is implemented correctly.
- The
IncentiveOffers
component is integrated properly.- The export statement has been simplified, improving maintainability.
Minor suggestions for improvement:
- Consider moving inline styles to CSS classes for better maintainability.
- Clarify the intentional use of the same image in both the main view and the modal.
These changes effectively address the PR's goal of introducing a custom modal to capture customer attention and improve the overall user experience on the menu page.
frontend/src/components/ui/IncentiveOffers.jsx (1)
1-95
: Overall implementation aligns well with PR objectives.The
IncentiveOffers
component successfully implements the custom modal as described in the PR objectives. Key features include:
- Attractive design with a prominent image and promotional content
- Animated opening and closing behavior using framer-motion
- Responsive design using Tailwind CSS
- Countdown timer to create urgency
- Clear call-to-action buttons
The component enhances user engagement and aligns with the goal of improving the overall user experience. Consider addressing the minor suggestions in previous comments to further improve the code quality and accessibility.
frontend/src/components/Pages/Signup.jsx (1)
Line range hint
1-214
: Summary: Inconsistent changes to password strength featureThe changes made to this component have introduced inconsistencies that will break its functionality. The main issue is the commented-out import of the
zxcvbn
library, while the rest of the component still relies on it for password strength estimation.To resolve these issues, clarification is needed on the intended changes:
If the goal was to remove the password strength feature:
- Remove the
zxcvbn
import- Remove the password strength calculation in
handleChange
- Remove the password strength meter UI elements
- Remove the
getPasswordStrengthColor
andgetPasswordStrengthText
functionsIf the password strength feature should be kept:
- Restore the
zxcvbn
importPlease clarify the intended changes so that the component can be updated consistently.
To get an overview of all
zxcvbn
-related code in the component, run:#!/bin/bash # Search for all zxcvbn-related code rg 'zxcvbn|passwordStrength|getPasswordStrength' frontend/src/components/Pages/Signup.jsx
{ | ||
"dependencies": { | ||
"@splidejs/react-splide": "^0.7.12" | ||
} | ||
} |
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.
💡 Codebase verification
Incomplete package.json
detected: Missing essential dependencies
The current package.json
only includes @splidejs/react-splide
as a dependency. A standard React project typically requires additional dependencies such as react
and react-dom
.
- Missing Dependencies:
react
react-dom
Please ensure that all necessary dependencies are listed to maintain project functionality.
🔗 Analysis chain
Clarify the purpose of adding @splidejs/react-splide and review package.json completeness
The addition of the Splide library for React is noted, but it raises a few concerns:
-
The PR objectives mention adding a custom modal, but don't reference any slider or carousel functionality. Could you clarify how Splide relates to the custom modal implementation or if there are additional features not mentioned in the PR description?
-
This package.json file appears to be incomplete. A typical React project would have many more dependencies. Are there other dependencies that should be listed here? If this is a partial view of the file, please provide the complete package.json for a more thorough review.
-
If this is indeed the complete package.json, there might be missing critical dependencies for a React project (such as react, react-dom, etc.). Please ensure all necessary dependencies are properly listed.
To help verify the completeness of the package.json file, please run the following command in the project root and provide the output:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for the existence and content of package.json file
if [ -f package.json ]; then
echo "package.json exists. Content:"
cat package.json
else
echo "package.json does not exist in the current directory."
fi
Length of output: 181
const [modal, setModal] = useState(true); | ||
const [countdown, setCountdown] = useState(300); // 5 minutes in seconds | ||
|
||
useEffect(() => { | ||
const timer = setInterval(() => { | ||
setCountdown(prevCount => prevCount > 0 ? prevCount - 1 : 0); | ||
}, 1000); | ||
return () => clearInterval(timer); | ||
}, []); |
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.
🛠️ Refactor suggestion
Add cleanup effect for modal state.
The modal is set to be open by default (useState(true)
). Consider adding a cleanup effect to ensure the modal is closed when the component unmounts. This can prevent potential issues if the component is unmounted while the modal is open.
You can add this effect:
useEffect(() => {
return () => setModal(false);
}, []);
return ( | ||
<AnimatePresence> | ||
{modal && ( | ||
<motion.div | ||
initial={{ opacity: 0 }} | ||
animate={{ opacity: 1 }} | ||
exit={{ opacity: 0 }} | ||
className="modal fixed inset-0 flex items-center justify-center bg-black bg-opacity-70 z-50 p-4" | ||
> | ||
<motion.div | ||
initial={{ scale: 0.8, y: 50 }} | ||
animate={{ scale: 1, y: 0 }} | ||
exit={{ scale: 0.8, y: 50 }} | ||
className="modal-content bg-[#f5f5dc] rounded-lg shadow-2xl w-full max-w-[600px] overflow-hidden" | ||
> | ||
<div className="relative"> | ||
<img | ||
src="https://images.unsplash.com/photo-1509042239860-f550ce710b93?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1374&q=80" | ||
alt="Delicious Coffee" | ||
className="w-full h-48 object-cover" | ||
/> | ||
<button | ||
className="absolute top-2 right-2 text-white hover:text-[#f5f5dc] transition-colors duration-300 bg-[#4a3728] rounded-full p-1" | ||
onClick={toggleModal} | ||
> | ||
<AiOutlineClose size={24} /> | ||
</button> | ||
</div> | ||
<div className="p-6 bg-[#d9c49a]"> | ||
<h2 className="text-2xl font-bold text-[#4a3728] mb-2">Exclusive Coffee Lover's Offer!</h2> | ||
<p className="text-lg text-[#2c1f1a] mb-4">Indulge in premium brews & save big!</p> | ||
<ul className="list-none space-y-2 text-[#4a3728] mb-4"> | ||
<li className="flex items-center"><FaCoffee className="mr-2" /> 50% off your first month's subscription</li> | ||
<li className="flex items-center"><FaGift className="mr-2" /> Free artisan coffee mug with sign-up</li> | ||
<li className="flex items-center"><FaCoffee className="mr-2" /> Access to exclusive limited edition blends</li> | ||
</ul> | ||
<div className="flex items-center justify-between mb-4"> | ||
<p className="text-lg font-semibold text-[#4a3728]">Hurry! Offer ends in:</p> | ||
<div className="text-2xl font-bold text-[#8b4513]">{formatTime(countdown)}</div> | ||
</div> | ||
<div className="flex justify-between gap-4"> | ||
<button | ||
className="flex-1 bg-[#f5f5dc] text-[#4a3728] px-4 py-2 rounded-full shadow-md hover:bg-[#e6e6c4] transition-colors duration-300 font-semibold" | ||
onClick={toggleModal} | ||
> | ||
No Thanks | ||
</button> | ||
<motion.button | ||
whileHover={{ scale: 1.05 }} | ||
whileTap={{ scale: 0.95 }} | ||
className="flex-1 bg-[#8b4513] text-white px-4 py-2 rounded-full shadow-md hover:bg-[#693610] transition-colors duration-300 font-semibold" | ||
onClick={() => { | ||
// Handle subscription logic here | ||
console.log("User subscribed!"); | ||
toggleModal(); | ||
}} | ||
> | ||
Take Me There! | ||
</motion.button> | ||
</div> | ||
</div> | ||
</motion.div> | ||
</motion.div> |
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.
Enhance accessibility of the close button.
The close button currently lacks an accessible name, which can make it difficult for screen reader users to understand its purpose.
To improve accessibility, add an aria-label
to the close button:
<button
className="absolute top-2 right-2 text-white hover:text-[#f5f5dc] transition-colors duration-300 bg-[#4a3728] rounded-full p-1"
onClick={toggleModal}
+ aria-label="Close modal"
>
<AiOutlineClose size={24} />
</button>
📝 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.
return ( | |
<AnimatePresence> | |
{modal && ( | |
<motion.div | |
initial={{ opacity: 0 }} | |
animate={{ opacity: 1 }} | |
exit={{ opacity: 0 }} | |
className="modal fixed inset-0 flex items-center justify-center bg-black bg-opacity-70 z-50 p-4" | |
> | |
<motion.div | |
initial={{ scale: 0.8, y: 50 }} | |
animate={{ scale: 1, y: 0 }} | |
exit={{ scale: 0.8, y: 50 }} | |
className="modal-content bg-[#f5f5dc] rounded-lg shadow-2xl w-full max-w-[600px] overflow-hidden" | |
> | |
<div className="relative"> | |
<img | |
src="https://images.unsplash.com/photo-1509042239860-f550ce710b93?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1374&q=80" | |
alt="Delicious Coffee" | |
className="w-full h-48 object-cover" | |
/> | |
<button | |
className="absolute top-2 right-2 text-white hover:text-[#f5f5dc] transition-colors duration-300 bg-[#4a3728] rounded-full p-1" | |
onClick={toggleModal} | |
> | |
<AiOutlineClose size={24} /> | |
</button> | |
</div> | |
<div className="p-6 bg-[#d9c49a]"> | |
<h2 className="text-2xl font-bold text-[#4a3728] mb-2">Exclusive Coffee Lover's Offer!</h2> | |
<p className="text-lg text-[#2c1f1a] mb-4">Indulge in premium brews & save big!</p> | |
<ul className="list-none space-y-2 text-[#4a3728] mb-4"> | |
<li className="flex items-center"><FaCoffee className="mr-2" /> 50% off your first month's subscription</li> | |
<li className="flex items-center"><FaGift className="mr-2" /> Free artisan coffee mug with sign-up</li> | |
<li className="flex items-center"><FaCoffee className="mr-2" /> Access to exclusive limited edition blends</li> | |
</ul> | |
<div className="flex items-center justify-between mb-4"> | |
<p className="text-lg font-semibold text-[#4a3728]">Hurry! Offer ends in:</p> | |
<div className="text-2xl font-bold text-[#8b4513]">{formatTime(countdown)}</div> | |
</div> | |
<div className="flex justify-between gap-4"> | |
<button | |
className="flex-1 bg-[#f5f5dc] text-[#4a3728] px-4 py-2 rounded-full shadow-md hover:bg-[#e6e6c4] transition-colors duration-300 font-semibold" | |
onClick={toggleModal} | |
> | |
No Thanks | |
</button> | |
<motion.button | |
whileHover={{ scale: 1.05 }} | |
whileTap={{ scale: 0.95 }} | |
className="flex-1 bg-[#8b4513] text-white px-4 py-2 rounded-full shadow-md hover:bg-[#693610] transition-colors duration-300 font-semibold" | |
onClick={() => { | |
// Handle subscription logic here | |
console.log("User subscribed!"); | |
toggleModal(); | |
}} | |
> | |
Take Me There! | |
</motion.button> | |
</div> | |
</div> | |
</motion.div> | |
</motion.div> | |
return ( | |
<AnimatePresence> | |
{modal && ( | |
<motion.div | |
initial={{ opacity: 0 }} | |
animate={{ opacity: 1 }} | |
exit={{ opacity: 0 }} | |
className="modal fixed inset-0 flex items-center justify-center bg-black bg-opacity-70 z-50 p-4" | |
> | |
<motion.div | |
initial={{ scale: 0.8, y: 50 }} | |
animate={{ scale: 1, y: 0 }} | |
exit={{ scale: 0.8, y: 50 }} | |
className="modal-content bg-[#f5f5dc] rounded-lg shadow-2xl w-full max-w-[600px] overflow-hidden" | |
> | |
<div className="relative"> | |
<img | |
src="https://images.unsplash.com/photo-1509042239860-f550ce710b93?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1374&q=80" | |
alt="Delicious Coffee" | |
className="w-full h-48 object-cover" | |
/> | |
<button | |
className="absolute top-2 right-2 text-white hover:text-[#f5f5dc] transition-colors duration-300 bg-[#4a3728] rounded-full p-1" | |
onClick={toggleModal} | |
aria-label="Close modal" | |
> | |
<AiOutlineClose size={24} /> | |
</button> | |
</div> | |
<div className="p-6 bg-[#d9c49a]"> | |
<h2 className="text-2xl font-bold text-[#4a3728] mb-2">Exclusive Coffee Lover's Offer!</h2> | |
<p className="text-lg text-[#2c1f1a] mb-4">Indulge in premium brews & save big!</p> | |
<ul className="list-none space-y-2 text-[#4a3728] mb-4"> | |
<li className="flex items-center"><FaCoffee className="mr-2" /> 50% off your first month's subscription</li> | |
<li className="flex items-center"><FaGift className="mr-2" /> Free artisan coffee mug with sign-up</li> | |
<li className="flex items-center"><FaCoffee className="mr-2" /> Access to exclusive limited edition blends</li> | |
</ul> | |
<div className="flex items-center justify-between mb-4"> | |
<p className="text-lg font-semibold text-[#4a3728]">Hurry! Offer ends in:</p> | |
<div className="text-2xl font-bold text-[#8b4513]">{formatTime(countdown)}</div> | |
</div> | |
<div className="flex justify-between gap-4"> | |
<button | |
className="flex-1 bg-[#f5f5dc] text-[#4a3728] px-4 py-2 rounded-full shadow-md hover:bg-[#e6e6c4] transition-colors duration-300 font-semibold" | |
onClick={toggleModal} | |
> | |
No Thanks | |
</button> | |
<motion.button | |
whileHover={{ scale: 1.05 }} | |
whileTap={{ scale: 0.95 }} | |
className="flex-1 bg-[#8b4513] text-white px-4 py-2 rounded-full shadow-md hover:bg-[#693610] transition-colors duration-300 font-semibold" | |
onClick={() => { | |
// Handle subscription logic here | |
console.log("User subscribed!"); | |
toggleModal(); | |
}} | |
> | |
Take Me There! | |
</motion.button> | |
</div> | |
</div> | |
</motion.div> | |
</motion.div> |
@@ -4,7 +4,7 @@ import { useNavigate } from 'react-router-dom'; | |||
import { Link } from 'react-router-dom'; | |||
import { FaEye } from 'react-icons/fa'; | |||
import { FaEyeSlash } from 'react-icons/fa6'; | |||
import zxcvbn from 'zxcvbn'; // Import zxcvbn for password strength check | |||
// import zxcvbn from 'zxcvbn'; // Import zxcvbn for password strength check |
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.
💡 Codebase verification
Issue: zxcvbn
is used but not imported
The zxcvbn
library is utilized in the component (const result = zxcvbn(e.target.value);
), but its import statement is commented out. This will cause runtime errors when users interact with the password field.
To resolve this, you should either:
- Restore the import by uncommenting the line:
import zxcvbn from 'zxcvbn';
- Remove all usages of
zxcvbn
and the related password strength functionality if the intention is to eliminate this feature.
🔗 Analysis chain
Inconsistency: zxcvbn import commented out but still used in component
The import of the zxcvbn
library has been commented out, but the component still relies on this library for password strength estimation. This will cause runtime errors when users interact with the password field.
To resolve this, either:
- Restore the import by uncommenting the line:
import zxcvbn from 'zxcvbn';
- Or, if the intention is to remove the password strength feature, update the component to remove all usage of
zxcvbn
and the related password strength UI elements.
To confirm the usage of zxcvbn
in the component, run:
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for zxcvbn usage in the component
rg 'zxcvbn' frontend/src/components/Pages/Signup.jsx
Length of output: 174
just a test
@dev129 you make 361 files for a single issue i can't aprove it |
Wait what ? |
This PR has been automatically closed due to inactivity from the owner for 3 days. |
PR Title: Add Custom Modal to Menu Page for Enhanced User Engagement ( #196 )
Description:
This PR addresses issue #196 by introducing a custom modal to the menu page, aimed at capturing customer attention and enhancing their experience on the website. By utilizing framer-motion, the modal provides a visually appealing and interactive invitation for users to engage with our offerings.
Key Features:
Changes Included:
Impact:
This feature is designed to draw users' attention to the menu page, encouraging them to explore our offerings and potentially increasing user engagement and conversions.
Please review the changes and provide any feedback or suggestions for improvement!
Summary by CodeRabbit
Documentation
New Features
IncentiveOffers
, displaying exclusive offers with a countdown timer.Bug Fixes
Chores