diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 5093bbe2..dd5b5e19 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -21,7 +21,6 @@ jobs: uses: docker/setup-buildx-action@v3 - name: Login to GitHub Container Registry - if: ${{ github.ref == 'refs/heads/main' }} uses: docker/login-action@v3 with: registry: ghcr.io @@ -44,7 +43,7 @@ jobs: - name: Build Docker image (and push on main) uses: docker/build-push-action@v6 with: - push: ${{ github.ref == 'refs/heads/main' }} + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha diff --git a/src/components/ContentPane/Collapsible/Collapsible.module.scss b/src/components/ContentPane/Collapsible/Collapsible.module.scss index 3b560c06..c273c144 100644 --- a/src/components/ContentPane/Collapsible/Collapsible.module.scss +++ b/src/components/ContentPane/Collapsible/Collapsible.module.scss @@ -10,17 +10,25 @@ background-color: transparent; overflow: hidden; padding-bottom: 0.5rem; + max-height: 10rem; } -.open { +input:checked + .content { max-height: unset; } -.closed { - max-height: 20rem; +input:checked ~ .button { + .open { + display: none; + } + .close { + display: block; + } } .button { + display: flex; + flex-direction: column; padding: 0; align-items: center; width: 100%; @@ -29,4 +37,11 @@ cursor: pointer; border: none; border-top: 2px solid var(--content-border-color); + + .open { + display: block; + } + .close { + display: none; + } } diff --git a/src/components/ContentPane/Collapsible/Collapsible.tsx b/src/components/ContentPane/Collapsible/Collapsible.tsx index c5e4bd93..e5f2e36d 100644 --- a/src/components/ContentPane/Collapsible/Collapsible.tsx +++ b/src/components/ContentPane/Collapsible/Collapsible.tsx @@ -1,21 +1,21 @@ -'use client'; - import styles from './Collapsible.module.scss'; import { MdOutlineExpandMore, MdOutlineExpandLess } from 'react-icons/md'; -import { useState } from 'react'; -const Collapsible = ({ children }: { children: React.ReactNode }) => { - const [open, setOpen] = useState(false); +const Collapsible = ({ + children, + id +}: { + children: React.ReactNode; + id: string; +}) => { return (
-
- {children} -
- + +
{children}
+
); }; diff --git a/src/components/Header/Header.module.scss b/src/components/Header/Header.module.scss index f4fb6ec8..e571a241 100644 --- a/src/components/Header/Header.module.scss +++ b/src/components/Header/Header.module.scss @@ -1,3 +1,7 @@ +.selector { + padding: 0 1rem; +} + .header { position: sticky; top: 0; @@ -30,6 +34,26 @@ .mobile { display: none; + height: 4.75rem; + width: 100%; + flex-direction: row; + align-items: center; + justify-content: space-between; +} + +.mobileActions { + display: flex; + flex-direction: column; + align-items: center; + gap: 1.25rem; +} + +.mobileUser { + margin: 0 0 1.5rem 0.75rem !important; +} + +button.mobileUser { + margin: 0 1rem 1.5rem 1rem !important; } @media screen and (max-width: #{$header-breakpoint}) { @@ -37,12 +61,7 @@ display: none; } .mobile { - height: 4.75rem; - width: 100%; display: flex; - flex-direction: row; - align-items: center; - justify-content: space-between; } .header { padding: 0; diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index e39f9d5d..1c999d2c 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -11,23 +11,25 @@ import Link from 'next/link'; const Header = ({ locale }: { locale: string }) => { return (
-
+
+ - - - - - +
+ + + + +
-
+
} > - +
diff --git a/src/components/Header/NavDrawer/NavDrawer.module.scss b/src/components/Header/NavDrawer/NavDrawer.module.scss index c0c3e05b..484dd956 100644 --- a/src/components/Header/NavDrawer/NavDrawer.module.scss +++ b/src/components/Header/NavDrawer/NavDrawer.module.scss @@ -5,12 +5,14 @@ color: var(--text-color); height: min(calc(1.5rem + 2.5vw), 2.5rem); width: min(calc(1.5rem + 2.5vw), 2.5rem); + cursor: pointer; } .drawer { position: fixed; display: flex; flex-direction: row; + transition: left 0.5s; top: 0; left: 0; width: 100vw; @@ -30,23 +32,15 @@ .content { position: absolute; background-color: var(--header-color); + max-width: 25rem; width: 70vw; height: 100%; z-index: 10; - animation: slideIn 0.5s; padding: 1.875rem 0; display: flex; flex-direction: column; overflow: scroll; -} - -@keyframes slideIn { - from { - transform: translateX(-100%); - } - to { - transform: translateX(0); - } + transition: left 0.5s; } .overlay { @@ -54,7 +48,7 @@ background-color: rgba(0, 0, 0, 0.5); width: 100%; height: 100%; - animation: fadeIn 0.5s; + transition: opacity 0.5s; } @keyframes fadeIn { @@ -66,10 +60,22 @@ } } -.open { - display: block; +.checkbox + .drawer { + pointer-events: none; + .content { + left: -100%; + } + .overlay { + opacity: 0; + } } -.closed { - display: none; +.checkbox:checked + .drawer { + pointer-events: all; + .content { + left: 0; + } + .overlay { + opacity: 1; + } } diff --git a/src/components/Header/NavDrawer/NavDrawer.tsx b/src/components/Header/NavDrawer/NavDrawer.tsx index decc9e6e..676afe3a 100644 --- a/src/components/Header/NavDrawer/NavDrawer.tsx +++ b/src/components/Header/NavDrawer/NavDrawer.tsx @@ -1,17 +1,39 @@ 'use client'; - +import { useRef, useEffect } from 'react'; +import { usePathname, useSearchParams } from 'next/navigation'; import styles from './NavDrawer.module.scss'; -import { useState } from 'react'; import { FaBars } from 'react-icons/fa6'; const NavDrawer = ({ children }: { children: React.ReactNode }) => { - const [open, setOpen] = useState(false); + const pathname = usePathname(); + const searchParams = useSearchParams(); + const inputRef = useRef(null); + + const handleClose = () => { + if (inputRef.current) { + inputRef.current.checked = false; + } + }; + + useEffect(() => { + handleClose(); + }, [pathname, searchParams]); + return (
- setOpen(!open)} /> -
+ + +
{children}
-
setOpen(false)} /> +
); diff --git a/src/components/Header/Navigation/Dropdown/Dropdown.tsx b/src/components/Header/Navigation/Dropdown/Dropdown.tsx index a827fa45..77895989 100644 --- a/src/components/Header/Navigation/Dropdown/Dropdown.tsx +++ b/src/components/Header/Navigation/Dropdown/Dropdown.tsx @@ -1,6 +1,9 @@ +'use client'; + import { Poppins } from 'next/font/google'; import styles from './Dropdown.module.scss'; -import { HTMLAttributes, ReactNode } from 'react'; +import { HTMLAttributes, ReactNode, useRef, useState } from 'react'; +import useClickOutside from '@/hooks/clickOutside'; const poppins = Poppins({ subsets: ['latin'], weight: ['500'] }); @@ -19,16 +22,26 @@ const Dropdown = ({ contentClassName, ...rest }: Props & HTMLAttributes) => { + const [isDroppedDown, setIsDroppedDown] = useState(false); + const ref = useRef(null); + useClickOutside(ref, () => setIsDroppedDown(false)); + return ( -
+
-