-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from prgrms-web-devcourse-final-project/featur…
…e/QFEED-79 [Feat] QFEED-79 질문 수정 페이지 레이아웃 구현
- Loading branch information
Showing
26 changed files
with
848 additions
and
375 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import Button from './Button'; | ||
|
||
const meta: Meta<typeof Button> = { | ||
title: 'Components/Button', | ||
component: Button, | ||
tags: ['autodocs'], // 자동 문서화를 위한 태그 | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof Button>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
children: '기본 버튼', | ||
}, | ||
}; | ||
|
||
export const Primary: Story = { | ||
args: { | ||
children: '프라이머리 버튼', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { StyledButton } from '@/pages/MyPage/components/Button/Button.styles'; | ||
|
||
interface ButtonProps { | ||
children: React.ReactNode; | ||
onClick?: () => void; // 클릭 이벤트 핸들러 | ||
} | ||
|
||
const Button = ({ children, onClick }: ButtonProps) => { | ||
return ( | ||
<StyledButton onClick={onClick}> | ||
{children} | ||
</StyledButton> | ||
); | ||
}; | ||
|
||
export default Button; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import Header from './Header'; | ||
|
||
const meta: Meta<typeof Header> = { | ||
title: 'Components/Header', | ||
component: Header, | ||
tags: ['autodocs'], | ||
argTypes: { | ||
title: { control: 'text', description: 'The title displayed in the center of the header' }, | ||
className: { control: false, description: 'Optional additional class names' }, | ||
}, | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof Header>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
title: '프로필', | ||
}, | ||
}; | ||
|
||
export const WithoutTitle: Story = { | ||
args: { | ||
title: '', | ||
}, | ||
}; | ||
|
||
export const CustomTitle: Story = { | ||
args: { | ||
title: '마이페이지', | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import styled from '@emotion/styled'; | ||
import theme from '@/styles/theme'; | ||
|
||
export const StyledHeader = styled.header` | ||
width: 100%; | ||
padding: 0.5rem 1.5rem; | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
background-color: ${theme.colors.white}; | ||
`; | ||
|
||
export const LogoWrapper = styled.div` | ||
display: flex; | ||
align-items: center; | ||
cursor: pointer; | ||
`; | ||
|
||
export const Title = styled.h1` | ||
font-size: 1.25rem; | ||
font-family: ${theme.typography.header1.fontFamily.korean}; | ||
font-weight: bold; | ||
color: ${theme.colors.black}; | ||
text-align: center; | ||
flex: 1; | ||
`; | ||
|
||
export const RightSection = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: 0.5rem; | ||
`; | ||
|
||
export const IconButton = styled.button` | ||
background: none; | ||
border: none; | ||
padding: 0.5rem; | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
color: ${theme.colors.black}; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { HiOutlineBell } from 'react-icons/hi'; | ||
import { useNavigate } from 'react-router-dom'; | ||
import Logo from '@/assets/qfeed-logo.svg?react'; | ||
import { | ||
StyledHeader, | ||
LogoWrapper, | ||
Title, | ||
RightSection, | ||
IconButton, | ||
} from '@/pages/MyPage/components/Header/Header.styles' | ||
|
||
interface HeaderProps { | ||
profileImage?: string; | ||
className?: string; | ||
title?: string; | ||
} | ||
|
||
const Header = ({ className, title }: HeaderProps) => { | ||
const navigate = useNavigate(); | ||
|
||
const onLogoClick = () => { | ||
navigate('/'); | ||
}; | ||
|
||
const handleNotificationClick = () => { | ||
navigate('/alarm'); | ||
}; | ||
|
||
return ( | ||
<StyledHeader className={className}> | ||
<LogoWrapper onClick={onLogoClick}> | ||
<Logo /> | ||
</LogoWrapper> | ||
<Title>{title}</Title> | ||
<RightSection> | ||
<IconButton onClick={handleNotificationClick} aria-label="알림"> | ||
<HiOutlineBell size={28} /> | ||
</IconButton> | ||
</RightSection> | ||
</StyledHeader> | ||
); | ||
}; | ||
|
||
export default Header; |
Oops, something went wrong.