-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* refactor: memberImage 컴포넌트 마이그레이션 및 props 수정 * refactor: memberInfo 컴포넌트 마이그레이션 및 디자인 수정 * feat: postCounterBox 컴포넌트 구현 * refactor: memberPage 마이그레이션 * feat: memberPostPage 구현 * feat: starRating 컴포넌트 구현 * refactor: memberReviewItem 컴포넌트 마이그레이션 및 수정 * refactor: memberReviewList 컴포넌트 디자인 수정 * refactor: 세부 디자인 수정 * refactor: memberRecipeList 디자인 수정 * refactor: 세부 레이아웃 수정 * refactor: 필요없는 css 삭제 * refactor: 화살표 svg 위치 수정 * chore: 사용하지 않는 페이지 삭제 * fix: webpack vanilla error hash 값 추가하여 해결 * refactor: review item 일부 컴포넌트로 분리 * feat: 작성한 꿀조합/리뷰 클릭에 따른 페이지 이동 구현 * chore: 사용하지 않는 css 삭제 * refactor: member에 recipeCount, reviewCount 추가 * refactor: 세부 디자인 반영 * refactor: camera2 아이콘 교체 * chore: svg 속성 카멜 케이스로 자동 변경 * fix: css 순서 오류 방지 * chore: lint 적용 * refactor: memberModifyInput 스타일 마이그레이션 및 수정 * refactor: 레이아웃 변경 * refactor: memberModifyPage 디자인 마이그레이션 및 수정 * chore: 주석 추가
- Loading branch information
Showing
58 changed files
with
906 additions
and
729 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import StarRating from './StarRating'; | ||
|
||
const meta: Meta<typeof StarRating> = { | ||
title: 'common/StarRating', | ||
component: StarRating, | ||
args: { | ||
rating: 4.5, | ||
createdAt: '2021-09-01T00:00:00.000Z', | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = {}; |
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,37 @@ | ||
import { date, ratingInfo, ratingNumber, ratingWrapper } from './starRating.css'; | ||
import SvgIcon from '../Svg/SvgIcon'; | ||
import Text from '../Text/Text'; | ||
|
||
import { vars } from '@/styles/theme.css'; | ||
import { getRelativeDate } from '@/utils/date'; | ||
|
||
interface StarRatingProps { | ||
rating: number; | ||
createdAt: string; | ||
} | ||
|
||
const StarRating = ({ rating, createdAt }: StarRatingProps) => { | ||
return ( | ||
<div className={ratingWrapper}> | ||
<div className={ratingInfo}> | ||
<Text as="span" size="caption3" weight="medium" className={ratingNumber}> | ||
{rating.toFixed(1)} | ||
</Text> | ||
{Array.from({ length: 5 }, (_, index) => ( | ||
<SvgIcon | ||
key={`rating-${index}`} | ||
variant="star2" | ||
fill={index < rating ? vars.colors.icon.fill : vars.colors.icon.light} | ||
width={13} | ||
height={13} | ||
/> | ||
))} | ||
</div> | ||
<Text as="span" size="caption4" color="disabled" className={date}> | ||
{getRelativeDate(createdAt)} | ||
</Text> | ||
</div> | ||
); | ||
}; | ||
|
||
export default StarRating; |
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,23 @@ | ||
import { vars } from '@/styles/theme.css'; | ||
import { style } from '@vanilla-extract/css'; | ||
|
||
export const ratingWrapper = style({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
gap: 8, | ||
}); | ||
|
||
export const ratingInfo = style({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
gap: 4, | ||
}); | ||
|
||
export const ratingNumber = style({ | ||
paddingTop: 4, | ||
color: vars.colors.gray5, | ||
}); | ||
|
||
export const date = style({ | ||
paddingTop: 2, | ||
}); |
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
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 |
---|---|---|
@@ -1,42 +1,32 @@ | ||
import { useState } from 'react'; | ||
import type { CSSProp } from 'styled-components'; | ||
import styled from 'styled-components'; | ||
|
||
import { container } from './memberImage.css'; | ||
|
||
import DefaultMemberImage from '@/assets/defaultProfile.png'; | ||
|
||
interface MemberImageProps { | ||
src: string; | ||
alt: string; | ||
width?: number; | ||
height?: number; | ||
css?: CSSProp; | ||
} | ||
|
||
const MemberImage = ({ src, alt, width = 45, height = 45, css }: MemberImageProps) => { | ||
const MemberImage = ({ src, width = 48, height = 48 }: MemberImageProps) => { | ||
const [isError, setIsError] = useState(false); | ||
|
||
const handleImageError = () => { | ||
setIsError(true); | ||
}; | ||
|
||
return ( | ||
<StyledMemberImage | ||
<img | ||
className={container} | ||
src={isError ? DefaultMemberImage : src} | ||
alt={alt} | ||
alt="사용자 프로필" | ||
width={width} | ||
height={height} | ||
css={css} | ||
onError={handleImageError} | ||
/> | ||
); | ||
}; | ||
|
||
export default MemberImage; | ||
|
||
const StyledMemberImage = styled.img` | ||
border: 2px solid ${({ theme }) => theme.colors.primary}; | ||
border-radius: 50%; | ||
background: ${({ theme }) => theme.backgroundColors.default}; | ||
object-fit: cover; | ||
${({ css }) => css}; | ||
`; |
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,6 @@ | ||
import { style } from '@vanilla-extract/css'; | ||
|
||
export const container = style({ | ||
borderRadius: '50%', | ||
objectFit: 'cover', | ||
}); |
16 changes: 16 additions & 0 deletions
16
src/components/Members/MemberModifyInput/MemberModifyInput.stories.tsx
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 type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import MemberModifyInput from './MemberModifyInput'; | ||
|
||
const meta: Meta<typeof MemberModifyInput> = { | ||
title: 'members/ MemberModifyInput', | ||
component: MemberModifyInput, | ||
args: { | ||
nickname: '펀잇', | ||
}, | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof MemberModifyInput>; | ||
|
||
export const Default: Story = {}; |
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
34 changes: 34 additions & 0 deletions
34
src/components/Members/MemberModifyInput/memberModifyInput.css.ts
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 { vars } from '@/styles/theme.css'; | ||
import { style } from '@vanilla-extract/css'; | ||
|
||
export const container = style({ | ||
position: 'relative', | ||
width: '100%', | ||
border: `1px solid ${vars.colors.border.default}`, | ||
borderRadius: 6, | ||
boxSizing: 'border-box', | ||
|
||
selectors: { | ||
'&:focus-within': { | ||
outline: `1px solid ${vars.colors.primary}`, | ||
border: `1px solid transparent`, | ||
}, | ||
}, | ||
}); | ||
|
||
export const inputWrapper = style({ | ||
width: '90%', | ||
height: 44, | ||
paddingLeft: 16, | ||
outline: 'none', | ||
}); | ||
|
||
export const letterCount = style({ | ||
position: 'absolute', | ||
width: '10%', | ||
top: 14.5, | ||
right: 16, | ||
display: 'flex', | ||
alignItems: 'center', | ||
background: vars.colors.white, | ||
}); |
Oops, something went wrong.