diff --git a/components/GlobalHeader/styles.css b/components/GlobalHeader/styles.css index 1aa69b1505..e375533058 100644 --- a/components/GlobalHeader/styles.css +++ b/components/GlobalHeader/styles.css @@ -1,5 +1,6 @@ header { @mixin border-bottom-grey; + @mixin all-transition; position: fixed; top: 0; diff --git a/pages/Misc/About/Slogan.tsx b/pages/Misc/About/Slogan.tsx index 9e4227501d..9e6b5aa3c1 100644 --- a/pages/Misc/About/Slogan.tsx +++ b/pages/Misc/About/Slogan.tsx @@ -1,4 +1,8 @@ +import { useContext } from 'react' +import { Waypoint } from 'react-waypoint' + import { Button } from '~/components/Button' +import { HeaderContext } from '~/components/GlobalHeader/Context' import { Translate } from '~/components/Language' import { PATHS } from '~/common/enums' @@ -9,55 +13,74 @@ import IMAGE_SLOGAN_XL from '~/static/images/about-1-xl.svg' import styles from './styles.css' -const Slogan = () => ( -
-
-
-
-

- -
- { + const { updateHeaderState } = useContext(HeaderContext) + + return ( +
+
+
+
+ { + updateHeaderState({ type: 'about', bgColor: 'transparent' }) + }} + onLeave={() => { + updateHeaderState({ type: 'about', bgColor: 'default' }) + }} + onPositionChange={({ currentPosition }) => { + if (currentPosition === 'above') { + updateHeaderState({ type: 'about', bgColor: 'default' }) + } + }} /> -

- -
- + +

+ +
+ +

+ +
+ +
-
- - + -
-) + `} + + ) +} export default Slogan diff --git a/pages/Misc/About/index.tsx b/pages/Misc/About/index.tsx index 21651aa2e9..8d837a64ad 100644 --- a/pages/Misc/About/index.tsx +++ b/pages/Misc/About/index.tsx @@ -1,5 +1,4 @@ import { useContext, useEffect } from 'react' -import { Waypoint } from 'react-waypoint' import { Head } from '~/components' import { HeaderContext } from '~/components/GlobalHeader/Context' @@ -24,19 +23,6 @@ export default () => {
- { - updateHeaderState({ type: 'about', bgColor: 'transparent' }) - }} - onLeave={() => { - updateHeaderState({ type: 'about', bgColor: 'default' }) - }} - onPositionChange={({ currentPosition }) => { - if (currentPosition === 'above') { - updateHeaderState({ type: 'about', bgColor: 'default' }) - } - }} - />