Skip to content

Commit

Permalink
style: 🎨 make header responsive
Browse files Browse the repository at this point in the history
  • Loading branch information
okaziya committed Jan 15, 2025
1 parent 207f31b commit 66d3b01
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 11 deletions.
9 changes: 8 additions & 1 deletion components/Button/Button.styles.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client"
"use client";

import styled from "styled-components";
import { media } from "../../styles/media";

export const PrimaryButton = styled.button`
background-color: ${({ theme }) => theme.colors.brand};
Expand All @@ -16,4 +17,10 @@ export const PrimaryButton = styled.button`
background-color: rgba(107, 107, 241, 1);
box-shadow: 5px 5px 20px rgba(84, 84, 212, 0.75);
}
${media.mobile`
white-space: nowrap;
padding: 12px 16px;
max-height: 48px;
`}
`;
19 changes: 19 additions & 0 deletions components/Header/Header.styles.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,27 @@
"use client";

import styled from "styled-components";
import { media } from "../../styles/media";

export const StyledHeader = styled.header`
max-width: ${({ theme }) => theme.breakpoints.desktop};
height: 60px;
${media.mobile`
height: 76px;
`}
`;

export const ImageWrapper = styled.div`
width: 100%;
max-width: 80px;
margin-bottom: 12px;
img {
width: 100%;
height: auto;
}
${media.mobile`
max-width: 56px;
`}
`;
20 changes: 11 additions & 9 deletions components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getTranslations } from "../../lib/getTranslations";
import { Locale } from "../../types";
import Image from "next/image";
import Button from "../Button";
import { StyledHeader } from "./Header.styles";
import { ImageWrapper, StyledHeader } from "./Header.styles";
import { CONTACT_INFO } from "../../config";
import { getImagePath } from "../../utils/imagePath";

Expand All @@ -13,14 +13,16 @@ export default function Header({ locale }: { locale: Locale }) {
return (
<StyledHeader className="mx-auto d-flex justify-content-between">
<div className="d-flex flex-column justify-content-between">
<Image
src={getImagePath("/glasses.png")}
alt={translations.images.logoAlt}
width={80}
height={16}
priority
unoptimized
/>
<ImageWrapper>
<Image
src={getImagePath("/glasses.png")}
alt={translations.images.logoAlt}
width={80}
height={16}
priority
unoptimized
/>
</ImageWrapper>
<h3 className="m-0">{CONTACT_INFO.name}</h3>
</div>
<div className="d-flex">
Expand Down
6 changes: 6 additions & 0 deletions components/Header/LanguageSwitcher.styles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import Link from "next/link";

import styled from "styled-components";
import { media } from "../../styles/media";

export const StyledLanguageSwitcher = styled(Link)`
background-color: transparent;
Expand All @@ -17,4 +18,9 @@ export const StyledLanguageSwitcher = styled(Link)`
transform: scale(1.1);
}
}
${media.mobile`
width: 48px;
height: 48px;
`}
`;
2 changes: 1 addition & 1 deletion components/Header/LanguageSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default function LanguageSwitcher({ locale }: { locale: Locale }) {
return (
<StyledLanguageSwitcher
href={`/${nextLocale}`}
className="language-switcher mx-1 align-items-center btn btn-light d-flex p-3 border-0"
className="language-switcher mx-1 align-items-center btn btn-light d-flex p-2 p-lg-3 border-0"
>
<Image
src={getImagePath(flagSrc)}
Expand Down

0 comments on commit 66d3b01

Please sign in to comment.