11import Image from 'next/image' ;
22import Link from 'next/link' ;
3+ import { useMediaQuery } from 'react-responsive' ;
34
4- // import { useMediaQuery } from 'react-responsive';
55import trackClick from '@/lib/trackClick' ;
66
77import * as Anchor from '@/components/Anchor' ;
@@ -11,19 +11,17 @@ import Icon from '@/components/Icon';
1111import Text from '@/components/Text' ;
1212
1313export default function Introduction ( ) {
14- // const isNarrow = useMediaQuery({ query: `(max-width: 834px)` });
15- // const imgClass = isNarrow
16- // ? 'absolute -top-[295px] left-1/2 -z-10 h-[844px] w-[1800px] -translate-x-[640px]'
17- // : 'absolute -top-[275px] left-1/2 -z-10 h-[844px] w-[1800px] -translate-x-[1072px]';
14+ const isNarrow = useMediaQuery ( { query : `(max-width: 834px)` } ) ;
15+ const imgClass = isNarrow
16+ ? 'absolute -top-[295px] left-1/2 -z-10 h-[844px] w-[1800px] -translate-x-[640px]'
17+ : 'absolute -top-[275px] left-1/2 -z-10 h-[844px] w-[1800px] -translate-x-[1072px]' ;
1818
1919 return (
20- // <div className='relative'>
21- // <div className={imgClass}>
2220 // The page gets sized by the overflowing hero image. To keep the page
2321 // width from being affected by the hero, we need to add an
2422 // 'overflow-hidden' to the container div
2523 < div className = 'relative overflow-hidden' >
26- < div className = 'absolute -top-[275px] left-1/2 -z-10 h-[844px] w-[1800px] -translate-x-1/2' >
24+ < div className = { imgClass } >
2725 < Image
2826 priority
2927 className = 'w-full'
0 commit comments