Skip to content

Commit

Permalink
feat: added socials icons to about section in navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiaaali committed Nov 24, 2024
1 parent 8248cdf commit b5ea2bc
Show file tree
Hide file tree
Showing 5 changed files with 796 additions and 125 deletions.
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions src/components/Navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,25 @@
padding: 0; /* Remove padding for tighter layout */
text-align: right;
}

.about-section {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%; /* Adjust this value based on your needs */
}

.social-icons {
display: flex;
gap: 1rem;
margin-left: auto; /* This pushes the social icons to the right */
}

.social-icon {
color: inherit;
text-decoration: none;
}

.social-icon:hover {
opacity: 0.8;
}
33 changes: 29 additions & 4 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React, { useState } from 'react';
import { Link } from 'react-router-dom';
import './Navbar.css'; // Import the CSS file for styling
import { FaSpotify, FaInstagram, FaTwitter } from 'react-icons/fa';
import './Navbar.css';

const Navbar: React.FC = () => {
// State to track the active navbar item
const [activeIndex, setActiveIndex] = useState<number | null>(null);

// Handle click to set the active item
const handleItemClick = (index: number): void => {
setActiveIndex(index);
};
Expand Down Expand Up @@ -44,12 +43,38 @@ const Navbar: React.FC = () => {
</li>

<li
className={`home-link ${activeIndex === 3 ? 'active' : ''}`}
className={`home-link about-section ${activeIndex === 3 ? 'active' : ''}`}
onClick={() => handleItemClick(3)}
>
<Link to="/about">
<div className="left-text">ABOUT</div>
</Link>
<div className="social-icons">
<a
href="https://twitter.com/bsrlive"
target="_blank"
rel="noopener noreferrer"
className="social-icon"
>
<FaTwitter size={20} />
</a>
<a
href="https://www.instagram.com/bsrlive/"
target="_blank"
rel="noopener noreferrer"
className="social-icon"
>
<FaInstagram size={20} />
</a>
<a
href="https://open.spotify.com/user/ndis7o6g0u1oq2xvgww7itbvt?si=h8RtzXcKRPeMLna5J2CewA"
target="_blank"
rel="noopener noreferrer"
className="social-icon"
>
<FaSpotify size={20} />
</a>
</div>
</li>
</ul>
</nav>
Expand Down
22 changes: 22 additions & 0 deletions src/pages/About.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,25 @@
flex: 1 1 100%; /* One per row on smaller screens */
}
}

.about-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}

.social-icons {
display: flex;
gap: 15px;
}

.social-icon {
color: #000;
transition: opacity 0.2s ease;
text-decoration: none;
}

.social-icon:hover {
opacity: 0.7;
}
Loading

0 comments on commit b5ea2bc

Please sign in to comment.