-
Notifications
You must be signed in to change notification settings - Fork 24
footer with column addition flexibility + responsive #30
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
Merged
Himanshu-Singh-Chauhan
merged 2 commits into
trypear:main
from
aadityaverma2011:footer-fix2
Jan 29, 2025
Merged
Changes from 1 commit
Commits
Show all changes
2 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 hidden or 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 |
|---|---|---|
|
|
@@ -116,7 +116,7 @@ const config = { | |
| ], | ||
| }, | ||
| { | ||
| title: "Follow Us", | ||
| title: "Followww Us", | ||
| items: [ | ||
| { | ||
| label: "Twitter", | ||
|
|
||
This file contains hidden or 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 hidden or 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,11 @@ | ||
| import React from 'react'; | ||
| export default function FooterCopyright({copyright}) { | ||
| return ( | ||
| <div | ||
| className="footer__copyright" | ||
| // Developer provided the HTML, so assume it's safe. | ||
| // eslint-disable-next-line react/no-danger | ||
| dangerouslySetInnerHTML={{__html: copyright}} | ||
| /> | ||
| ); | ||
| } |
This file contains hidden or 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,20 @@ | ||
| import React from 'react'; | ||
| import clsx from 'clsx'; | ||
| export default function FooterLayout({style, links, logo, copyright}) { | ||
| return ( | ||
| <footer | ||
| className={clsx('footer', { | ||
| 'footer--dark': style === 'dark', | ||
| })}> | ||
| <div className="container container-fluid"> | ||
| {links} | ||
| {(logo || copyright) && ( | ||
| <div className="footer__bottom text--center"> | ||
| {logo && <div className="margin-bottom--sm">{logo}</div>} | ||
| {copyright} | ||
| </div> | ||
| )} | ||
| </div> | ||
| </footer> | ||
| ); | ||
| } |
This file contains hidden or 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,25 @@ | ||
| import React from 'react'; | ||
| import Link from '@docusaurus/Link'; | ||
| import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
| import isInternalUrl from '@docusaurus/isInternalUrl'; | ||
| import IconExternalLink from '@theme/Icon/ExternalLink'; | ||
| export default function FooterLinkItem({item}) { | ||
| const {to, href, label, prependBaseUrlToHref, ...props} = item; | ||
| const toUrl = useBaseUrl(to); | ||
| const normalizedHref = useBaseUrl(href, {forcePrependBaseUrl: true}); | ||
| return ( | ||
| <Link | ||
| className="footer__link-item" | ||
| {...(href | ||
| ? { | ||
| href: prependBaseUrlToHref ? normalizedHref : href, | ||
| } | ||
| : { | ||
| to: toUrl, | ||
| })} | ||
| {...props}> | ||
| {label} | ||
| {href && !isInternalUrl(href) && <IconExternalLink />} | ||
| </Link> | ||
| ); | ||
| } |
This file contains hidden or 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,37 @@ | ||
| import React from 'react'; | ||
| import LinkItem from '@theme/Footer/LinkItem'; | ||
| function ColumnLinkItem({item}) { | ||
| return item.html ? ( | ||
| <li | ||
| className="footer__item" | ||
| // Developer provided the HTML, so assume it's safe. | ||
| // eslint-disable-next-line react/no-danger | ||
| dangerouslySetInnerHTML={{__html: item.html}} | ||
| /> | ||
| ) : ( | ||
| <li key={item.href ?? item.to} className="footer__item"> | ||
| <LinkItem item={item} /> | ||
| </li> | ||
| ); | ||
| } | ||
| function Column({column}) { | ||
| return ( | ||
| <div className="col footer__col"> | ||
| <div className="footer__title">{column.title}</div> | ||
| <ul className="footer__items clean-list"> | ||
| {column.items.map((item, i) => ( | ||
| <ColumnLinkItem key={i} item={item} /> | ||
| ))} | ||
| </ul> | ||
| </div> | ||
| ); | ||
| } | ||
| export default function FooterLinksMultiColumn({columns}) { | ||
| return ( | ||
| <div className="row footer__links"> | ||
| {columns.map((column, i) => ( | ||
| <Column key={i} column={column} /> | ||
| ))} | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or 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,31 @@ | ||
| import React from 'react'; | ||
| import LinkItem from '@theme/Footer/LinkItem'; | ||
| function Separator() { | ||
| return <span className="footer__link-separator">·</span>; | ||
| } | ||
| function SimpleLinkItem({item}) { | ||
| return item.html ? ( | ||
| <span | ||
| className="footer__link-item" | ||
| // Developer provided the HTML, so assume it's safe. | ||
| // eslint-disable-next-line react/no-danger | ||
| dangerouslySetInnerHTML={{__html: item.html}} | ||
| /> | ||
| ) : ( | ||
| <LinkItem item={item} /> | ||
| ); | ||
| } | ||
| export default function FooterLinksSimple({links}) { | ||
| return ( | ||
| <div className="footer__links text--center"> | ||
| <div className="footer__links"> | ||
| {links.map((item, i) => ( | ||
| <React.Fragment key={i}> | ||
| <SimpleLinkItem item={item} /> | ||
| {links.length !== i + 1 && <Separator />} | ||
| </React.Fragment> | ||
| ))} | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or 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,11 @@ | ||
| import React from 'react'; | ||
| import {isMultiColumnFooterLinks} from '@docusaurus/theme-common'; | ||
| import FooterLinksMultiColumn from '@theme/Footer/Links/MultiColumn'; | ||
| import FooterLinksSimple from '@theme/Footer/Links/Simple'; | ||
| export default function FooterLinks({links}) { | ||
| return isMultiColumnFooterLinks(links) ? ( | ||
| <FooterLinksMultiColumn columns={links} /> | ||
| ) : ( | ||
| <FooterLinksSimple links={links} /> | ||
| ); | ||
| } |
This file contains hidden or 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,35 @@ | ||
| import React from 'react'; | ||
| import clsx from 'clsx'; | ||
| import Link from '@docusaurus/Link'; | ||
| import {useBaseUrlUtils} from '@docusaurus/useBaseUrl'; | ||
| import ThemedImage from '@theme/ThemedImage'; | ||
| import styles from './styles.module.css'; | ||
| function LogoImage({logo}) { | ||
| const {withBaseUrl} = useBaseUrlUtils(); | ||
| const sources = { | ||
| light: withBaseUrl(logo.src), | ||
| dark: withBaseUrl(logo.srcDark ?? logo.src), | ||
| }; | ||
| return ( | ||
| <ThemedImage | ||
| className={clsx('footer__logo', logo.className)} | ||
| alt={logo.alt} | ||
| sources={sources} | ||
| width={logo.width} | ||
| height={logo.height} | ||
| style={logo.style} | ||
| /> | ||
| ); | ||
| } | ||
| export default function FooterLogo({logo}) { | ||
| return logo.href ? ( | ||
| <Link | ||
| href={logo.href} | ||
| className={styles.footerLogoLink} | ||
| target={logo.target}> | ||
| <LogoImage logo={logo} /> | ||
| </Link> | ||
| ) : ( | ||
| <LogoImage logo={logo} /> | ||
| ); | ||
| } |
This file contains hidden or 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,9 @@ | ||
| .footerLogoLink { | ||
| opacity: 0.5; | ||
| transition: opacity var(--ifm-transition-fast) | ||
| var(--ifm-transition-timing-default); | ||
| } | ||
|
|
||
| .footerLogoLink:hover { | ||
| opacity: 1; | ||
| } |
This file contains hidden or 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,44 @@ | ||
| import React from "react"; | ||
|
|
||
| export default function Footer(props) { | ||
| const footerColumns = [ | ||
| { | ||
| title: "Community", | ||
| links: [ | ||
| { label: "Discord", href: "https://discord.gg/7QMraJUsQt" }, | ||
| { label: "GitHub", href: "https://github.com/trypear/pearai-app" }, | ||
| ], | ||
| }, | ||
| { | ||
| title: "Follow Us", | ||
| links: [ | ||
| { label: "Twitter", href: "https://x.com/trypearai" }, | ||
| { label: "LinkedIn", href: "https://linkedin.com/company/trypearai" }, | ||
| ], | ||
| } | ||
| ]; | ||
|
|
||
| return ( | ||
| <footer className="footer"> | ||
| <div className="footer__links"> | ||
| {footerColumns.map((column, index) => ( | ||
| <div key={index} className="footer__link-column"> | ||
| <h4>{column.title}</h4> | ||
| <ul> | ||
| {column.links.map((link, linkIndex) => ( | ||
| <li key={linkIndex}> | ||
| <a href={link.href} target="_blank" rel="noopener noreferrer"> | ||
| {link.label} | ||
| </a> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| <div className="footer__copyright"> | ||
| Copyright © {new Date().getFullYear()} PearAI Dev, Inc. | ||
| </div> | ||
| </footer> | ||
| ); | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.