From 1ab503d3de716b2a3bab2b3bae9d713a39712bca Mon Sep 17 00:00:00 2001 From: HenriqueSSan Date: Sun, 1 Jan 2023 20:10:00 -0300 Subject: [PATCH 1/2] refactor(header): moved styles in order --- src/template/Header/index.module.scss | 48 ++++++++++++++------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/src/template/Header/index.module.scss b/src/template/Header/index.module.scss index 1cba6e8..9621eef 100644 --- a/src/template/Header/index.module.scss +++ b/src/template/Header/index.module.scss @@ -8,13 +8,13 @@ $containers: ( ); .header { + padding: 25px 0; + position: sticky; top: 0; left: 0; z-index: 1000; - padding: 25px 0; - background-color: var(--clr-common-black); } @@ -29,12 +29,12 @@ $containers: ( } .content { + padding: 0px 16px; + margin-bottom: 27.14px; + display: flex; align-items: center; justify-content: space-between; - - padding: 0px 16px; - margin-bottom: 27.14px; } .content { @@ -73,14 +73,14 @@ $containers: ( } .search { - display: flex; - align-items: center; - justify-content: center; - min-height: 36px; border: 2px solid var(--clr-gray-150); border-radius: 5px; + display: flex; + align-items: center; + justify-content: center; + background-color: var(--clr-common-white); input { @@ -95,13 +95,13 @@ $containers: ( .search { button { + width: 36px; + height: 100%; + display: flex; align-items: center; justify-content: center; - width: 36px; - height: 100%; - background-color: var(--clr-common-white); } } @@ -183,13 +183,13 @@ $containers: ( .menu { @media only screen and (max-width: 1024px) { + width: 100vw; + height: 100vh; + position: fixed; left: -100%; top: 0; - width: 100vw; - height: 100vh; - background-color: transparent; transition: 300ms ease; @@ -257,10 +257,11 @@ $containers: ( } .actions-bottom { + padding: 0 16px; + display: flex; align-items: center; justify-content: space-between; - padding: 0 16px; } // styles for menu is active @@ -275,20 +276,20 @@ $containers: ( // menu styles for large devices 1025 > x .menu { @media only screen and (min-width: 1025px) { - display: block; - width: 100%; + display: block; + .list { + width: function.fluid(map-get($containers, 'md'), 1280px); + padding: 14px 0; + margin: 0 auto; + display: flex; align-items: center; justify-content: flex-start; gap: 55px; - width: function.fluid(map-get($containers, 'md'), 1280px); - padding: 14px 0; - margin: 0 auto; - background-color: var(--clr-common-black); a { @@ -349,9 +350,10 @@ $containers: ( // added search bottom box for small devices, medium devices .search-bottom { - display: flex; padding: 0 16px; + display: flex; + &-content { width: 100%; } -- 2.34.1 From f95ee80e15da19db613046f56c499263797219b3 Mon Sep 17 00:00:00 2001 From: HenriqueSSan Date: Sun, 1 Jan 2023 20:20:54 -0300 Subject: [PATCH 2/2] refactor(header): created more split components --- src/template/Header/index.tsx | 69 ++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/src/template/Header/index.tsx b/src/template/Header/index.tsx index 85f97d3..04db0ef 100644 --- a/src/template/Header/index.tsx +++ b/src/template/Header/index.tsx @@ -21,6 +21,44 @@ export function Search({ ...props }: SearchProps) { ) } +interface ContainerBottomProps { + isOpen: boolean + handleClose: () => void +} + +const ContainerBottom = ({ isOpen, handleClose }: ContainerBottomProps) => { + return ( +
+
+
+ Entrar + +
+ +
    + {['Cursos', 'Saiba Mais', 'Institucionais'].map((item, index) => { + return ( +
  • + {item} +
  • + ) + })} +
+
+
+ ) +} + export const Header = () => { const [isOpenMenu, setIsOpenMenu] = useState(false) @@ -75,36 +113,7 @@ export const Header = () => { -
-
-
- Entrar - -
- - -
-
+ ) -- 2.34.1