diff --git a/sites/dev/components/header.js b/sites/dev/components/header.js index c56a713822c..80a0b9e1e20 100644 --- a/sites/dev/components/header.js +++ b/sites/dev/components/header.js @@ -31,16 +31,16 @@ const Header = ({ app, setSearch }) => { return (
-
+
+
+ +
+
+
-
+
-
+ > + X +
- { - input.current - && input.current.value.length > 0 - && - } + {input.current && input.current.value.length > 0 && ( + + )}
-
-
-
@@ -172,17 +190,16 @@ const SearchBox = props => { ) } -const CustomSearchBox = connectSearchBox(SearchBox); - -const Search = props => { +const CustomSearchBox = connectSearchBox(SearchBox) +const Search = (props) => { const [active, setActive] = useState(0) useHotkeys('esc', () => props.setSearch(false)) useHotkeys('up', () => { - if (active) setActive(act => act - 1) + if (active) setActive((act) => act - 1) }) useHotkeys('down', () => { - setActive(act => act + 1) + setActive((act) => act + 1) }) useHotkeys('down', () => { console.log('enter', active) @@ -191,12 +208,13 @@ const Search = props => { const stateProps = { setSearch: props.setSearch, setMenu: props.setMenu, - active, setActive + active, + setActive, } return ( - + ) } diff --git a/sites/org/components/footer.js b/sites/org/components/footer.js index 46919fab27a..9f455aaafc9 100644 --- a/sites/org/components/footer.js +++ b/sites/org/components/footer.js @@ -2,11 +2,11 @@ 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 { useTranslation } from 'next-i18next' -import DocsLink from 'shared/components/docs-link' -import PinkedRibbon from 'shared/components/pinked-ribbon.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' @@ -15,181 +15,109 @@ 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" +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: { - en: - Content on FreeSewing.org is available under a Creative Commons license - , - de: - Inhalte auf FreeSewing.org sind unter einer Creative - Commons-Lizenz verfügbar - , - es: - El contenido de FreeSewing.org está disponible bajo una licencia Creative Commons - , - fr: - Le contenu de FreeSewing.org est sous - licence Creative Commons - , - nl: - De inhoud op FreeSewing.org is beschikbaar onder - een Creative Commons licentie - , - }, - mit: { - en: - The FreeSewing source code is available on Github under the MIT license - , - de: - Der FreeSewing-Quellcode ist auf Github verfügbar unter der MIT-Lizenz - , - es: - El código fuente de FreeSewing está disponible en Github bajo la licencia MIT - , - fr: - Le code source de FreeSewing est disponible sur Github sous la licence MIT - , - nl: - De FreeSewing broncode is beschikbaar op Github onder de MIT licentie - , - }, - sponsors: { - en: <> - FreeSewing is sponsored by these awesome companies - , - de: <> - FreeSewing wird von diesen großartigen Unternehmen gesponsert - , - es: <> - FreeSewing está patrocinado por estas increíbles empresas - , - fr: <> - FreeSewing est sponsorisé par ces entreprises géniales - , - nl: <> - FreeSewing wordt gesponsord door deze geweldige bedrijven - , - }, - msf: { - en: <> - All FreeSewing revenue goes to Doctors Without Borders - , - de: <> - Alle FreeSewing-Einnahmen gehen an Ärzte ohne Grenzen - , - es: <> - Todos los ingresos de FreeSewing van a Médicos sin Fronteras - , - fr: <> - Tous les revenus de FreeSewing vont à Médecins Sans Frontières - , - nl: <> - Alle inkomsten van FreeSewing gaan naar Artsen Zonder Grenzen - , - }, + 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-20 h-20" } +const icon = { className: 'w-8 lg:w-12 h-8 lg:h-12' } const social = { Discord: { - icon: , - href: 'https://discord.freesewing.org/' + icon: , + href: 'https://discord.freesewing.org/', }, Instagram: { - icon: , - href: 'https://instagram.com/freesewing_org' + icon: , + href: 'https://instagram.com/freesewing_org', }, Facebook: { - icon: , - href: 'https://www.facebook.com/groups/627769821272714/' + icon: , + href: 'https://www.facebook.com/groups/627769821272714/', }, Github: { icon: , - href: 'https://github.com/freesewing' + href: 'https://github.com/freesewing', }, Reddit: { icon: , - href: 'https://www.reddit.com/r/freesewing/' + href: 'https://www.reddit.com/r/freesewing/', }, Twitter: { icon: , - href: 'https://twitter.com/freesewing_org' - } + href: 'https://twitter.com/freesewing_org', + }, } - -const Footer = ({ app, full=false }) => { - const { t } = useTranslation(['common', 'patrons']) - +const Footer = ({ app }) => { return (
- -
- + +
{/* First col - CC & MIT */} -
+
-
+
+ +
- -

- {translations.cc[app.locale]} + +

+ {translations.cc}

- -

- {translations.mit[app.locale]} + +

+ {translations.mit}

{/* Second col - Social & Sponsors */} -
+
{/* Social icons */} -
- {Object.keys(social).map(item => ( +
+ + + + + + {Object.keys(social).map((item) => ( - + {social[item].icon} @@ -197,49 +125,55 @@ const Footer = ({ app, full=false }) => {
{/* Sponsors */}
-

- {translations.sponsors[app.locale]} -
-

-
- - Search powered by Algolia - - - Error handling by bugsnag - - - Translation powered by Crowdin - - - Builds & Hosting by Vercel - +

+ {translations.sponsors} +
+

+
-
-

- {translations.msf[app.locale]} -
- [ ] -

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

- {t('sloganCome')} +

+ +
+

+ Come for the sewing patterns
- {t('sloganStay')} + Stay for the community

-
) } export default Footer - diff --git a/sites/org/components/header.js b/sites/org/components/header.js index e38ec6a919d..23a46b8f373 100644 --- a/sites/org/components/header.js +++ b/sites/org/components/header.js @@ -1,36 +1,24 @@ import { useState, useEffect } from 'react' -import FreeSewingIcon from 'shared/components/icons/freesewing.js' import Link from 'next/link' import ThemePicker from 'shared/components/theme-picker.js' import LocalePicker from 'shared/components/locale-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' - -const Right = props => ( - - - -) -const Left = props => ( - - - -) +import Ribbon from 'shared/components/ribbon.js' +import { WordMark } from 'shared/components/wordmark.js' const Header = ({ app, setSearch }) => { - const [prevScrollPos, setPrevScrollPos] = useState(0) const [show, setShow] = useState(true) useEffect(() => { if (typeof window !== 'undefined') { const handleScroll = () => { - const curScrollPos = (typeof window !== 'undefined') ? window.pageYOffset : 0 + const curScrollPos = typeof window !== 'undefined' ? window.pageYOffset : 0 if (curScrollPos >= prevScrollPos) { if (show && curScrollPos > 20) setShow(false) - } - else setShow(true) + } else setShow(true) setPrevScrollPos(curScrollPos) } window.addEventListener('scroll', handleScroll) @@ -38,90 +26,67 @@ const Header = ({ app, setSearch }) => { } }, [prevScrollPos, show]) - return ( -
-
-
+
+
+
+
-
- - - -
- - -
- - +
+
+
+ +
+
+ +
+
+
+ + + +
-
+
+ +
) } diff --git a/sites/org/components/layouts/docs.js b/sites/org/components/layouts/docs.js index fa7df9a452f..d01fe34f401 100644 --- a/sites/org/components/layouts/docs.js +++ b/sites/org/components/layouts/docs.js @@ -3,18 +3,15 @@ import { useRouter } from 'next/router' import Aside from 'shared/components/navigation/aside' import ThemePicker from 'shared/components/theme-picker' import Breadcrumbs from 'shared/components/breadcrumbs.js' -import { getCrumbs } from 'shared/utils.js' -const DefaultLayout = ({ app, title=false, crumbs=false, children=[] }) => { +const DefaultLayout = ({ app, title = false, crumbs = false, children = [] }) => { const router = useRouter() const slug = router.asPath.slice(1) - const breadcrumbs = crumbs - ? crumbs - : getCrumbs(app, slug, title) + const breadcrumbs = crumbs ? crumbs : null //FIXME getCrumbs(app, slug, title) return (
-