diff --git a/packages/dappkit b/packages/dappkit index 6802c581..49cb1b4e 160000 --- a/packages/dappkit +++ b/packages/dappkit @@ -1 +1 @@ -Subproject commit 6802c5810216f8637a904753511f8c1fb226f42a +Subproject commit 49cb1b4e4696c5688d18a287728ea0a8fc6b4811 diff --git a/src/components/element/SwitchMode.tsx b/src/components/element/SwitchMode.tsx index 1ebe8951..1379ae9d 100644 --- a/src/components/element/SwitchMode.tsx +++ b/src/components/element/SwitchMode.tsx @@ -5,6 +5,7 @@ import { useMemo } from "react"; export default function SwitchMode() { const { mode, toggleMode } = useTheme(); const canSwitchModes = useMemo(() => !(!config.modes || config.modes?.length === 1), []); + return ( canSwitchModes && ( + <> + + + ); } @@ -50,34 +53,45 @@ export default function SearchBar({ icon = false }: SearchBarProps) { return ( - + {entries .filter(([_, res]) => res?.length) .map(([category, results]) => ( - + {titles[category]} - + {results.map((_, i) => { switch (category) { case "chain": return ( - + <> + + + ); case "opportunity": return ; case "token": return ( - + <> + + + ); case "protocol": return ( - + <> + + + ); default: break; @@ -93,11 +107,17 @@ export default function SearchBar({ icon = false }: SearchBarProps) { return ( - + } + /> {Results} }> diff --git a/src/components/element/opportunity/OpportunityFilters.tsx b/src/components/element/opportunity/OpportunityFilters.tsx index a7f826c8..82e38c2f 100644 --- a/src/components/element/opportunity/OpportunityFilters.tsx +++ b/src/components/element/opportunity/OpportunityFilters.tsx @@ -95,14 +95,14 @@ export default function OpportunityFilters({ only, exclude, chains }: Opportunit } return ( - + {fields.includes("search") && (
} + suffix={} onClick={onSearchSubmit} placeholder="Search" /> @@ -114,7 +114,6 @@ export default function OpportunityFilters({ only, exclude, chains }: Opportunit allOption={"All actions"} multiple options={actionOptions} - size="sm" look="bold" placeholder="Actions" /> @@ -125,7 +124,6 @@ export default function OpportunityFilters({ only, exclude, chains }: Opportunit allOption={"All status"} multiple options={statusOptions} - size="sm" look="bold" placeholder="Status" /> @@ -137,7 +135,6 @@ export default function OpportunityFilters({ only, exclude, chains }: Opportunit multiple search options={chainOptions} - size="sm" look="bold" placeholder="Chains" /> diff --git a/src/components/layout/Header.tsx b/src/components/layout/Header.tsx index 4898ce24..12423c6b 100644 --- a/src/components/layout/Header.tsx +++ b/src/components/layout/Header.tsx @@ -7,8 +7,8 @@ import { motion } from "framer-motion"; import config from "merkl.config"; import { useWalletContext } from "packages/dappkit/src/context/Wallet.context"; import { useMemo, useState } from "react"; -import { useMediaQuery } from "react-responsive"; -import SCREENS from "../../../packages/dappkit/src/constants/SCREENS.json"; +import SwitchMode from "../element/SwitchMode"; +import SearchBar from "../element/functions/SearchBar"; import { LayerMenu } from "./LayerMenu"; const container = { @@ -30,13 +30,9 @@ const item = { }; export default function Header() { - const { mode, toggleMode } = useTheme(); + const { mode } = useTheme(); const { address: user } = useWalletContext(); const [open, setOpen] = useState(false); - const mdScreens = useMediaQuery({ maxWidth: SCREENS.lg }); - - const smScreens = useMediaQuery({ maxWidth: SCREENS.md }); - const canSwitchModes = useMemo(() => !(!config.modes || config.modes?.length === 1), []); const routes = useMemo(() => { const { homepage, ...rest } = config.routes; @@ -63,49 +59,51 @@ export default function Header() { - {mdScreens ? ( - } - className="flex gap-sm md:gap-lg items-center"> - {`${config.appName} - - - ) : ( - - )} + } + className="lg:hidden flex gap-sm md:gap-lg items-center"> + {`${config.appName} + + + + - - {!mdScreens && - Object.entries(routes) + + + {Object.entries(config.routes) .filter(([key]) => !["homepage", "privacy", "terms"].includes(key)) .map(([key, { route }]) => { return ( - ); })} - {canSwitchModes && ( - - )} - {!smScreens && } + + + + + + + + + + diff --git a/src/components/layout/LayerMenu.tsx b/src/components/layout/LayerMenu.tsx index 4731d06e..9d2581ac 100644 --- a/src/components/layout/LayerMenu.tsx +++ b/src/components/layout/LayerMenu.tsx @@ -2,9 +2,7 @@ import { NavLink } from "@remix-run/react"; import { Divider, Group, Text, WalletButton } from "dappkit"; import { Icon } from "packages/dappkit/src"; import type { FC } from "react"; -import { useMediaQuery } from "react-responsive"; import type { routesType } from "src/config/type"; -import SCREENS from "../../../packages/dappkit/src/constants/SCREENS.json"; import SwitchMode from "../element/SwitchMode"; import SearchBar from "../element/functions/SearchBar"; @@ -12,7 +10,6 @@ export const LayerMenu: FC<{ nav: routesType; setOpen: (open: boolean) => void; }> = ({ nav, setOpen }) => { - const smScreens = useMediaQuery({ maxWidth: SCREENS.md }); return (
@@ -37,15 +34,16 @@ export const LayerMenu: FC<{
diff --git a/src/customer/assets/style/shorthands.css b/src/customer/assets/style/shorthands.css index 0a0de72b..8ba2bc16 100644 --- a/src/customer/assets/style/shorthands.css +++ b/src/customer/assets/style/shorthands.css @@ -12,13 +12,13 @@ @apply opacity-100; } .dim:hover { - @apply opacity-70; + @apply opacity-60; } } :disabled, .disabled { - @apply opacity-40 pointer-events-none; + @apply opacity-60 pointer-events-none; } .faq-item__trigger[data-state="open"] > * {