Skip to content

Commit

Permalink
Merge pull request #17 from prgrms-fe-devcourse/12-feat/headercomponent
Browse files Browse the repository at this point in the history
12 feat/headercomponent
  • Loading branch information
cmlim0070 authored Oct 25, 2024
2 parents 98122d0 + 1340e91 commit 3087784
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 0 deletions.
9 changes: 9 additions & 0 deletions public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added src/widgets/header/index.tsx
Empty file.
20 changes: 20 additions & 0 deletions src/widgets/header/ui/Header.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import type { Meta, StoryObj } from '@storybook/react'
import Header from './Header'

const meta = {
title: 'Widgets/Header',
component: Header,
parameters: {
layout: 'fullscreen',
},
tags: ['autodocs'],
} satisfies Meta<typeof Header>

export default meta
type Story = StoryObj<typeof Header>

export const Default: Story = {
args: {
isLoggedIn: false,
},
}
34 changes: 34 additions & 0 deletions src/widgets/header/ui/Header.styled.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import styled from 'styled-components'

export const Container = styled.header`
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0.5rem;
margin: 0 10% 0 10%;
`

export const Logo = styled.div`
display: flex;
cursor: pointer;
`

export const Nav = styled.div`
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
gap: 1rem;
font-size: 15px;
`

export const NavItem = styled.div`
display: flex;
border-radius: 10%;
padding: 1rem;
cursor: pointer;
&:hover {
background-color: #f2f2f2;
}
`
19 changes: 19 additions & 0 deletions src/widgets/header/ui/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Container, Logo, Nav, NavItem } from './Header.styled'

const Header = () => {
return (
<Container>
<Logo>
<img src="/logo.svg" alt="logo" />
</Logo>
<Nav>
<NavItem>ํ™ˆ</NavItem>
<NavItem>ํƒ€์ž„๋ผ์ธ</NavItem>
<NavItem>๋‚ด ์ผ๊ธฐ</NavItem>
<NavItem>๋งˆ์ดํŽ˜์ด์ง€</NavItem>
</Nav>
</Container>
)
}

export default Header

0 comments on commit 3087784

Please sign in to comment.