add initial contrast theme

This commit is contained in:
tmshv committed 2022-10-12 13:30:39 +06:00
1 parent c4e13e8e1b
commit 3fa99b28de
15 files changed
+168 -20

No files matched your search

+10
View File
@@ -10,6 +10,9 @@ import { useMobile } from "src/hooks/useMobile"
import { Gosuslugi } from "../Gosuslugi"
import { Navigation } from "@/components/Navigation"
import { Box } from "@/ui/Box"
import { Button } from "@/ui/Button"
import { EyeOpenIcon } from "@radix-ui/react-icons"
import { useTheme } from "@/ui/theme/useTheme"
export type AppProps = {
showAuthor?: boolean
@@ -25,6 +28,7 @@ export const App: React.FC<AppProps> = ({ showAuthor = false, menu, ...props })
const blockStyle = {
justifyContent: "center",
}
const { theme, setTheme } = useTheme()
return (
<ConfigContext.Provider value={{
@@ -61,6 +65,12 @@ export const App: React.FC<AppProps> = ({ showAuthor = false, menu, ...props })
}}>
<Gosuslugi />
</div>
<Button theme="icon" size="default" onClick={() => {
setTheme(theme === "default" ? "contrast" : "default")
}}>
<EyeOpenIcon width={24} height={24} />
</Button>
</Footer>
)}
>
+5 -4
View File
@@ -5,6 +5,8 @@
box-shadow: var(--shadow);
overflow: hidden;
transition: box-shadow 150ms;
border: var(--border);
}
.card:hover {
@@ -52,8 +54,8 @@
border-radius: var(--radius) var(--radius) 0 0;
width: 100%;
height: var(--radius);
top: calc(var(--radius) * -1);
height: var(--size-m);
top: calc(var(--size-m) * -1);
left: 0;
}
@@ -68,10 +70,9 @@
position: absolute;
--offset: var(--size-m);
--r: var(--size-s);
left: var(--offset);
right: var(--offset);
bottom: var(--offset);
border-radius: var(--radius) var(--radius) var(--r) var(--r);
border-radius: var(--radius-small);
}
+13 -4
View File
@@ -6,6 +6,7 @@ import { Author } from "./Author"
import { Spacer } from "../Spacer"
import { Contacts } from "../Contacts"
import { Box } from "@/ui/Box"
import { Panel } from "@/ui/Panel"
export type FooterProps = {
showAuthor: boolean
@@ -14,10 +15,18 @@ export type FooterProps = {
export const Footer: React.FC<FooterProps> = ({ showAuthor, children }) => (
<footer className={cx(s.footer, "opposite")}>
<Box vertical align={false} style={{
marginBottom: "var(--size-l)",
}}>
<Contacts />
<Box>
<Box vertical align={false} style={{
marginBottom: "var(--size-l)",
}}>
<Contacts />
</Box>
<Panel style={{
marginBottom: "var(--size-l)",
}}>
<Contacts />
</Panel>
</Box>
{children}
+7 -1
View File
@@ -21,7 +21,7 @@
.menuItem {
user-select: none;
background-color: var(--color-back-main);
border-radius: var(--size-s);
border-radius: var(--radius-small);
transition: box-shadow 200ms ease-in, background-color 200ms ease-in;
padding: var(--size-s) var(--size-s);
}
@@ -32,6 +32,12 @@
.menuItem.active:hover {
box-shadow: var(--shadow);
color: var(--color-hover);
background-color: var(--color-hover-back);
}
.menuItem.active:hover a {
color: var(--color-hover);
}
.menuItem.current {
+2
View File
@@ -7,6 +7,8 @@ import { ConfigContext } from "src/context/ConfigContext"
import { Box } from "@/ui/Box"
import { Spacer } from "../Spacer"
import { useToggle } from "react-use"
import { Button } from "@/ui/Button"
import { EyeOpenIcon } from "@radix-ui/react-icons"
export type NavigationProps = {
style?: React.CSSProperties
+14 -9
View File
@@ -1,6 +1,7 @@
import s from "./wrapper.module.css"
import cx from "classnames"
import { useTheme } from "@/ui/theme/useTheme"
export type WrapperProps = {
header: React.ReactNode
@@ -10,14 +11,18 @@ export type WrapperProps = {
children?: React.ReactNode
}
export const Wrapper: React.FC<WrapperProps> = props => (
<div className={cx(s.container, "theme-default")} style={props.style}>
{props.header}
export const Wrapper: React.FC<WrapperProps> = props => {
const { theme } = useTheme()
<main className={s.main} style={props.mainStyle}>
{props.children}
</main>
return (
<div className={cx(s.container, `theme-${theme}`)} style={props.style}>
{props.header}
{props.footer}
</div>
)
<main className={s.main} style={props.mainStyle}>
{props.children}
</main>
{props.footer}
</div>
)
}