-
Notifications
You must be signed in to change notification settings - Fork 374
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 Hovering effect to social icons in Footer issue -#2388 #2416
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* Existing Footer Styles */ | ||
.footer { | ||
background-color: #2e2e2e; | ||
color: #fff; | ||
|
@@ -9,13 +10,11 @@ | |
.footer-top { | ||
display: flex; | ||
flex-direction: column; | ||
/* gap: 20px; */ | ||
align-items: center; | ||
} | ||
|
||
.footer-top .logo img { | ||
width: 80px; | ||
/* Adjusted size for better visibility */ | ||
} | ||
|
||
.footer-top .social-media { | ||
|
@@ -33,7 +32,6 @@ | |
|
||
.footer-top .social-icons a img { | ||
width: 30px; | ||
/* Adjusted size for consistency */ | ||
} | ||
|
||
.footer-top .contact-info, | ||
|
@@ -47,7 +45,6 @@ | |
align-items: center; | ||
justify-content: center; | ||
gap: 10px; | ||
/* Space between image and text */ | ||
margin: 5px 0; | ||
color: #fff; | ||
text-decoration: none; | ||
|
@@ -60,7 +57,6 @@ | |
|
||
.footer-top .address img { | ||
width: 24px; | ||
/* Adjusted size for better alignment */ | ||
height: 24px; | ||
} | ||
|
||
|
@@ -95,6 +91,28 @@ | |
text-decoration: underline; | ||
} | ||
|
||
/* Social Media Icon Hover Effects */ | ||
.footer-top .social-icons a { | ||
transition: transform 0.3s, filter 0.3s; | ||
} | ||
|
||
.footer-top .social-icons a:hover { | ||
transform: scale(1.1); | ||
} | ||
|
||
.footer-top .social-icons a:nth-child(1):hover img { | ||
filter: brightness(1.2) saturate(1.2); | ||
} | ||
|
||
.footer-top .social-icons a:nth-child(2):hover img { | ||
filter: brightness(1.2) saturate(1.2); | ||
} | ||
|
||
.footer-top .social-icons a:nth-child(6):hover img { | ||
filter: brightness(1.2) saturate(1.2); | ||
} | ||
Comment on lines
+103
to
+113
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification CSS selectors don't match the intended social icons The current implementation has issues with the nth-child selectors:
The hover effects won't work because:
🔗 Analysis chainVerify hover effects target the correct social icons. The current implementation uses nth-child selectors (1, 2, and 6), but it's unclear if these correspond to Instagram, Twitter, and Discord icons as mentioned in the PR objectives. Let's verify the icon order in the JSX file: Let me gather more information to see the complete social icons implementation: Let me check the complete social icons section to see all icons: Let me get the complete list of social icons to verify all entries: Let me get one final check to see if there are any more social icons: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Find and display the social icons implementation in Footer.jsx
rg -l "Footer" --type jsx | xargs rg -A 10 "social-icons"
Length of output: 3392 Script: #!/bin/bash
# Find all social icon links in Footer.jsx
rg -A 5 "social-icons" src/User/components/Footer/Footer.jsx
Length of output: 324 Script: #!/bin/bash
# Get more context around social icons section
rg -B 2 -A 20 "social-icons" src/User/components/Footer/Footer.jsx
Length of output: 951 Script: #!/bin/bash
# Get the complete social icons section including all icon entries
rg -B 2 -A 40 "social-icons" src/User/components/Footer/Footer.jsx
Length of output: 1663 Script: #!/bin/bash
# Get an even larger context to ensure we see all social icons
rg -B 2 -A 60 "social-icons" src/User/components/Footer/Footer.jsx
Length of output: 2347 |
||
|
||
/* Responsive Styles */ | ||
@media (min-width: 768px) { | ||
.footer-top { | ||
flex-direction: row; | ||
|
@@ -123,4 +141,4 @@ | |
text-align: right; | ||
justify-content: flex-end; | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -135,6 +135,9 @@ const Home = () => { | |
const [suggestions, setSuggestions] = useState([]); | ||
const navigate = useNavigate(); | ||
|
||
const [isSubscribed, setIsSubscribed] = useState(false); | ||
const [email, setEmail] = useState(""); | ||
|
||
const handleSearch = (e) => { | ||
const term = e.target.value; | ||
setSearchTerm(term); | ||
|
@@ -160,6 +163,17 @@ const Home = () => { | |
sectionRef.current.scrollIntoView({ behavior: "smooth" }); | ||
}; | ||
|
||
|
||
const handleSubscribe = (e) => { | ||
e.preventDefault(); | ||
setIsSubscribed(true); // Show the success message | ||
setTimeout(() => { | ||
setIsSubscribed(false); // Hide the message | ||
setEmail(""); // Clear the email input | ||
}, 3000); // 3 seconds | ||
}; | ||
|
||
Comment on lines
+167
to
+175
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add proper form validation and error handling. The current implementation has several potential issues:
Consider implementing this improved version: -const handleSubscribe = (e) => {
+const handleSubscribe = async (e) => {
e.preventDefault();
+ if (!email || !email.match(/^[^\s@]+@[^\s@]+\.[^\s@]+$/)) {
+ // Show error message
+ return;
+ }
+ try {
+ // Add loading state if needed
+ // await subscribeUser(email);
setIsSubscribed(true);
- setTimeout(() => {
- setIsSubscribed(false);
- setEmail("");
- }, 3000);
+ setEmail("");
+ // Reset subscription state after delay, but only if still subscribed
+ const timeoutId = setTimeout(() => {
+ setIsSubscribed((current) => current ? false : current);
+ }, 3000);
+ // Clean up timeout if component unmounts
+ return () => clearTimeout(timeoutId);
+ } catch (error) {
+ // Handle error appropriately
+ console.error('Subscription failed:', error);
+ }
};
|
||
|
||
return ( | ||
<div className="bg-[#fff0e3ff]"> | ||
<main className=""> | ||
|
@@ -218,12 +232,14 @@ const Home = () => { | |
</h2> | ||
<div className="grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-3 sm:gap-4 md:gap-6"> | ||
{popularCategories.map((category, index) => ( | ||
<div key={index} className="custom-shadow"> | ||
<CategoryCard | ||
key={index} | ||
name={category.name} | ||
image={category.image} | ||
path={category.path} | ||
/> | ||
</div> | ||
Comment on lines
+235
to
+242
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix duplicate key prop and verify layout impact.
Apply this fix: -<div key={index} className="custom-shadow">
-<CategoryCard
- key={index}
- name={category.name}
- image={category.image}
- path={category.path}
-/>
-</div>
+<CategoryCard
+ key={index}
+ className="custom-shadow"
+ name={category.name}
+ image={category.image}
+ path={category.path}
+/> Please verify that this change doesn't break the shadow effect. If CategoryCard doesn't accept a className prop, you'll need to modify it to support this.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. take a look of code rabbit review and fix it There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @codervivek5, glad to see that you're addressing the feedback. Please let me know if you need any further assistance. 🐰😊 |
||
))} | ||
</div> | ||
</div> | ||
|
@@ -248,6 +264,13 @@ const Home = () => { | |
</div> | ||
</div> | ||
</section> | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
{/* App Download Section */} | ||
<section | ||
className="py-8 sm:py-12 md:py-16 relative mb-[-1px]" | ||
|
@@ -286,20 +309,19 @@ const Home = () => { | |
Subscribe to our newsletter to receive exclusive updates, | ||
promotions, and tips. | ||
</p> | ||
<form> | ||
<form onSubmit={handleSubscribe}> | ||
<input | ||
type="email" | ||
placeholder="Enter your email address" | ||
value={email} | ||
onChange={(e) => setEmail(e.target.value)} | ||
style={{ | ||
color: "black", | ||
width: "100%", | ||
borderRadius: "10px", | ||
padding: "10px", | ||
marginBottom: "10px", | ||
border: "1px solid #ccc", | ||
"@media (maxWidth: 780px)": { | ||
width: "80%", | ||
}, | ||
}} | ||
/> | ||
<button | ||
|
@@ -313,8 +335,13 @@ const Home = () => { | |
cursor: "pointer", | ||
}}> | ||
Subscribe | ||
</button>{" "} | ||
</button> | ||
</form> | ||
{isSubscribed && ( | ||
<div className="popup-message"> | ||
<p>Subscribed successfully!</p> | ||
</div> | ||
)} | ||
</div> | ||
</section> | ||
</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.
🛠️ Refactor suggestion
Refactor hover effects to use more maintainable selectors.
The current implementation has several issues:
nth-child
selectors makes the code fragile if icon order changesConsider using this more maintainable approach:
📝 Committable suggestion