-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add Site Footer #17
Merged
Merged
Add Site Footer #17
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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,40 @@ | ||
import { gql } from '@apollo/client' | ||
import clsx from 'clsx' | ||
import Link from 'next/link' | ||
import * as React from 'react' | ||
|
||
import styles from '@/styles/footer-navigation.module.css'; | ||
|
||
export function FooterNavigation({ navigation }) { | ||
return ( | ||
<> | ||
{navigation.map((item) => ( | ||
<Link | ||
className={clsx( | ||
styles.socialIconLink, | ||
'gap-4', | ||
)} | ||
href={item.href} | ||
key={item.id} | ||
target={item.target}> | ||
{item.label} | ||
</Link> | ||
))} | ||
</> | ||
) | ||
} | ||
|
||
FooterNavigation.fragment = gql` | ||
fragment FooterNavigationFragment on RootQuery { | ||
footerMenuItems: menuItems(first: 100, where: { location: FOOTER }) { | ||
nodes { | ||
id | ||
label | ||
title: label | ||
href: uri | ||
parentId | ||
target | ||
} | ||
} | ||
} | ||
` |
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
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 |
---|---|---|
@@ -1,15 +1,19 @@ | ||
import clsx from 'clsx' | ||
import { Container } from '@/components/Container' | ||
import { FooterNavigation } from '@/components/FooterNavigation' | ||
|
||
export function SiteFooter({ navigation }) { | ||
// eslint-disable-next-line no-console | ||
console.log({ navigation }) | ||
return ( | ||
<footer | ||
className={clsx( | ||
'flex flex-wrap items-center justify-between bg-white px-4 py-5 shadow-md shadow-slate-900/5 transition duration-500 dark:shadow-none sm:px-6 lg:px-8', | ||
)} | ||
> | ||
<p>Footer</p> | ||
<footer className="py-6 md:px-8 md:py-0"> | ||
<Container> | ||
<div className="flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row"> | ||
<p className="text-center text-sm leading-loose text-muted-foreground md:text-left"> | ||
© 2023 WPGraphQL. All rights reserved. | Development sponsored by <a href="https://www.wpengine.com/atlas" target="_blank" rel="noreferrer" className="font-medium underline underline-offset-4">WP Engine</a> | ||
</p> | ||
<div className="text-muted-foreground flex flex-row gap-4"> | ||
<FooterNavigation navigation={navigation} /> | ||
</div> | ||
</div> | ||
</Container> | ||
</footer> | ||
) | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,50 @@ | ||
.socialIconLink { | ||
color: transparent; | ||
display: inline-flex; | ||
margin-left: 0.8rem; | ||
overflow: hidden; | ||
position: relative; | ||
text-align: center; | ||
text-decoration: none; | ||
width: 24px; | ||
height: 24px; | ||
line-height: 24px; | ||
} | ||
|
||
.socialIconLink::after { | ||
background-color: hsl(var(--muted-foreground)); | ||
content: ""; | ||
height: 100%; | ||
left: 0; | ||
opacity: 0.8; | ||
position: absolute; | ||
top: 0; | ||
width: 24px; | ||
height: 24px; | ||
} | ||
|
||
.socialIconLink:hover::after, | ||
.socialIconLink:focus::after { | ||
opacity: 1; | ||
} | ||
|
||
.socialIconLink[href*="github.com"]::after { | ||
mask: url("/social-icons/github.svg"); | ||
} | ||
|
||
.socialIconLink[href*="slack.com"]::after { | ||
mask: url("/social-icons/slack.svg"); | ||
} | ||
|
||
.socialIconLink[href*="twitter.com"]::after, | ||
.socialIconLink[href*="x.com"]::after { | ||
mask: url("/social-icons/twitter.svg"); | ||
} | ||
|
||
.socialIconLink[href*="wordpress.org"]::after { | ||
mask: url("/social-icons/wordpress.svg"); | ||
} | ||
|
||
.socialIconLink[href*="youtube.com"]::after { | ||
mask: url("/social-icons/youtube.svg"); | ||
} | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Using CSS attribute selectors and the ::after pseudo-element to dynamically set the mask for social media icons based on the URL in the href attribute.