summaryrefslogtreecommitdiff
path: root/src-migrate/modules/popup-information/index.tsx
blob: 0d36f8e9b661ca1da9d206f1722ebc0c908072c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { useRouter } from 'next/router';
import { useEffect, useState } from 'react';

import { Modal } from "~/components/ui/modal";
import { getAuth } from '~/libs/auth';
import PageContent from '../page-content';

const PagePopupInformation = () => {
  const router = useRouter();
  const isHomePage = router.pathname === '/';
  const auth = getAuth();
  const [active, setActive] = useState<boolean>(false);

  useEffect(() => {
    if (isHomePage && !auth) setActive(true);
  }, [isHomePage, auth]);
  return (
    <div className='group'>
      <Modal
        active={active}
        className='!w-fit !bg-transparent !border-none overflow-hidden'
        close={() => setActive(false)}
        mode='desktop'
      >
        <div className='w-[350px] md:w-[530px]' onClick={() => setActive(false)}>
          <PageContent path='/onbording-popup' />
        </div>
      </Modal>
    </div>
  );
};

export default PagePopupInformation;