diff --git a/components/Hero/Hero.tsx b/components/Hero/Hero.tsx index 1334011..20f58aa 100644 --- a/components/Hero/Hero.tsx +++ b/components/Hero/Hero.tsx @@ -1,7 +1,6 @@ import { Typography } from '@mochi-ui/core' import clsx from 'clsx' import { Fragment, ReactNode } from 'react' -import { useIsMobile } from '@/hooks/useIsMobile' type HeroProps = { title: string @@ -20,8 +19,6 @@ export const Hero = ({ contentClassName, heroImgUrl, }: HeroProps) => { - const isMobile = useIsMobile() - return (
+ +
diff --git a/components/Logo/Logo.tsx b/components/Logo/Logo.tsx index 5684454..fe87bf0 100644 --- a/components/Logo/Logo.tsx +++ b/components/Logo/Logo.tsx @@ -1,25 +1,34 @@ -import { useIsMobile } from '@/hooks/useIsMobile' import { ImageWithFallback, ImageWithFallbackProps, } from '@/components/ImageWithFallback' +import clsx from 'clsx' export const Logo = (props: Partial) => { - const { src, fallbackImgUrl, ...rest } = props - const isMobile = useIsMobile() + const { src, fallbackImgUrl, className, ...rest } = props return ( - + <> + + + ) } diff --git a/components/pages/home/DesignGuideView/DesignGuide.tsx b/components/pages/home/DesignGuideView/DesignGuide.tsx index 0fa0bb0..5d18a38 100644 --- a/components/pages/home/DesignGuideView/DesignGuide.tsx +++ b/components/pages/home/DesignGuideView/DesignGuide.tsx @@ -4,11 +4,8 @@ import PaperplaneCircle from '@mochi-ui/icons/solid/paperplane-circle' import clsx from 'clsx' import { DesignGuideCardItem } from './DesignGuideCardItem' import { DOCS_LINK, MOCHI_DISCORD_LINK } from '@/constants/url' -import { useIsMobile } from '@/hooks/useIsMobile' export const DesignGuide = ({ className }: { className?: string }) => { - const isMobile = useIsMobile() - return (
@@ -21,7 +18,7 @@ export const DesignGuide = ({ className }: { className?: string }) => {
@@ -42,7 +39,7 @@ export const DesignGuide = ({ className }: { className?: string }) => { /> diff --git a/components/pages/home/DesignGuideView/DesignGuideCardItem.tsx b/components/pages/home/DesignGuideView/DesignGuideCardItem.tsx index b9ebc5f..db0f402 100644 --- a/components/pages/home/DesignGuideView/DesignGuideCardItem.tsx +++ b/components/pages/home/DesignGuideView/DesignGuideCardItem.tsx @@ -40,6 +40,16 @@ export const DesignGuideCardItem = (props: DesignGuideCardItemProps) => { width={170} height={170} loading="lazy" + className="hidden md:block" + /> +
) : null} diff --git a/components/pages/home/RichComponentsView/Card.tsx b/components/pages/home/RichComponentsView/Card.tsx index d85ad57..ba945bd 100644 --- a/components/pages/home/RichComponentsView/Card.tsx +++ b/components/pages/home/RichComponentsView/Card.tsx @@ -12,7 +12,6 @@ import { TrashBinLine, EditLine, } from '@mochi-ui/icons' -import { useIsMobile } from '@/hooks/useIsMobile' const cardContent = [ { @@ -40,19 +39,10 @@ const cardContent = [ ] export const CardShowcase = () => { - const isMobile = useIsMobile() - return (
-
+
diff --git a/components/pages/home/RichComponentsView/Dropdown.tsx b/components/pages/home/RichComponentsView/Dropdown.tsx index 2ab2701..ab663cf 100644 --- a/components/pages/home/RichComponentsView/Dropdown.tsx +++ b/components/pages/home/RichComponentsView/Dropdown.tsx @@ -15,14 +15,11 @@ import { UserSolid, } from '@mochi-ui/icons' import { useEffect, useState } from 'react' -import { useIsMobile } from '@/hooks/useIsMobile' export const DropdownShowcase = () => { const [isOpened, setIsOpened] = useState(false) const [switchState, setSwitchState] = useState(false) - const isMobile = useIsMobile() - useEffect(() => { const timeout = setTimeout(() => { setIsOpened(true) @@ -42,10 +39,16 @@ export const DropdownShowcase = () => {
+
diff --git a/components/pages/home/RichComponentsView/Modal.tsx b/components/pages/home/RichComponentsView/Modal.tsx index 0ea0baa..3e6c3a3 100644 --- a/components/pages/home/RichComponentsView/Modal.tsx +++ b/components/pages/home/RichComponentsView/Modal.tsx @@ -10,14 +10,11 @@ import { SolidDotSolid } from '@mochi-ui/icons' import clsx from 'clsx' import { useState } from 'react' import { ImageWithFallback } from '@/components/ImageWithFallback' -import { useIsMobile } from '@/hooks/useIsMobile' export const ModalShowcase = () => { const [isOpened, setIsOpened] = useState(true) const [isConfirming, setIsConfirming] = useState(false) - const isMobile = useIsMobile() - const onConfirm = () => { setIsConfirming(true) setTimeout(() => { @@ -38,11 +35,21 @@ export const ModalShowcase = () => {
+ { - const isMobile = useIsMobile() - return (
{ - setIsSSR(false) - }, []) - - const isMobile = useMedia([`(max-width: 767px)`], [true], false) - - return isSSR ? true : isMobile -} diff --git a/pages/index.tsx b/pages/index.tsx index 16f0e2d..93cbd04 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -64,20 +64,12 @@ export default function Home() { title="Mochi UI Kit" description="Help designers and developers create eye-catching and adaptable products using different Web3 frameworks effortlessly." actions={[ - + , - + , ]}