-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpage.tsx
More file actions
37 lines (32 loc) · 800 Bytes
/
page.tsx
File metadata and controls
37 lines (32 loc) · 800 Bytes
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
34
35
36
37
'use client';
import Loader, { LoaderContainer } from '@/components/common/Loader';
import { getAccessToken } from '@/utils/storage';
import { useRouter } from 'next/navigation';
import { useEffect } from 'react';
import styled from 'styled-components';
export default function Home() {
const router = useRouter();
const accessToken = getAccessToken();
useEffect(() => {
if (!accessToken) {
router.push('/login');
} else {
router.push('/planet');
}
}, []);
return (
<Container>
<LoaderContainer>
<Loader />
</LoaderContainer>
</Container>
);
}
const Container = styled.div`
display: flex;
box-sizing: border-box;
flex-direction: column;
height: 100vh;
padding: 25px;
background: ${(props) => props.theme.colors.bg};
`;