From 8913110750f80db0003586f55a71b495ade9f2e4 Mon Sep 17 00:00:00 2001 From: Kishan Takoordyal Date: Thu, 4 Mar 2021 17:52:52 +0400 Subject: [PATCH] improvements + make header responsive --- src/App.js | 28 ++++- src/components/{Header.js => HeaderD.js} | 14 ++- src/components/HeaderM.js | 147 +++++++++++++++++++++++ tailwind.config.js | 1 + 4 files changed, 181 insertions(+), 9 deletions(-) rename src/components/{Header.js => HeaderD.js} (93%) create mode 100644 src/components/HeaderM.js diff --git a/src/App.js b/src/App.js index 71e0b60..022d16a 100644 --- a/src/App.js +++ b/src/App.js @@ -1,11 +1,33 @@ -import React from 'react'; +import React, { useState } from 'react'; -import Header from './components/Header'; +import useWindowSize from './useWindowSize'; + +import HeaderD from './components/HeaderD'; +import HeaderM from './components/HeaderM'; export default function App() { + const [currentLanguage, setCurrentLanguage] = useState('en'); + const [showCookies, setShowCookies] = useState(true); + + const { width } = useWindowSize(); + return (
-
+ {width > 660 ? ( + + ) : ( + + )}
); } diff --git a/src/components/Header.js b/src/components/HeaderD.js similarity index 93% rename from src/components/Header.js rename to src/components/HeaderD.js index f6812e2..959b21d 100644 --- a/src/components/Header.js +++ b/src/components/HeaderD.js @@ -1,12 +1,14 @@ -import React, { useState } from 'react'; +import React from 'react'; import proximity_logo from '../assets/images/proximity_logo.svg'; import backgroundVideo from '../assets/videos/video.mp4'; -export default function Header() { - const [currentLanguage, setCurrentLanguage] = useState('en'); - const [showCookies, setShowCookies] = useState(true); - +export default function HeaderD({ + currentLanguage, + setCurrentLanguage, + showCookies, + setShowCookies, +}) { const headerLinkClasses = 'text-gray-100 font-avenirbook font-normal hover:underline focus:underline text-lg'; @@ -91,7 +93,7 @@ export default function Header() {
{showCookies && cookies} diff --git a/src/components/HeaderM.js b/src/components/HeaderM.js new file mode 100644 index 0000000..5d7c336 --- /dev/null +++ b/src/components/HeaderM.js @@ -0,0 +1,147 @@ +import React, { useState } from 'react'; + +import proximity_logo from '../assets/images/proximity_logo.svg'; +import backgroundVideo from '../assets/videos/video.mp4'; + +export default function HeaderD({ + currentLanguage, + setCurrentLanguage, + showCookies, + setShowCookies, +}) { + const [showSidebar, setShowSidebar] = useState(false); + + const headerLinkClasses = + 'text-gray-100 font-avenirbook font-normal hover:underline focus:underline text-lg w-full bg-gray-900 my-1 py-2 text-center opacity-75 rounded'; + + const sidebar = ( +
+ + About + + + Work + + + Latest + + + People & Careers + + + Contact + +
+ ); + + const cookies = ( +
+
+ This website uses cookies to improve your experience. We'll assume + you're ok with this, but you can opt out if you wish. +
+ +
+ + + + Read more + +
+
+ ); + + return ( +
+
+ Proximity Logo + +
+ {/* + About + + + Work + + + Latest + + + People & Careers + + + Contact + */} + +
+ + +
+ +
+
+ +
+

+ We make people +
+ more valuable to brands +

+
+ +
+
+ {showCookies && cookies} +
+ + {showSidebar && sidebar} + + +
+ ); +} diff --git a/tailwind.config.js b/tailwind.config.js index 707ee50..0b5230e 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -145,6 +145,7 @@ module.exports = { 12: '3rem', 16: '4rem', 20: '5rem', + 22: '5.5rem', 24: '6rem', 32: '8rem', 36: '9rem',