-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89e8405
commit 543861b
Showing
5 changed files
with
150 additions
and
6 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* src/App.css */ | ||
.fixed { | ||
position: fixed; | ||
z-index: 999; /* Ensure the sidebar is above other elements */ | ||
} | ||
|
||
.sidebar { | ||
background-color: white; /* Adjust the background color */ | ||
} | ||
|
||
.sidebar button { | ||
background-color: transparent; /* Customize the close button */ | ||
border: none; | ||
cursor: pointer; | ||
} | ||
|
||
.sidebar h2 { | ||
margin-bottom: 20px; /* Spacing below the heading */ | ||
} | ||
|
||
.sidebar a { | ||
text-decoration: none; /* Remove underline from links */ | ||
color: #333; /* Default link color */ | ||
transition: color 0.3s; /* Smooth color transition */ | ||
} | ||
|
||
.sidebar a:hover { | ||
color: #007BFF; /* Color change on hover */ | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// src/components/SocialSidebar.js | ||
import React, { useState } from 'react'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { faFacebookF, faTwitter, faInstagram, faLinkedinIn } from '@fortawesome/free-brands-svg-icons'; | ||
import { faTimes, faArrowRight } from '@fortawesome/free-solid-svg-icons'; | ||
|
||
const SocialSidebar = () => { | ||
const [isOpen, setIsOpen] = useState(true); // State to manage sidebar visibility | ||
|
||
const toggleSidebar = () => { | ||
setIsOpen(!isOpen); // Toggle the sidebar's visibility | ||
}; | ||
|
||
return ( | ||
<> | ||
{isOpen ? ( | ||
<div className="fixed top-1/2 left-0 transform -translate-y-1/2 bg-white shadow-lg p-4 z-50"> | ||
<button | ||
onClick={toggleSidebar} | ||
className="absolute top-[-10px] right-[-8px] bg-green-500 rounded-full w-5 h-5 flex items-center justify-center" | ||
> | ||
<FontAwesomeIcon icon={faTimes} size="lg" /> | ||
</button> | ||
<div className="flex flex-col items-center space-y-4"> | ||
<a href="https://facebook.com" target="_blank" rel="noopener noreferrer" className="flex items-center hover:text-green-700 transition-colors duration-300"> | ||
<FontAwesomeIcon icon={faFacebookF} size="lg" /> | ||
</a> | ||
<a href="https://twitter.com" target="_blank" rel="noopener noreferrer" className="flex items-center hover:text-green-700 transition-colors duration-300"> | ||
<FontAwesomeIcon icon={faTwitter} size="lg" /> | ||
</a> | ||
<a href="https://instagram.com" target="_blank" rel="noopener noreferrer" className="flex items-center hover:text-green-700 transition-colors duration-300"> | ||
<FontAwesomeIcon icon={faInstagram} size="lg" /> | ||
</a> | ||
<a href="https://linkedin.com" target="_blank" rel="noopener noreferrer" className="flex items-center hover:text-green-700 transition-colors duration-300"> | ||
<FontAwesomeIcon icon={faLinkedinIn} size="lg" /> | ||
</a> | ||
</div> | ||
</div> | ||
) : ( | ||
<button | ||
onClick={toggleSidebar} | ||
className="fixed top-1/2 left-0 transform -translate-y-1/2 bg-white shadow-lg p-2 z-50" | ||
> | ||
<FontAwesomeIcon icon={faArrowRight} size="lg" /> | ||
</button> | ||
)} | ||
</> | ||
); | ||
}; | ||
|
||
export default SocialSidebar; |