diff --git a/components/use-toasts/index.ts b/components/use-toasts/index.ts index a559ff260..ff8b50eeb 100644 --- a/components/use-toasts/index.ts +++ b/components/use-toasts/index.ts @@ -1,4 +1,4 @@ import useToasts from './use-toast' -export type { ToastAction, Toast, ToastType } from './use-toast' +export type { ToastAction, Toast, ToastTypes } from './use-toast' export default useToasts diff --git a/components/use-toasts/use-toast.tsx b/components/use-toasts/use-toast.tsx index bca6d9b11..8abc7822c 100644 --- a/components/use-toasts/use-toast.tsx +++ b/components/use-toasts/use-toast.tsx @@ -10,10 +10,10 @@ export interface ToastAction { handler: (event: React.MouseEvent, cancel: () => void) => void passive?: boolean } -export type ToastType = NormalTypes +export type ToastTypes = NormalTypes export interface Toast { text?: string | React.ReactNode - type?: ToastType + type?: ToastTypes delay?: number actions?: Array } diff --git a/lib/components/layout.tsx b/lib/components/layout.tsx index f2c2c762c..e33a6972b 100644 --- a/lib/components/layout.tsx +++ b/lib/components/layout.tsx @@ -62,7 +62,6 @@ export const Layout: React.FC> = React.memo( display: flex; box-sizing: border-box; } - .sidebar { width: 200px; margin-right: 20px; @@ -76,13 +75,11 @@ export const Layout: React.FC> = React.memo( transition: transform 200ms ease-out; z-index: 100; } - .side-shadow { width: 220px; flex-shrink: 0; height: 100vh; } - .main { display: flex; max-width: calc(100% - 220px); @@ -97,7 +94,7 @@ export const Layout: React.FC> = React.memo( .layout { max-width: 100%; width: 100%; - padding: 5rem 1rem; + padding: 20px 1rem; } .sidebar { @@ -107,11 +104,14 @@ export const Layout: React.FC> = React.memo( right: 0; z-index: 10; width: 100vw; - height: ${expanded ? '100vh' : '0'}; - background-color: ${theme.palette.background}; - padding: 0; + box-sizing: border-box; + height: ${expanded ? '90vh' : '0'}; + background-color: transparent; + backdrop-filter: invert(15%) blur(5px); + padding: var(--geist-page-nav-height) 0 0 0; overflow: hidden; transition: height 250ms ease; + box-shadow: ${expanded ? theme.expressiveness.shadowSmall : 'none'}; } .main { diff --git a/lib/components/menu/menu-links.tsx b/lib/components/menu/menu-links.tsx index 78b937831..672a38a3a 100644 --- a/lib/components/menu/menu-links.tsx +++ b/lib/components/menu/menu-links.tsx @@ -33,7 +33,7 @@ const MenuLinks = () => { position: relative; margin: 0 auto; padding: 0 ${theme.layout.gap}; - height: 60px; + height: var(--geist-page-nav-height); } .site-name { diff --git a/lib/components/menu/menu-sticker.tsx b/lib/components/menu/menu-sticker.tsx index dec89f9ad..6fa7badc3 100644 --- a/lib/components/menu/menu-sticker.tsx +++ b/lib/components/menu/menu-sticker.tsx @@ -1,5 +1,5 @@ import React, { useEffect, useMemo } from 'react' -import { Tabs, useTheme } from 'components' +import { useMediaQuery, Tabs, useTheme } from 'components' import useCurrentState from 'components/utils/use-current-state' import Router from 'next/router' import Metadatas from 'lib/data' @@ -12,10 +12,13 @@ const MenuSticker = () => { const { tabbar: currentUrlTabValue, locale } = useLocale() const [tabValue, setTabValue, tabValueRef] = useCurrentState('') const [fixed, setFixed, fixedRef] = useCurrentState(false) + const isSM = useMediaQuery('sm', { match: 'down' }) + const isXS = useMediaQuery('xs', { match: 'down' }) + const isFixedTabs = fixed && !isXS const tabbarData = useMemo(() => Metadatas[locale], [locale]) - useEffect(() => updateTabbarFixed(fixed), [fixed]) + useEffect(() => updateTabbarFixed(isFixedTabs), [isFixedTabs]) useEffect(() => setTabValue(currentUrlTabValue), [currentUrlTabValue]) useEffect(() => { const scrollHandler = () => { @@ -36,15 +39,18 @@ const MenuSticker = () => { return ( <> -
-