Skip to content

Commit

Permalink
feat :: header에서 link
Browse files Browse the repository at this point in the history
  • Loading branch information
dutexion committed Feb 3, 2024
1 parent 7145988 commit 11d9bec
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
6 changes: 4 additions & 2 deletions packages/user/src/components/Header/Logo.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
import styled from '@emotion/styled';
import LogoImg from '../../assets/logo.svg';
import { theme } from '@merge/design-system';
import { Link } from 'react-router-dom';

export const Logo = () => {
return (
<Wrapper>
<Wrapper to={'/'}>
<img src={LogoImg} />
Merge
</Wrapper>
);
};

const Wrapper = styled.div`
const Wrapper = styled(Link)`
display: flex;
align-items: center;
color: ${theme.color.primary500};
font-weight: 700;
font-size: 24px;
gap: 8px;
text-decoration: none;
`;
15 changes: 8 additions & 7 deletions packages/user/src/components/Header/Menu.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import styled from '@emotion/styled';
import { Button } from '@merge/design-system';
import { useNavigate } from 'react-router-dom';

type menuProps = {
isLogin: boolean;
};

export const Menu = ({ isLogin }: menuProps) => {
const link = useNavigate();

const onSignIn = () => {
link('/signin');
};

return (
<Wrapper>
{isLogin ? (
Expand All @@ -22,13 +29,7 @@ export const Menu = ({ isLogin }: menuProps) => {
</Button>
</>
) : (
<Button
buttonStyle="solid"
size="extraSmall"
onClick={() => {
console.log(123);
}}
>
<Button buttonStyle="solid" size="extraSmall" onClick={onSignIn}>
로그인
</Button>
)}
Expand Down
2 changes: 1 addition & 1 deletion packages/user/src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const Header = () => {
<>
<Wrapper>
<Logo />
<Menu isLogin={true} />
<Menu isLogin={false} />
</Wrapper>
<Outlet />
</>
Expand Down

0 comments on commit 11d9bec

Please sign in to comment.