From 23bcc46f3e9834db9aade4ae4ad78b7f279af112 Mon Sep 17 00:00:00 2001 From: Ebube Date: Wed, 6 Mar 2024 13:10:22 +0100 Subject: [PATCH] Improved on responsivness for the header --- src/App.css | 1 - src/components/Header/Header.tsx | 69 +++++++++++++++---------- src/components/Header/TopHeader.tsx | 35 +++++++++---- src/components/Header/header.module.css | 2 +- src/components/shared/Button.tsx | 2 +- src/index.css | 18 ++++++- 6 files changed, 86 insertions(+), 41 deletions(-) diff --git a/src/App.css b/src/App.css index 8b83cf1..1750e47 100644 --- a/src/App.css +++ b/src/App.css @@ -1,7 +1,6 @@ .btn-primary { background: #5A2C82; color: #FFFFFF; - padding: 6px 10px; display: block; text-decoration: none; font-weight: 500; diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 225c2dc..0bb1add 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -4,40 +4,53 @@ import Button from "../shared/Button"; import { lowerMenuItems } from "../../utils/data"; const Header = () => { - const [searchValue, setSearchValue] = useState(""); + const [searchValue, setSearchValue] = useState(""); const handleSearchChange = (e: ChangeEvent) => { setSearchValue(e.target.value); }; return ( -
-
- - - {/* Right Part of the navbar */} -
-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • +
    +
    + Logo +
    +
      + {["Open An Account", "Internet Banking", "Contact Us"].map( + (text: string) => ( +
    • + +
    • + ) + )} +
    -
      +
      + + + +
      +
        {lowerMenuItems.map((item) => (
      • ) => void; }) => { return ( -
        +
        diff --git a/src/components/Header/TopHeader.tsx b/src/components/Header/TopHeader.tsx index b6fc5e7..0f34c9e 100644 --- a/src/components/Header/TopHeader.tsx +++ b/src/components/Header/TopHeader.tsx @@ -3,19 +3,36 @@ import styles from "./header.module.css"; const TopHeader = () => { return ( -
        -
        -
          - {top_header_data.map(({ id, name }) => ( -
        • {name}
        • + <> +
          +
            + {["Open An Account", "Internet Banking", "Contact Us"].map((text) => ( +
          • + + {text} + +
          • ))}
          -
          -

          Today's Share price:

          - $ 4.00 +
          +
          +
          +
            + {top_header_data.map(({ id, name }) => ( +
          • + + {name} + +
          • + ))} +
          +
          +

          Today's Share price:

          + $ 4.00 +
          -
          + ); }; diff --git a/src/components/Header/header.module.css b/src/components/Header/header.module.css index f3f0e04..3da672e 100644 --- a/src/components/Header/header.module.css +++ b/src/components/Header/header.module.css @@ -1,7 +1,7 @@ .top_header{ background: url(../../assets/images/topbar_back.jpg) no-repeat; background-size: cover; - height: 2.535rem; + /* padding: 0.4rem 0; */ display: flex; align-items: center; justify-content: center; diff --git a/src/components/shared/Button.tsx b/src/components/shared/Button.tsx index 54de6f9..3c22961 100644 --- a/src/components/shared/Button.tsx +++ b/src/components/shared/Button.tsx @@ -5,7 +5,7 @@ type ButtonProps = { }; const Button = ({ text, className }: ButtonProps) => { - return ; + return ; }; export default Button; diff --git a/src/index.css b/src/index.css index bd6213e..8d31b54 100644 --- a/src/index.css +++ b/src/index.css @@ -1,3 +1,19 @@ +@import url('https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap'); + @tailwind base; @tailwind components; -@tailwind utilities; \ No newline at end of file +@tailwind utilities; + +body { + line-height: 1.42857143; + font-family: "Open Sans", sans-serif; + font-optical-sizing: auto; + font-style: normal; +} + + +@layer components { + .containerMode { + @apply container mx-auto px-5 xxs:max-w-full sm:max-w-[98%] lg:max-w-[1100px]; + } +} \ No newline at end of file -- 2.34.1