1
0
Fork 0
freesewing/sites/org/components/footer.js

180 lines
6.5 KiB
JavaScript
Raw Normal View History

import Logo from 'shared/components/logos/freesewing.js'
import OsiLogo from 'shared/components/logos/osi.js'
import CreativeCommonsLogo from 'shared/components/logos/cc.js'
import CcByLogo from 'shared/components/logos/cc-by.js'
2022-11-23 21:42:22 +01:00
import Ribbon from 'shared/components/ribbon.js'
2022-06-09 13:35:06 +02:00
import Link from 'next/link'
2022-11-23 21:42:22 +01:00
import { WordMark } from 'shared/components/wordmark.js'
2022-06-09 13:35:06 +02:00
2022-11-23 21:42:22 +01:00
import HelpIcon from 'shared/components/icons/help.js'
2022-06-09 13:35:06 +02:00
import DiscordIcon from 'shared/components/icons/discord.js'
import FacebookIcon from 'shared/components/icons/facebook.js'
import GithubIcon from 'shared/components/icons/github.js'
import InstagramIcon from 'shared/components/icons/instagram.js'
import RedditIcon from 'shared/components/icons/reddit.js'
import TwitterIcon from 'shared/components/icons/twitter.js'
2022-05-29 17:43:43 +02:00
// Classes
2022-11-23 21:42:22 +01:00
const link = 'text-secondary font-bold hover:pointer hover:underline px-1'
const accent = 'text-accent font-bold text-lg px-1 block sm:inline'
const freesewing = 'px-1 text-lg font-bold block sm:inline'
2022-05-29 17:43:43 +02:00
// Keep these translations in the component because they're only used here
const translations = {
2022-11-23 21:42:22 +01:00
cc: (
<span>
Content on FreeSewing.org is available under{' '}
<a className={link} href="https://creativecommons.org/licenses/by/4.0/">
a Creative Commons license
</a>
</span>
),
mit: (
<span>
The FreeSewing source code is{' '}
<a href="https://github.com/freesewing/freesewing" className={link}>
available on Github
</a>{' '}
under{' '}
<a href="https://opensource.org/licenses/MIT" className={link}>
the MIT license
</a>
</span>
),
sponsors: (
<>
<span className={freesewing}>FreeSewing</span> is sponsored by these{' '}
<span className={accent}>awesome companies</span>
</>
),
2022-05-29 17:43:43 +02:00
}
2022-11-23 21:42:22 +01:00
const icon = { className: 'w-8 lg:w-12 h-8 lg:h-12' }
const social = {
2022-06-09 15:16:53 +02:00
Discord: {
2022-11-23 21:42:22 +01:00
icon: <DiscordIcon {...icon} />,
href: 'https://discord.freesewing.org/',
2022-06-09 15:16:53 +02:00
},
Instagram: {
2022-11-23 21:42:22 +01:00
icon: <InstagramIcon {...icon} />,
href: 'https://instagram.com/freesewing_org',
2022-06-09 15:16:53 +02:00
},
Facebook: {
2022-11-23 21:42:22 +01:00
icon: <FacebookIcon {...icon} />,
href: 'https://www.facebook.com/groups/627769821272714/',
2022-06-09 15:16:53 +02:00
},
Github: {
icon: <GithubIcon {...icon} />,
2022-11-23 21:42:22 +01:00
href: 'https://github.com/freesewing',
2022-06-09 15:16:53 +02:00
},
Reddit: {
icon: <RedditIcon {...icon} />,
2022-11-23 21:42:22 +01:00
href: 'https://www.reddit.com/r/freesewing/',
2022-06-09 15:16:53 +02:00
},
Twitter: {
icon: <TwitterIcon {...icon} />,
2022-11-23 21:42:22 +01:00
href: 'https://twitter.com/freesewing_org',
},
}
2022-11-23 21:42:22 +01:00
const Footer = ({ app }) => {
2022-05-29 17:43:43 +02:00
return (
<footer className="bg-neutral">
2022-11-23 21:42:22 +01:00
<Ribbon loading={app.loading} theme={app.theme} />
<div className="grid grid-cols-1 lg:grid-cols-4 py-12 2xl:py-20 text-neutral-content px-4">
2022-06-09 13:35:06 +02:00
{/* First col - CC & MIT */}
2022-11-23 21:42:22 +01:00
<div className="mb-20 order-1 mt-20 2xl:mt-0 2xl:mb-0">
2022-06-09 13:35:06 +02:00
<div className="max-w-md m-auto">
2022-11-23 21:42:22 +01:00
<div>
<CreativeCommonsLogo className="w-64 m-auto" />
</div>
2022-06-09 13:35:06 +02:00
<div className="flex flex-row gap-2 justify-center items-center mt-8">
2022-11-23 21:42:22 +01:00
<CcByLogo className="w-8 lg:w-12" />
<p className="text-neutral-content text-right basis-4/5 lg:basis-3/4 leading-5">
{translations.cc}
2022-06-09 13:35:06 +02:00
</p>
2022-05-29 17:43:43 +02:00
</div>
2022-06-09 13:35:06 +02:00
<div className="flex flex-row gap-2 justify-center items-center mt-4">
2022-11-23 21:42:22 +01:00
<OsiLogo className="w-8 lg:w-12" />
<p className="text-neutral-content text-right basis-4/5 lg:basis-3/4 leading-5">
{translations.mit}
2022-06-09 13:35:06 +02:00
</p>
2022-05-29 17:43:43 +02:00
</div>
</div>
2022-05-29 17:43:43 +02:00
</div>
2022-06-09 13:35:06 +02:00
{/* Second col - Social & Sponsors */}
2022-11-23 21:42:22 +01:00
<div className="lg:col-span-2 -order-2 2xl:order-2 px-4 lg:px-0">
2022-06-09 13:35:06 +02:00
{/* Social icons */}
2022-11-23 21:42:22 +01:00
<div className="w-full sm:w-auto flex flex-row flex-wrap gap-4 lg:gap-8 items-center justify-center">
<Link href="/contact">
<a
className="hover:text-secondary hover:-mt-2 transition-all"
title="Contact information"
>
<HelpIcon {...icon} />
</a>
</Link>
{Object.keys(social).map((item) => (
2022-06-09 15:16:53 +02:00
<Link key={item} href={social[item].href}>
2022-11-23 21:42:22 +01:00
<a className="hover:text-secondary hover:-mt-2 transition-all" title={item}>
2022-06-09 15:16:53 +02:00
{social[item].icon}
2022-06-09 13:35:06 +02:00
</a>
</Link>
))}
</div>
{/* Sponsors */}
<div className="border rounded-xl p-8 border-dashed border-base-100/25 mt-20">
2022-11-23 21:42:22 +01:00
<p className="text-center text-neutral-content leading-5">
{translations.sponsors}
<br />
</p>
<div className="py-4 flex flex-row gap-8 flex-wrap 2xl:flex-nowrap justify-around text-neutral-content">
<a title="Search powered by Algolia" href="https://www.algolia.com/">
<img
src="/brands/algolia.svg"
className="h-12 aspect-auto"
alt="Search powered by Algolia"
/>
</a>
<a title="Error handling by Bugsnag" href="https://www.bugsnag.com/">
<img src="/brands/bugsnag.svg" className="h-12" alt="Error handling by bugsnag" />
</a>
<a title="Translation powered by Crowdin" href="https://www.crowdin.com/">
<img
src="/brands/crowdin.svg"
alt="Translation powered by Crowdin"
className="h-12"
/>
</a>
<a
title="Builds & hosting by Vercel"
href="https://www.vercel.com/?utm_source=freesewing&utm_campaign=oss"
>
<img src="/brands/vercel.svg" alt="Builds & Hosting by Vercel" className="h-12" />
</a>
</div>
2022-06-09 13:35:06 +02:00
</div>
</div>
2022-06-09 13:35:06 +02:00
{/* Col 3 - Logo & Slogan */}
2022-11-23 21:42:22 +01:00
<div className="w-full 4xl:w-auto xl:max-w-md mb-8 text-center order-3 mt-0 lg:mt-20 2xl:mt-0 2xl:mb-0">
2022-06-09 13:35:06 +02:00
<div className="max-w-md m-auto">
<Logo stroke="none" size={164} className="w-40 lg:w-64 m-auto m-auto" />
2022-11-23 21:42:22 +01:00
<h5 className="lg:text-3xl mt-4">
<WordMark />
</h5>
<p className="bold text-neutral-content text-normal lg:text-xl leading-5">
Come for the sewing patterns
2022-06-09 13:35:06 +02:00
<br />
2022-11-23 21:42:22 +01:00
Stay for the community
2022-06-09 13:35:06 +02:00
</p>
</div>
2022-05-29 17:43:43 +02:00
</div>
</div>
</footer>
)
}
export default Footer