Skip to content

Commit

Permalink
Reused the Navigation menu for footer.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramin Farhadi authored and Ramin Farhadi committed Jun 13, 2024
1 parent 7e09f0b commit 6576ccf
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 17 deletions.
Binary file removed public/img/social-icons/facebook-white.png
Binary file not shown.
Binary file removed public/img/social-icons/instagram-white.png
Binary file not shown.
Binary file removed public/img/social-icons/linkedin-white.png
Binary file not shown.
1 change: 1 addition & 0 deletions public/img/social-icons/social-links-gray.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed public/img/social-icons/social-white.png
Binary file not shown.
Binary file removed public/img/social-icons/x-white.png
Binary file not shown.
Binary file removed public/img/social-icons/youtube-white.png
Binary file not shown.
65 changes: 65 additions & 0 deletions src/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,68 @@
}
}
}

.ucf-footer-social-link {
background-image: url(../img/social-icons/social-links-gray.svg);
background-repeat: no-repeat;
background-size: 240px 66px;
display: none;
height: 33px;
margin: 0 4px;
overflow: hidden;
width: 34px
}

.ucf-footer-social-link[href*=facebook] {
background-position: 0 0;
display: block
}

.ucf-footer-social-link[href*=facebook]:active,.ucf-footer-social-link[href*=facebook]:focus,.ucf-footer-social-link[href*=facebook]:hover {
background-position: 0 100%
}

.ucf-footer-social-link[href*=twitter] {
background-position: -34px 0;
display: block
}

.ucf-footer-social-link[href*=twitter]:active,.ucf-footer-social-link[href*=twitter]:focus,.ucf-footer-social-link[href*=twitter]:hover {
background-position: -34px 100%
}

.ucf-footer-social-link[href*=youtube] {
background-position: -172px 0;
display: block
}

.ucf-footer-social-link[href*=youtube]:active,.ucf-footer-social-link[href*=youtube]:focus,.ucf-footer-social-link[href*=youtube]:hover {
background-position: -172px 100%
}

.ucf-footer-social-link[href*="ucf.edu/social"] {
background-position: -69px 0;
display: block
}

.ucf-footer-social-link[href*="ucf.edu/social"]:active,.ucf-footer-social-link[href*="ucf.edu/social"]:focus,.ucf-footer-social-link[href*="ucf.edu/social"]:hover {
background-position: -69px 100%
}

.ucf-footer-social-link[href*=linkedin] {
background-position: -138px 0;
display: block
}

.ucf-footer-social-link[href*=linkedin]:active,.ucf-footer-social-link[href*=linkedin]:focus,.ucf-footer-social-link[href*=linkedin]:hover {
background-position: -138px 100%
}

.ucf-footer-social-link[href*=instagram] {
background-position: -206px 0;
display: block
}

.ucf-footer-social-link[href*=instagram]:active,.ucf-footer-social-link[href*=instagram]:focus,.ucf-footer-social-link[href*=instagram]:hover {
background-position: -206px 100%
}
12 changes: 9 additions & 3 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ import { Visibility } from './types/Visibility';

// Data Imports
import campusData from './assets/campuses.json';
import SocialMedia from './components/SocialMedia';

const TOKEN = import.meta.env.VITE_MAPBOX_TOKEN;
const FOOTER_MENU_ID = import.meta.env.VITE_REMOTE_FOOTER_MENU_ID;
const FOOTER_SOCIAL_ID = import.meta.env.VITE_REMOTE_SOCIAL_LINKS_ID;

function App() {
const initialLng = -81.200142;
Expand Down Expand Up @@ -726,9 +726,15 @@ function App() {
</div>

<div className='h3 mb-3 mt-0 my-md-0'><a href='#copyright' className='text-white text-decoration-none'>&#65088;</a></div>
<NavigationMenu
listClasses='ucf-footer-social mb-2 list-unstyled list-group list-group-horizontal d-flex justify-content-center'
listItemClasses='ucf-footer-social-item ms-1'
anchorClasses="ucf-footer-social-link"
menuId='social-links'
remoteMenuId={FOOTER_SOCIAL_ID}
/>
<div className='ucf-footer-nav'>
<SocialMedia />


<NavigationMenu
listItemClasses='nav-item my-2'
anchorClasses='nav-link text-white py-0'
Expand Down
4 changes: 2 additions & 2 deletions src/components/NavigationMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function NavigationMenu(props: NavigationMenuProps) {
setLinks(response.items);
});
}, []);

console.log(links);
return (
<ul id={menuId} className={listClasses}>
{links.map((link: RestMenuItem) => {
Expand All @@ -40,7 +40,7 @@ export default function NavigationMenu(props: NavigationMenuProps) {
<a
className={anchorClasses}
href={link.url}>
{parse(link.title)}
{ menuId !== 'social-links' && parse(link.title) }
</a>
</li>
);
Expand Down
12 changes: 0 additions & 12 deletions src/components/SocialMedia.tsx

This file was deleted.

1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ interface ImportMetaEnv {
readonly VITE_REMOTE_MENU_BASE_URL: string
readonly VITE_REMOTE_HEADER_MENU_ID: number
readonly VITE_REMOTE_FOOTER_MENU_ID: number
readonly VITE_REMOTE_SOCIAL_LINKS_ID: number
}

interface ImportMeta {
Expand Down

0 comments on commit 6576ccf

Please sign in to comment.