diff --git a/sites/dev/components/footer.js b/sites/dev/components/footer.js deleted file mode 100644 index 435b55fa75d..00000000000 --- a/sites/dev/components/footer.js +++ /dev/null @@ -1,172 +0,0 @@ -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' -import Ribbon from 'shared/components/ribbon.js' -import Link from 'next/link' -import { WordMark } from 'shared/components/wordmark.js' - -import HelpIcon from 'shared/components/icons/help.js' -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' - -// Classes -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' - -// Keep these translations in the component because they're only used here -const translations = { - cc: ( - - Content on FreeSewing.org is available under{' '} - - a Creative Commons license - - - ), - mit: ( - - The FreeSewing source code is{' '} - - available on Github - {' '} - under{' '} - - the MIT license - - - ), - sponsors: ( - <> - FreeSewing is sponsored by these{' '} - awesome companies - - ), -} - -const icon = { className: 'w-8 lg:w-12 h-8 lg:h-12' } -const social = { - Discord: { - icon: , - href: 'https://discord.freesewing.org/', - }, - Instagram: { - icon: , - href: 'https://instagram.com/freesewing_org', - }, - Facebook: { - icon: , - href: 'https://www.facebook.com/groups/627769821272714/', - }, - Github: { - icon: , - href: 'https://github.com/freesewing', - }, - Reddit: { - icon: , - href: 'https://www.reddit.com/r/freesewing/', - }, - Twitter: { - icon: , - href: 'https://twitter.com/freesewing_org', - }, -} - -const Footer = ({ app }) => { - return ( -
- -
- {/* First col - CC & MIT */} -
-
-
- -
-
- -

- {translations.cc} -

-
-
- -

- {translations.mit} -

-
-
-
- - {/* Second col - Social & Sponsors */} -
- {/* Social icons */} -
- - - - {Object.keys(social).map((item) => ( - - {social[item].icon} - - ))} -
- {/* Sponsors */} -
-

- {translations.sponsors} -
-

- -
-
- - {/* Col 3 - Logo & Slogan */} -
-
- -
- -
-

- Come for the sewing patterns -
- Stay for the community -

-
-
-
-
- ) -} - -export default Footer diff --git a/sites/dev/components/footer.mjs b/sites/dev/components/footer.mjs new file mode 100644 index 00000000000..c5de69138d5 --- /dev/null +++ b/sites/dev/components/footer.mjs @@ -0,0 +1,178 @@ +import Link from 'next/link' +import { FreeSewingLogo } from 'shared/components/logos/freesewing.mjs' +import { OsiLogo } from 'shared/components/logos/osi.mjs' +import { CCLogo } from 'shared/components/logos/cc.mjs' +import { CCByLogo } from 'shared/components/logos/cc-by.mjs' +import { Ribbon } from 'shared/components/ribbon.mjs' +import { WordMark } from 'shared/components/wordmark.mjs' +import { + HelpIcon, + DiscordIcon, + FacebookIcon, + GithubIcon, + InstagramIcon, + RedditIcon, + TwitterIcon, +} from 'shared/components/icons.mjs' + +// Classes +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' + +// Keep these translations in the component because they're only used here +const translations = { + cc: ( + + Content on FreeSewing.org is available under{' '} + + a Creative Commons license + + + ), + mit: ( + + The FreeSewing source code is{' '} + + available on Github + {' '} + under{' '} + + the MIT license + + + ), + sponsors: ( + <> + FreeSewing is sponsored by these{' '} + awesome companies + + ), +} + +const icon = { className: 'w-8 lg:w-12 h-8 lg:h-12' } +const social = { + Discord: { + icon: , + href: 'https://discord.freesewing.org/', + }, + Instagram: { + icon: , + href: 'https://instagram.com/freesewing_org', + }, + Facebook: { + icon: , + href: 'https://www.facebook.com/groups/627769821272714/', + }, + Github: { + icon: , + href: 'https://github.com/freesewing', + }, + Reddit: { + icon: , + href: 'https://www.reddit.com/r/freesewing/', + }, + Twitter: { + icon: , + href: 'https://twitter.com/freesewing_org', + }, +} + +export const Footer = ({ app }) => ( +
+ +
+ {/* First col - CC & MIT */} +
+
+
+ +
+
+ +

+ {translations.cc} +

+
+
+ +

+ {translations.mit} +

+
+
+
+ + {/* Second col - Social & Sponsors */} +
+ {/* Social icons */} +
+ + + + {Object.keys(social).map((item) => ( + + {social[item].icon} + + ))} +
+ {/* Sponsors */} +
+

+ {translations.sponsors} +
+

+ +
+
+ + {/* Col 3 - Logo & Slogan */} +
+
+ +
+ +
+

+ Come for the sewing patterns +
+ Stay for the community +

+
+
+
+
+) diff --git a/sites/dev/components/header.js b/sites/dev/components/header.mjs similarity index 87% rename from sites/dev/components/header.js rename to sites/dev/components/header.mjs index c2d9b472c28..1ef03acfac5 100644 --- a/sites/dev/components/header.js +++ b/sites/dev/components/header.mjs @@ -1,12 +1,12 @@ +// Hooks import { useState, useEffect } from 'react' -import ThemePicker from 'shared/components/theme-picker.js' -import CloseIcon from 'shared/components/icons/close.js' -import MenuIcon from 'shared/components/icons/menu.js' -import SearchIcon from 'shared/components/icons/search.js' -import Ribbon from 'shared/components/ribbon.js' -import { WordMark } from 'shared/components/wordmark.js' +// Components +import { ThemePicker } from 'shared/components/theme-picker/index.mjs' +import { CloseIcon, MenuIcon, SearchIcon } from 'shared/components/icons.mjs' +import { Ribbon } from 'shared/components/ribbon.mjs' +import { WordMark } from 'shared/components/wordmark.mjs' -const Header = ({ app, setSearch }) => { +export const Header = ({ app, setSearch }) => { const [prevScrollPos, setPrevScrollPos] = useState(0) const [show, setShow] = useState(true) @@ -88,5 +88,3 @@ const Header = ({ app, setSearch }) => { ) } - -export default Header diff --git a/sites/dev/components/help-us.js b/sites/dev/components/help-us.mjs similarity index 81% rename from sites/dev/components/help-us.js rename to sites/dev/components/help-us.mjs index 043e3b40f05..058c4f527e6 100644 --- a/sites/dev/components/help-us.js +++ b/sites/dev/components/help-us.mjs @@ -1,6 +1,6 @@ -import Popout from 'shared/components/popout.js' +import { Popout } from 'shared/components/popout.mjs' -const HelpUs = ({ slug = '/' }) => ( +export const HelpUs = ({ slug = '/' }) => (
Click here to learn how you can help us improve this page @@ -16,5 +16,3 @@ const HelpUs = ({ slug = '/' }) => (
) - -export default HelpUs diff --git a/sites/dev/components/layouts/bare.js b/sites/dev/components/layouts/bare.js deleted file mode 100644 index b9f7cb5df1a..00000000000 --- a/sites/dev/components/layouts/bare.js +++ /dev/null @@ -1,16 +0,0 @@ -import { useRouter } from 'next/router' -import Aside from 'shared/components/navigation/aside' - -const DefaultLayout = ({ app, children = [] }) => { - const router = useRouter() - const slug = router.asPath.slice(1) - - return ( - <> -