diff --git a/pages/index.tsx b/pages/index.tsx index 5d853c61..d04c8339 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -8,6 +8,7 @@ import { GetStaticProps, NextPage } from "next" import { IMenu, IMeta, PageCardDto } from "src/types" import { apiGet } from "@/next-lib" import { createHomeCards, createMenu } from "@/remote/factory" +import { useMobile } from "@/hooks/useMobile" type Props = { title: string @@ -16,48 +17,54 @@ type Props = { items: PageCardDto[] } -const Index: NextPage = props => ( - <> - - - {props.title} - - - = props => { + const mobile = useMobile() + + return ( + <> + + + {props.title} + + + {mobile ? null : ( + + )} - - - -) + + + + ) +} export const getStaticProps: GetStaticProps = async () => { const items = await apiGet(createHomeCards)("https://hudozka.tmshv.com/home", async () => []) diff --git a/src/components/HudozkaTitle/index.tsx b/src/components/HudozkaTitle/index.tsx index 6fc1a983..1fb37187 100644 --- a/src/components/HudozkaTitle/index.tsx +++ b/src/components/HudozkaTitle/index.tsx @@ -3,15 +3,25 @@ import s from "./title.module.css" import { memo } from "react" export type HudozkaTitleProps = { + compact?: boolean style?: React.CSSProperties } -export const HudozkaTitle: React.FC = memo(props => ( -

- МБУДО - Шлиссельбургская
- детская художественная школа -

-)) +export const HudozkaTitle: React.FC = memo(({ style, compact = false }) => { + if (compact) { + return ( + + Шлиссельбургская ДХШ + + ) + } + return ( +

+ МБУДО + Шлиссельбургская
+ детская художественная школа +

+ ) +}) HudozkaTitle.displayName = "HudozkaTitle" diff --git a/src/components/Menu/styles.module.css b/src/components/Menu/styles.module.css index 448076a1..5fbc9bda 100644 --- a/src/components/Menu/styles.module.css +++ b/src/components/Menu/styles.module.css @@ -3,7 +3,7 @@ align-items: flex-start; flex-wrap: wrap; - gap: var(--size-m); + gap: var(--size-s); font-size: var(--font-size-second); list-style: none; @@ -19,11 +19,18 @@ /* MENU ITEM */ .menuItem { + display: flex; + align-items: center; + justify-content: center; + user-select: none; background-color: var(--color-back-main); border-radius: var(--radius-small); transition: box-shadow 200ms ease-in, background-color 200ms ease-in; - padding: var(--size-s) var(--size-s); + /* padding: var(--size-s) var(--size-s); */ + padding: 0 var(--size-s); + + height: var(--size-l); } .menuItem.active { diff --git a/src/components/Navigation/index.tsx b/src/components/Navigation/index.tsx index a7b3a2df..0614614b 100644 --- a/src/components/Navigation/index.tsx +++ b/src/components/Navigation/index.tsx @@ -9,13 +9,17 @@ import { Spacer } from "../Spacer" import { useToggle } from "react-use" import { Button } from "@/ui/Button" import { EyeOpenIcon } from "@radix-ui/react-icons" +import { HudozkaLogo } from "../HudozkaLogo" +import { useDarkTheme } from "@/hooks/useDarkTheme" +import { HudozkaTitle } from "../HudozkaTitle" export type NavigationProps = { style?: React.CSSProperties } export const Navigation: React.FC = props => { - const collapseMenu = useMobile() + const mobile = useMobile() + const dark = useDarkTheme() const [open, toggleOpen] = useToggle(false) const { menu } = useContext(ConfigContext) @@ -45,10 +49,16 @@ export const Navigation: React.FC = props => { - - {collapseMenu ? null : ( + + + {!mobile ? null : ( + + )} + + {mobile ? null : ( { @@ -59,7 +69,7 @@ export const Navigation: React.FC = props => { - {!collapseMenu ? null : ( + {!mobile ? null : ( = ({