Skip to content

Commit

Permalink
fix: 헤더 navigate 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
seung365 committed Aug 7, 2024
1 parent 3ae8be9 commit 1faa03b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/Layout/Header/HeaderWithout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import styled from '@emotion/styled';
import { Link } from 'react-router-dom';
import { Link, useNavigate } from 'react-router-dom';
import { Button } from '@chakra-ui/react';
import { breakpoints } from '@/styles/variants';
import { useMail } from '@/Provider/MailContext';
Expand All @@ -13,6 +13,7 @@ export const Header = () => {
throw new Error('MailContext not found');
}
const { handleMail } = mailContext;
const navigate = useNavigate();

const handleMailInput = () => {
handleMail({
Expand All @@ -23,6 +24,7 @@ export const Header = () => {
subject: '',
receiver: '',
});
navigate(RouterPath.mail);
};

const { authInfo } = useAuth();
Expand All @@ -46,9 +48,7 @@ export const Header = () => {
<Logo src="/images/logo.svg" />
</LogoLink>
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
<Link to={RouterPath.mail} style={{ display: 'flex', alignItems: 'center' }}>
<AiButton onClick={handleMailInput}>AI 메일 생성하기</AiButton>
</Link>
<AiButton onClick={handleMailInput}>AI 메일 생성하기</AiButton>
</div>
</Container>
</Wrapper>
Expand Down

0 comments on commit 1faa03b

Please sign in to comment.