Skip to content

Commit 4329a04

Browse files
authored
feat: 톡픽 상세 조회 모바일 컴포넌트 구현 (#307)
* design: Button 컴포넌트에 outlineHighLight 스타일 값 추가 * feat: Button 컴포넌트 스토리북 텍스트 수정 * design: SummaryItem 컴포넌트 구현 * feat: SummaryBox 컴포넌트 구현 및 스토리북 작성 * feat: VoteToggle 컴포넌트 구현 및 스토리북 작성 * refactor: TalkPickSection 웹 컴포넌트 스토리북 수정 * feat: TalkPickSection 모바일 컴포넌트 구현 및 스토리북 작성 * refactor: ProfileIcon 컴포넌트에 사이즈 값 추가 및 TalkPickSection 모바일 컴포넌트 스타일 수정 * feat: ReportModal 모바일 컴포넌트 구현 및 스토리북 작성 * refactor: ReportModal 모바일 컴포넌트 커서 스타일 추가 및 사유 선택 로직 수정 * feat: 톡픽 상단 텍스트 수정 및 신고 모달 로직 연결 * feat: 톡픽에 작성자 프로필 이미지가 보여지도록 연결 * refactor: ProfileIcon 이미지 크기 수정 및 톡픽 컴포넌트 스타일 수정 * refactor: 프로필 아이콘에 데이터를 옵셔널로 전달 및 format 함수에 기본값 연결 수정 * refactor: 토스트 모달 스타일 수정 * refactor: ReportModal, TalkPickSection 이미지에 key 속성 추가 * refactor: 톡픽 투표 컴포넌트의 currentOption 오타 수정 * refactor: 톡픽 관련 모달 텍스트를 상수로 처리 * refactor: React.ReactNode를 ReactNode로 축약하여 사용 * refactor: 톡픽 이미지 alt에 image 텍스트 대신 url 값 사용
1 parent 2f5e99e commit 4329a04

35 files changed

+1346
-47
lines changed

src/assets/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ export { default as LogoMedium } from './svg/logo-medium.svg';
151151
export { default as DefaultPerson } from './svg/default-person.svg';
152152
export { default as MobileDefaultPerson } from './svg/mobile-default-person.svg';
153153
export { default as MobilePlus } from './svg/mobile-plus.svg';
154+
export { default as MobileReport } from './svg/mobile-report.svg';
155+
export { default as PickIcon } from './svg/pick-icon.svg';
154156

155157
// TODO: 이전 SVG
156158
export { default as Email } from './svg/email.svg';
Lines changed: 1 addition & 1 deletion
Loading

src/assets/svg/angle-small-up.svg

Lines changed: 1 addition & 1 deletion
Loading

src/assets/svg/mobile-report.svg

Lines changed: 9 additions & 0 deletions
Loading

src/assets/svg/pick-icon.svg

Lines changed: 4 additions & 0 deletions
Loading

src/components/atoms/ProfileIcon/ProfileIcon.style.ts

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,36 @@
11
import { css } from '@emotion/react';
22

3-
export const profileWrapper = (size: 'small' | 'large') =>
4-
css({
5-
all: 'unset',
6-
width: size === 'small' ? '40px' : '142px',
7-
height: size === 'small' ? '40px' : '142px',
8-
display: 'flex',
9-
alignItems: 'center',
10-
justifyContent: 'center',
11-
borderRadius: '50%',
12-
overflow: 'hidden',
13-
backgroundSize: 'cover',
14-
backgroundPosition: 'center',
15-
cursor: 'pointer',
16-
});
3+
export const profileWrapper = css({
4+
all: 'unset',
5+
display: 'flex',
6+
flexShrink: 0,
7+
alignItems: 'center',
8+
justifyContent: 'center',
9+
borderRadius: '50%',
10+
overflow: 'hidden',
11+
backgroundSize: 'cover',
12+
backgroundPosition: 'center',
13+
cursor: 'pointer',
14+
});
15+
16+
export const getProfileSize = (size: 'extraSmall' | 'small' | 'large') => {
17+
const style = {
18+
large: css({
19+
width: '142px',
20+
height: '142px',
21+
}),
22+
small: css({
23+
width: '40px',
24+
height: '40px',
25+
}),
26+
extraSmall: css({
27+
width: '24px',
28+
height: '24px',
29+
}),
30+
};
31+
32+
return style[size];
33+
};
1734

1835
export const profileImage = css({
1936
width: '100%',

src/components/atoms/ProfileIcon/ProfileIcon.tsx

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
import React, { ComponentPropsWithRef, ForwardedRef, forwardRef } from 'react';
22
import { NormalProfile } from '@/assets';
3-
import { profileWrapper, profileImage } from './ProfileIcon.style';
3+
import {
4+
profileWrapper,
5+
profileImage,
6+
getProfileSize,
7+
} from './ProfileIcon.style';
48

59
export interface ProfileProps extends ComponentPropsWithRef<'button'> {
610
interaction: 'default' | 'custom';
711
imgUrl?: string;
8-
size?: 'small' | 'large';
12+
size?: 'large' | 'small' | 'extraSmall';
913
}
1014

1115
interface ProfilePropsWithImage extends ComponentPropsWithRef<'button'> {
1216
interaction: 'custom';
1317
imgUrl: string;
14-
size?: 'small' | 'large';
18+
size?: 'large' | 'small' | 'extraSmall';
1519
}
1620

1721
const ProfileIcon = (
@@ -25,12 +29,22 @@ const ProfileIcon = (
2529
) => {
2630
const profileComponents = {
2731
normal: (
28-
<button type="button" ref={ref} css={profileWrapper(size)} {...props}>
32+
<button
33+
type="button"
34+
ref={ref}
35+
css={[profileWrapper, getProfileSize(size)]}
36+
{...props}
37+
>
2938
<NormalProfile css={profileImage} />
3039
</button>
3140
),
3241
settings: (
33-
<button type="button" ref={ref} css={profileWrapper(size)} {...props}>
42+
<button
43+
type="button"
44+
ref={ref}
45+
css={[profileWrapper, getProfileSize(size)]}
46+
{...props}
47+
>
3448
<img css={profileImage} src={imgUrl} alt="profile" />
3549
</button>
3650
),

src/components/mobile/atoms/Button/Button.style.ts

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ export const getVariantStyling = (
2424
backgroundColor: color.GY[5],
2525
color: color.GY[1],
2626
}),
27+
outlineHighlightR: css({
28+
border: `2px solid ${color.PINK}`,
29+
borderRadius: '10px',
30+
backgroundColor: 'transparent',
31+
color: color.RED,
32+
}),
33+
outlineHighlightB: css({
34+
border: `2px solid ${color.SKYBLUE}`,
35+
borderRadius: '10px',
36+
backgroundColor: 'transparent',
37+
color: color.BLUE,
38+
}),
2739
};
2840

2941
return style[variant];
@@ -58,6 +70,22 @@ export const getSizeByVariantStyling = (
5870
height: '34px',
5971
}),
6072
},
73+
outlineHighlightR: {
74+
large: css({}),
75+
medium: css(typo.Comment.SemiBold, {
76+
width: '134px',
77+
height: '72px',
78+
padding: '0 21px',
79+
}),
80+
},
81+
outlineHighlightB: {
82+
large: css({}),
83+
medium: css(typo.Comment.SemiBold, {
84+
width: '134px',
85+
height: '72px',
86+
padding: '0 21px',
87+
}),
88+
},
6189
};
6290

6391
return style[variant][size];
@@ -68,6 +96,6 @@ export const buttonStyling = css({
6896
justifyContent: 'center',
6997
alignItems: 'center',
7098
border: 'none',
71-
whiteSpace: 'nowrap',
99+
whiteSpace: 'normal',
72100
cursor: 'pointer',
73101
});

src/components/mobile/atoms/Button/Button.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,12 @@ import * as S from './Button.style';
44

55
export interface ButtonProps extends ComponentPropsWithRef<'button'> {
66
size?: 'large' | 'medium';
7-
variant?: 'primary' | 'roundPrimary' | 'outlineShadow';
7+
variant?:
8+
| 'primary'
9+
| 'roundPrimary'
10+
| 'outlineShadow'
11+
| 'outlineHighlightR'
12+
| 'outlineHighlightB';
813
active?: boolean;
914
}
1015

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import { css } from '@emotion/react';
2+
import color from '@/styles/color';
3+
import typo from '@/styles/typo';
4+
5+
export const summaryItemStyling = css(typo.Mobile.Text.Medium_12, {
6+
display: 'flex',
7+
justifyContent: 'center',
8+
alignItems: 'center',
9+
padding: '4px 20px 4px 5px',
10+
gap: '13px',
11+
backgroundColor: color.WT_VIOLET,
12+
color: color.BK,
13+
borderRadius: '30px',
14+
});
15+
16+
export const numberItemStyling = css(typo.Mobile.Text.Medium_12, {
17+
display: 'flex',
18+
justifyContent: 'center',
19+
alignItems: 'center',
20+
flexShrink: 0,
21+
width: '18px',
22+
height: '18px',
23+
backgroundColor: color.MAIN,
24+
color: color.WT,
25+
borderRadius: '50%',
26+
});

0 commit comments

Comments
 (0)