-
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.
* docs: svg 파일 추가 * feat: snb 내부 item 컴포넌트 구현 * refactor: PageIndicatorStick 리펙토링 * feat: SideNavBar 구현 * fix: SideNavBar 적용 * chore: merge develop * feat: SNB item storybook 작성 * chore: 사소한 변경 * refactor: 레싸바 장례식ㅠ * chore: SideNavBar 적용 * fix: 코드리뷰 반영 * fix: build 에러 해결 * feat: framer-motion 적용 * chore: conflict 해결
- Loading branch information
Showing
24 changed files
with
362 additions
and
284 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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 { css } from '@emotion/react'; | ||
|
||
import { theme } from '@/common/style/theme/theme'; | ||
|
||
export const itemStyle = (isClicked: boolean) => | ||
css({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
|
||
width: '3.6rem', | ||
height: '3.6rem', | ||
padding: '0.1rem', | ||
|
||
backgroundColor: theme.colors.gray_100, | ||
borderRadius: '10px', | ||
border: isClicked ? `1px solid ${theme.colors.key_500}` : 0, | ||
|
||
'&:hover': { | ||
border: `1px solid ${theme.colors.key_500}`, | ||
}, | ||
|
||
cursor: 'pointer', | ||
}); | ||
|
||
export const indicatorStyle = css({ | ||
position: 'absolute', | ||
left: 0, | ||
}); | ||
|
||
export const firstSpellStyle = css({ | ||
font: `${theme.text.body06}`, | ||
color: theme.colors.gray_500, | ||
}); | ||
|
||
export const pageIndicatorStyle = (isClicked: boolean, isHover: boolean) => | ||
css({ | ||
width: '0.4rem', | ||
height: isClicked ? '2.4rem' : isHover ? '1.6rem' : 0, | ||
|
||
borderRadius: '0 100px 100px 0', | ||
backgroundColor: isClicked ? theme.colors.key_500 : isHover ? theme.colors.key_300 : theme.colors.white, | ||
}); |
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,60 @@ | ||
import { motion } from 'framer-motion'; | ||
|
||
import { HTMLAttributes, useState } from 'react'; | ||
|
||
import Flex from '@/common/component/Flex/Flex'; | ||
import ToolTip from '@/common/component/ToolTip/ToolTip'; | ||
|
||
import { | ||
firstSpellStyle, | ||
indicatorStyle, | ||
itemStyle, | ||
pageIndicatorStyle, | ||
} from '@/shared/component/SideNavBar/Item/Item.style'; | ||
|
||
interface ItemProps extends HTMLAttributes<HTMLDivElement> { | ||
hoverMessage: string; | ||
logoUrl: string | null; | ||
isClicked: boolean; | ||
onLogoClick: () => void; | ||
} | ||
|
||
const Item = ({ logoUrl = '', isClicked, onLogoClick, hoverMessage, ...props }: ItemProps) => { | ||
const [isHover, setIsHover] = useState(false); | ||
|
||
const handleMouseEnter = () => { | ||
setIsHover(true); | ||
}; | ||
|
||
const handleMouseLeave = () => { | ||
setIsHover(false); | ||
}; | ||
|
||
const handleEnterKeyDown = (e: React.KeyboardEvent<HTMLDivElement>) => { | ||
if (e.key === 'Enter') { | ||
onLogoClick(); | ||
} | ||
}; | ||
|
||
return ( | ||
<Flex tag="li" styles={{ align: 'center', justify: 'center', padding: '2rem' }} {...props}> | ||
{isClicked && ( | ||
<motion.div layoutId="snb_indicator" css={[pageIndicatorStyle(isClicked, isHover), indicatorStyle]} /> | ||
)} | ||
<ToolTip message={hoverMessage} position="right" gap={0.8}> | ||
<div | ||
role="button" | ||
tabIndex={0} | ||
css={itemStyle(isClicked)} | ||
onClick={onLogoClick} | ||
onKeyDown={handleEnterKeyDown} | ||
onMouseEnter={handleMouseEnter} | ||
onMouseLeave={handleMouseLeave}> | ||
{logoUrl ? <img src={logoUrl} alt="버튼 아이콘" /> : <span css={firstSpellStyle}>{hoverMessage[0]}</span>} | ||
</div> | ||
</ToolTip> | ||
</Flex> | ||
); | ||
}; | ||
|
||
export default Item; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.