rewrit HudozkaLogo to use dark style natively
This commit is contained in:
1 parent
73c02d34c4
commit
37e2fc9ea5
4 files changed
+17
-18
No files matched your search
@@ -1,19 +1,19 @@
|
|||||||
import s from "./logo.module.css"
|
import s from "./logo.module.css"
|
||||||
|
|
||||||
import Image from "next/image"
|
import Image from "next/image"
|
||||||
import image from "src/assets/hudozka-logo.png"
|
import src from "src/assets/hudozka-logo.png"
|
||||||
|
|
||||||
export type HudozkaLogoProps = {
|
function HudozkaLogo() {
|
||||||
dark?: boolean
|
return (
|
||||||
}
|
<div className={s.container}>
|
||||||
|
|
||||||
export const HudozkaLogo: React.FC<HudozkaLogoProps> = ({ dark }) => (
|
|
||||||
<div className={`${s.container} ${dark ? s.dark : ""}`}>
|
|
||||||
<Image
|
<Image
|
||||||
src={image}
|
src={src}
|
||||||
width={36}
|
width={36}
|
||||||
height={36}
|
height={36}
|
||||||
alt={"Hudozka"}
|
alt={"Hudozka"}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export default HudozkaLogo
|
||||||
@@ -9,7 +9,9 @@
|
|||||||
border-radius: var(--radius-small);
|
border-radius: var(--radius-small);
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark {
|
/* DARK THEME */
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
.container {
|
||||||
background-color: #f9ea12;
|
background-color: #f9ea12;
|
||||||
|
|
||||||
--shadow-color: 60deg 100% 29%;
|
--shadow-color: 60deg 100% 29%;
|
||||||
@@ -26,6 +28,7 @@
|
|||||||
box-shadow: var(--shadow-elevation-high);
|
box-shadow: var(--shadow-elevation-high);
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark img {
|
.container img {
|
||||||
filter: invert(0%);
|
filter: invert(0%);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
@@ -2,8 +2,7 @@ import { Menu } from "../Menu"
|
|||||||
import { useContext } from "react"
|
import { useContext } from "react"
|
||||||
import { MenuContext } from "@/context/MenuContext"
|
import { MenuContext } from "@/context/MenuContext"
|
||||||
import { Box } from "@/ui/Box"
|
import { Box } from "@/ui/Box"
|
||||||
import { HudozkaLogo } from "../HudozkaLogo"
|
import HudozkaLogo from "../HudozkaLogo"
|
||||||
import { useDarkTheme } from "@/hooks/useDarkTheme"
|
|
||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
import { AccessibilityButton } from "../AccessibilityButton"
|
import { AccessibilityButton } from "../AccessibilityButton"
|
||||||
import { Spacer } from "../Spacer"
|
import { Spacer } from "../Spacer"
|
||||||
@@ -13,13 +12,12 @@ export type DesktopNavigationProps = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const DesktopNavigation: React.FC<DesktopNavigationProps> = ({ style }) => {
|
export const DesktopNavigation: React.FC<DesktopNavigationProps> = ({ style }) => {
|
||||||
const dark = useDarkTheme()
|
|
||||||
const menu = useContext(MenuContext)
|
const menu = useContext(MenuContext)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box wrap gap={"var(--size-s)"} style={style}>
|
<Box wrap gap={"var(--size-s)"} style={style}>
|
||||||
<Link href="/">
|
<Link href="/">
|
||||||
<HudozkaLogo dark={dark} />
|
<HudozkaLogo />
|
||||||
</Link>
|
</Link>
|
||||||
|
|
||||||
<Menu
|
<Menu
|
||||||
|
|||||||
@@ -6,8 +6,7 @@ import { MenuContext } from "@/context/MenuContext"
|
|||||||
import { Box } from "@/ui/Box"
|
import { Box } from "@/ui/Box"
|
||||||
import { Spacer } from "../Spacer"
|
import { Spacer } from "../Spacer"
|
||||||
import { useToggle } from "react-use"
|
import { useToggle } from "react-use"
|
||||||
import { HudozkaLogo } from "../HudozkaLogo"
|
import HudozkaLogo from "../HudozkaLogo"
|
||||||
import { useDarkTheme } from "@/hooks/useDarkTheme"
|
|
||||||
import { HudozkaTitle } from "../HudozkaTitle"
|
import { HudozkaTitle } from "../HudozkaTitle"
|
||||||
import Link from "next/link"
|
import Link from "next/link"
|
||||||
|
|
||||||
@@ -16,7 +15,6 @@ export type MobileNavigationProps = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const MobileNavigation: React.FC<MobileNavigationProps> = ({ style }) => {
|
export const MobileNavigation: React.FC<MobileNavigationProps> = ({ style }) => {
|
||||||
const dark = useDarkTheme()
|
|
||||||
const [open, toggleOpen] = useToggle(false)
|
const [open, toggleOpen] = useToggle(false)
|
||||||
const menu = useContext(MenuContext)
|
const menu = useContext(MenuContext)
|
||||||
|
|
||||||
@@ -48,7 +46,7 @@ export const MobileNavigation: React.FC<MobileNavigationProps> = ({ style }) =>
|
|||||||
|
|
||||||
<Box wrap gap={"var(--size-s)"} style={style}>
|
<Box wrap gap={"var(--size-s)"} style={style}>
|
||||||
<Link href="/">
|
<Link href="/">
|
||||||
<HudozkaLogo dark={dark} />
|
<HudozkaLogo />
|
||||||
</Link>
|
</Link>
|
||||||
<HudozkaTitle compact />
|
<HudozkaTitle compact />
|
||||||
<Spacer />
|
<Spacer />
|
||||||
|
|||||||
Reference in new issue
Block a user