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

fix: 타입 오류 해결 #16

Merged
merged 1 commit into from
Aug 18, 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
12 changes: 6 additions & 6 deletions src/pages/home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import { Body, HomeAside } from '@/shared';
import { Nav } from '@/shared/components/Nav';
import { NoteList } from '@/shared/components/NoteList';

export const Home = () => {
const [date, setDate] = useState(new Date());
type OptionalDate = Date | null;

type DateSelection = OptionalDate | [OptionalDate, OptionalDate];

const onChangeDate = (newDate: Date) => {
setDate(newDate);
};
export const Home = () => {
const [date, setDate] = useState<DateSelection>(new Date());

return (
<>
Expand All @@ -29,7 +29,7 @@ export const Home = () => {
formatDay={(_, date) => date.getDate().toString()}
calendarType="gregory"
value={date}
onChange={onChangeDate}
onChange={setDate}
/>
</HomeAside>
</>
Expand Down
26 changes: 14 additions & 12 deletions src/pages/setting/Setting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from 'react';
import { Box, Flex } from '@chakra-ui/react';
import styled from '@emotion/styled';
import { useNavigate } from 'react-router-dom';
import { BaseButton, Body, handleAxiosError, http, PATH, styleToken, Typography } from '@/shared';
import { BaseButton, Body, PATH, styleToken, Typography } from '@/shared';
import { Nav } from '@/shared/components/Nav';

type User = {
Expand Down Expand Up @@ -30,17 +30,19 @@ export const Setting = () => {
navigate(PATH.MAIN);
};

const getUserInfo = async () => {
try {
const responseInfo = await http.get('/api/v1/user/me');
console.log(responseInfo);
setUser(responseInfo.data);
} catch (e) {
handleAxiosError(e);
// alert('로그인이 필요한 서비스입니다.');
// navigate(PATH.MAIN);
}
};
console.log(setUser);

// const getUserInfo = async () => {
// try {
// const responseInfo = await http.get('/api/v1/user/me');
// console.log(responseInfo);
// setUser(responseInfo.data);
// } catch (e) {
// handleAxiosError(e);
// alert('로그인이 필요한 서비스입니다.');
// navigate(PATH.MAIN);
// }
// };

// useEffect(() => {
// getUserInfo();
Expand Down
4 changes: 2 additions & 2 deletions src/shared/components/Button/BaseButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { HTMLAttributes, PropsWithChildren } from 'react';
import React, { HTMLAttributes, PropsWithChildren } from 'react';
import { Button, ButtonProps } from '@chakra-ui/react';
import { customTheme, Typography, TypographyVariant } from '@/shared';

Expand All @@ -8,7 +8,7 @@ type BaseButtonProps = {
font?: TypographyVariant;
fontColor?: string;
img?: React.ReactNode;
children?: string;
children?: React.ReactNode;
isDisabled?: boolean;
onClick?: () => void;
} & HTMLAttributes<HTMLButtonElement>;
Expand Down
10 changes: 7 additions & 3 deletions src/shared/components/Calendar/CustomCalendar.css
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@
padding: 0.5em;
}

.react-calendar__month-view__weekdays__weekday abbr,
.react-calendar__month-view__weekdays__weekday--weekend abbr,
.react-calendar__month-view__weekdays__weekday abbr[title],
.react-calendar__tile abbr {
text-decoration: none;
}

.react-calendar__month-view__weekNumbers .react-calendar__tile {
display: flex;
align-items: center;
Expand Down Expand Up @@ -138,6 +145,3 @@
background-color: #e6e6e6;
border-radius: 0;
}

.react-calendar__tile abbr {
}
Loading