-
Notifications
You must be signed in to change notification settings - Fork 0
refactor/#26: 공통된 padding 설정 컴포넌트화 #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
6b20df8
6bdb46d
862de22
a3e0610
fceb0aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| import { style } from '@vanilla-extract/css'; | ||
|
|
||
| export const container = style({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| paddingTop: 24, | ||
| paddingBottom: 12, | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| import type { ReactNode } from 'react'; | ||
| import * as styles from './FieldSection.css'; | ||
|
|
||
| interface FieldSectionProps { | ||
| children: ReactNode; | ||
| } | ||
|
|
||
| function FieldSection({ children }: FieldSectionProps) { | ||
| return <div className={styles.container}>{children}</div>; | ||
| } | ||
|
|
||
| export default FieldSection; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,30 +1,16 @@ | ||
| import { globalStyle, style } from '@vanilla-extract/css'; | ||
| import { style } from '@vanilla-extract/css'; | ||
| import { colors } from '@sopt-makers/colors'; | ||
| import { fontsObject } from '@sopt-makers/fonts'; | ||
|
|
||
| /** 제목 블록 ↔ 이미지 ↔ 코멘트 반복 영역 사이 16px */ | ||
| export const stepContent = style({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| gap: 16, | ||
| width: '100%', | ||
| }); | ||
|
|
||
| /** | ||
| * ContentHeading + 페이지별 안내 문단( children ) | ||
| * 제목/설명과 그 아래 문단 사이 간격 없음 | ||
| */ | ||
| export const headingBlock = style({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| gap: 0, | ||
| width: '100%', | ||
| }); | ||
|
|
||
| globalStyle(`${headingBlock} p`, { | ||
| export const noticeText = style({ | ||
| margin: 0, | ||
| marginTop: 0, | ||
| textAlign: 'left', | ||
| color: colors.white, | ||
| ...fontsObject.BODY_3_14_M, | ||
| }); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import { useCallback, useState } from 'react'; | ||
| import { useNavigate } from 'react-router-dom'; | ||
| import ContentHeading from '../common/ui/ContentHeading'; | ||
| import FieldSection from '../common/ui/FieldSection'; | ||
| import ImageSection from '../common/ui/ImageSection'; | ||
| import StepLayout from '../common/layout/StepLayout'; | ||
| import PeerCommentRepeater from './PeerCommentRepeater'; | ||
|
|
@@ -59,10 +60,10 @@ function PeerCommentStepTemplate({ | |
| totalSteps={totalSteps} | ||
| > | ||
| <div className={styles.stepContent}> | ||
| <div className={styles.headingBlock}> | ||
| <FieldSection> | ||
| <ContentHeading title={title} description={description} /> | ||
| <p>해당 코멘트는 무기명으로 전달되어요.</p> | ||
| </div> | ||
| <p className={styles.noticeText}>해당 코멘트는 무기명으로 전달되어요.</p> | ||
| </FieldSection> | ||
|
Comment on lines
+63
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Description: FieldSection 스타일과 사용처를 확인해 내부 gap이 공통 컴포넌트에서 제공되는지 검증합니다.
# Expect: FieldSection.css.ts에 gap: 28이 있거나, 각 사용처에서 별도 간격을 명시해야 합니다.
fd -i 'FieldSection\.(tsx|css\.ts)$' -x sed -n '1,120p' {}
rg -n -C2 '<FieldSection>|gap\s*:' --type ts --type tsxRepository: sopt-makers/hear-your-voice Length of output: 577 🏁 Script executed: # noticeText 스타일 확인
rg -n "noticeText" src/components/peer-comment/ -A5 -B2
# PeerCommentStepTemplate.tsx의 전체 스타일 파일 확인
fd "PeerCommentStepTemplate" --type f -e css.ts -e tsx | head -5 | xargs cat
# FieldSection 다른 사용처 확인
rg "<FieldSection>" --type tsx -B2 -A2 | head -50Repository: sopt-makers/hear-your-voice Length of output: 4568 🏁 Script executed: # ContentHeading 스타일 확인
rg "ContentHeading" src/components/common/ui/ -l | xargs cat
# FieldSection 다른 사용처 찾기
rg "<FieldSection>" --type ts -B5 -A5Repository: sopt-makers/hear-your-voice Length of output: 6133 🏁 Script executed: # ContentHeading.css.ts 전체 파일 확인
cat src/components/common/ui/ContentHeading.css.tsRepository: sopt-makers/hear-your-voice Length of output: 592
수정 예시 export const container = style({
display: 'flex',
flexDirection: 'column',
paddingTop: 24,
paddingBottom: 12,
+ gap: 28,
});🤖 Prompt for AI Agents |
||
| {guideImages ? ( | ||
| <ImageSection> | ||
| <ImageSection.Image src={guideImages[0]} alt="comment 작성 설명 이미지" /> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR 설명의
gap: 28px이 누락되어 있습니다.PR 본문에는
FieldSection이paddingTop: 24, paddingBottom: 12, gap: 28을 가진다고 기술되어 있으나 실제 스타일에는gap이 정의되어 있지 않습니다. 의도적으로 제거한 것이 아니라면 추가가 필요하고, 의도적이라면 PR 설명을 수정해 주세요.UserInfoPage처럼ContentHeading과<p>를 같은 섹션에 나란히 두는 케이스에서는 자식 간 간격이 없어 시각적으로 붙어 보일 수 있습니다.♻️ 제안
export const container = style({ display: 'flex', flexDirection: 'column', + gap: 28, paddingTop: 24, paddingBottom: 12, });📝 Committable suggestion
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FieldSection 간격이 0이 되면서 gap이 불필요해진게 맞아
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yungu0010, 의도적인 변경이었군요! 설명 감사합니다. 다만 PR 설명에 아직gap: 28이 언급되어 있을 수 있으니, 혼란을 줄이기 위해 PR 본문도 간략히 수정해 두시면 좋을 것 같습니다.✏️ Learnings added
🧠 Learnings used