Skip to content

Commit

Permalink
fix: 버튼 타입 오류 수정, 캘린더 타입 및 요일 css 수정 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
ShinjungOh authored Aug 18, 2024
1 parent 38d3e61 commit 08c2749
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
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 {
}

0 comments on commit 08c2749

Please sign in to comment.