Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 로그인 후 홈 화면 구현 #10

Merged
merged 4 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 107 additions & 0 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"framer-motion": "^11.2.10",
"ip-address": "^9.0.5",
"react": "^18.2.0",
"react-calendar": "^5.0.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.51.5",
"react-router-dom": "^6.23.1",
Expand Down
10 changes: 10 additions & 0 deletions src/assets/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 9 additions & 9 deletions src/pages/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Flex } from '@chakra-ui/react';
import { Image, Flex, Box } from '@chakra-ui/react';
import { useNavigate } from 'react-router-dom';
import { http, PATH, styleToken } from '@/shared';
import { BaseButton, HomeContainer, Typography } from '@/shared/components';
import { BaseButton, HomeContainer } from '@/shared/components';

export const Main = () => {
const navigate = useNavigate();
Expand All @@ -26,16 +26,16 @@ export const Main = () => {

return (
<HomeContainer>
<Typography
variant="h1"
<Box
width="300px"
height="auto"
style={{
width: '100%',
margin: '20px 0',
textAlign: 'center',
paddingLeft: '14px',
marginBottom: '30px',
}}
>
Review with AI
</Typography>
<Image src="/src/assets/logo.svg" alt="복습할고양 로고" />
</Box>
<Flex direction="column" gap="14px">
<BaseButton
type="button"
Expand Down
42 changes: 33 additions & 9 deletions src/pages/home/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
import { Body } from '@/shared';
import { useState } from 'react';
import Calendar from 'react-calendar';
import 'react-calendar/dist/Calendar.css';
import '@/shared/components/Calendar/CustomCalendar.css';
import { Body, HomeAside } from '@/shared';
import { Nav } from '@/shared/components/Nav';
import { NoteList } from '@/shared/components/NoteList';

export const Home = () => (
<>
<Nav />
<Body>
<h1>home</h1>
</Body>
</>
);
export const Home = () => {
const [date, setDate] = useState(new Date());

const onChangeDate = (newDate: Date) => {
setDate(newDate);
};

return (
<>
<Nav />
<Body>
<h1>home</h1>
<NoteList />
</Body>
<HomeAside>
<Calendar
prev2Label={null}
next2Label={null}
formatDay={(_, date) => date.getDate().toString()}
calendarType="gregory"
value={date}
onChange={onChangeDate}
/>
</HomeAside>
</>
);
};
10 changes: 5 additions & 5 deletions src/pages/setting/Setting.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useState } from 'react';
import { useState } from 'react';
import { Box, Flex } from '@chakra-ui/react';
import styled from '@emotion/styled';
import { useNavigate } from 'react-router-dom';
Expand Down Expand Up @@ -37,14 +37,14 @@ export const Setting = () => {
setUser(responseInfo.data);
} catch (e) {
handleAxiosError(e);
alert('로그인이 필요한 서비스입니다.');
// alert('로그인이 필요한 서비스입니다.');
// navigate(PATH.MAIN);
}
};

useEffect(() => {
getUserInfo();
}, []);
// useEffect(() => {
// getUserInfo();
// }, []);

return (
<>
Expand Down
Loading
Loading