diff --git a/client/src/components/shared/Layout/LayoutFooter/LayoutFooter.module.scss b/client/src/components/shared/Layout/LayoutFooter/LayoutFooter.module.scss index 27e4605eef..854d7ea1da 100644 --- a/client/src/components/shared/Layout/LayoutFooter/LayoutFooter.module.scss +++ b/client/src/components/shared/Layout/LayoutFooter/LayoutFooter.module.scss @@ -3,62 +3,131 @@ display: flex; align-items: center; width: 100%; - padding: 4.8rem 0 21rem; + padding: 3.2rem 0 20rem; flex-direction: column-reverse; @include layoutMaxWidth(); @media #{$tablet-up} { - flex-direction: row; - padding: 4.8rem 0 26rem; + flex-direction: column; + padding: 4.8rem 0 20rem; } @media #{$desktop-up} { - padding: 4.8rem 0 5.6rem; + padding: 4.8rem; margin-bottom: 0; } .wrapper { + width: 100%; + flex-direction: column-reverse; display: flex; - text-align: start; - align-items: center; - margin-right: 2.4rem; - - .octantText { - font-size: $font-size-12; - min-width: 23.2rem; - margin-left: 1.6rem; - font-weight: $font-weight-semibold; - line-height: 2rem; - color: $color-octant-grey5; - } - } - - .links { - display: grid; - grid-template-columns: repeat(3, 11.2rem [col-start]); - grid-template-rows: 2.4rem 2.4rem; - grid-auto-flow: column; - margin-bottom: 3.2rem; @media #{$tablet-up} { - margin: 0; + flex-direction: row; + padding-bottom: 4.8rem; + border-bottom: 0.1rem solid $color-octant-grey1; } - .link { - cursor: pointer; + .info { + width: 100%; display: flex; - font-size: $font-size-14; - font-weight: $font-weight-semibold; - color: $color-octant-grey5; + text-align: start; + align-items: center; + padding-top: 3.2rem; + + @media #{$tablet-up} { + padding-top: 0; + width: auto; + margin-right: 2.4rem; + } + + @media #{$desktop-up} { + margin-right: 6.2rem; + } + + .octantText { + font-size: $font-size-12; + min-width: 23.2rem; + margin-left: 1.6rem; + font-weight: $font-weight-semibold; + line-height: 2rem; + color: $color-octant-grey5; + } + } + + .links { + grid-template-columns: repeat(3, minmax(11.2rem, auto) [col-start]); + padding: 3.2rem 0; + width: 100%; + display: grid; + gap: 0.8rem 0; + grid-template-rows: 2.4rem 2.4rem; + grid-auto-flow: column; + border-bottom: 0.1rem solid $color-octant-grey1; + + @media #{$tablet-up} { + margin: 0; + border-bottom: none; + padding: 0; + width: auto; + margin-right: auto; + } + + .link { + cursor: pointer; + display: flex; + font-size: $font-size-14; + font-weight: $font-weight-semibold; + color: $color-octant-grey5; - &:hover { - color: $color-octant-grey13; + &:hover { + color: $color-octant-grey13; + } } } + + .golemFoundationLink { + color: $color-octant-green; + text-decoration: underline; + } } +} + +.newsletterWrapper { + width: 100%; + display: flex; + flex-direction: column; + padding-bottom: 2.8rem; + border-bottom: 0.1rem solid $color-octant-grey1; + + @media #{$tablet-up} { + padding-top: 2.8rem; + padding-bottom: 0; + flex-direction: column-reverse; + border-bottom: none; + } + + .newsletter { + width: 100%; + margin-right: auto; + max-width: 32.6rem; - .golemFoundationLink { - color: $color-octant-green; - text-decoration: underline; + @media #{$tablet-up} { + max-width: 35.2rem; + } + } + + .newsletterText { + text-align: left; + font-size: $font-size-12; + font-weight: $font-weight-semibold; + color: $color-octant-grey5; + line-height: 2.4rem; + margin-top: 0.4rem; + + @media #{$tablet-up} { + margin-top: 0; + margin-bottom: 0.4rem; + } } } diff --git a/client/src/components/shared/Layout/LayoutFooter/LayoutFooter.tsx b/client/src/components/shared/Layout/LayoutFooter/LayoutFooter.tsx index 38e943da12..874a230a4b 100644 --- a/client/src/components/shared/Layout/LayoutFooter/LayoutFooter.tsx +++ b/client/src/components/shared/Layout/LayoutFooter/LayoutFooter.tsx @@ -1,5 +1,5 @@ import cx from 'classnames'; -import React, { FC, memo } from 'react'; +import React, { FC, memo, useLayoutEffect, useRef } from 'react'; import { Trans, useTranslation } from 'react-i18next'; import Svg from 'components/ui/Svg'; @@ -25,6 +25,7 @@ import LayoutFooterProps from './types'; const LayoutFooter: FC = ({ className }) => { const { t } = useTranslation('translation', { keyPrefix: 'layout.footer' }); const { isDesktop } = useMediaQuery(); + const newsletterRef = useRef(null); const links = isDesktop ? [ @@ -48,31 +49,52 @@ const LayoutFooter: FC = ({ className }) => { { label: t('links.termsOfUse'), link: TERMS_OF_USE }, ]; + useLayoutEffect(() => { + if (!newsletterRef.current || newsletterRef.current.children.length) {return;} + const script = document.createElement('script'); + script.setAttribute( + 'src', + 'https://cdn.jsdelivr.net/ghost/signup-form@~0.1/umd/signup-form.min.js', + ); + script.setAttribute('data-site', 'https://blog.octant.build'); + script.setAttribute('data-button-color', '#000000'); + script.setAttribute('data-button-text-color', '#FFFFFF'); + script.setAttribute('async', 'true'); + + newsletterRef.current.appendChild(script); + }, []); + return (
- -
- , - ]} - i18nKey="layout.footer.octantText" - /> +
+ +
+ , + ]} + i18nKey="layout.footer.octantText" + /> +
+
+
+ {links.map(({ link, label }) => ( + + {`→ ${label}`} + + ))}
-
- {links.map(({ link, label }) => ( - - {`→ ${label}`} - - ))} +
+
+
{t('newsletterText')}
); diff --git a/client/src/locales/en/translation.json b/client/src/locales/en/translation.json index a969d7ab32..075964203a 100644 --- a/client/src/locales/en/translation.json +++ b/client/src/locales/en/translation.json @@ -371,6 +371,7 @@ "patron": "Patron" }, "footer": { + "newsletterText": "Get PGF news and updates from Octant. No spam, ever", "octantText": "Octant is a <0>Golem Foundation project,
launched in 2023.", "links": { "website": "Website",