-
Notifications
You must be signed in to change notification settings - Fork 0
feat/#24: MVP 선정 뷰 구현 #25
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
Merged
Changes from 4 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,117 @@ | ||
| import { style } from '@vanilla-extract/css'; | ||
| import { colors } from '@sopt-makers/colors'; | ||
| import { fontsObject } from '@sopt-makers/fonts'; | ||
|
|
||
| export const body = style({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| gap: 32, | ||
| color: colors.white, | ||
| }); | ||
|
|
||
| export const fields = style({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| gap: 28, | ||
| }); | ||
|
|
||
| export const fieldGroup = style({ | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| gap: 8, | ||
| }); | ||
|
|
||
| export const searchContainer = style({ | ||
| position: 'relative', | ||
| marginTop: 4, | ||
| }); | ||
|
|
||
| export const inputWrapper = style({ | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| backgroundColor: colors.gray800, | ||
| borderRadius: 6, | ||
| padding: '12px 14px', | ||
| gap: 8, | ||
| }); | ||
|
|
||
| export const searchInput = style({ | ||
| flex: 1, | ||
| background: 'transparent', | ||
| border: 'none', | ||
| outline: 'none', | ||
| color: colors.white, | ||
| ...fontsObject.BODY_3_14_M, | ||
| selectors: { | ||
| '&::placeholder': { | ||
| color: colors.gray400, | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| export const clearButton = style({ | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| justifyContent: 'center', | ||
| padding: 0, | ||
| border: 'none', | ||
| background: 'transparent', | ||
| cursor: 'pointer', | ||
| flexShrink: 0, | ||
| }); | ||
|
|
||
|
|
||
| export const dropdown = style({ | ||
| position: 'absolute', | ||
| top: '100%', | ||
| left: 0, | ||
| right: 0, | ||
| backgroundColor: colors.gray800, | ||
| borderRadius: 6, | ||
| marginTop: 4, | ||
| zIndex: 10, | ||
| overflow: 'hidden', | ||
| listStyle: 'none', | ||
| padding: 0, | ||
| boxShadow: '0 4px 12px rgba(0, 0, 0, 0.4)', | ||
|
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. 하드코딩된 색상 사용 지양.
As per coding guidelines: "Use 🤖 Prompt for AI Agents |
||
| }); | ||
|
|
||
| export const dropdownItem = style({ | ||
| display: 'flex', | ||
| alignItems: 'center', | ||
| gap: 8, | ||
| width: '100%', | ||
| padding: '10px 14px', | ||
| border: 'none', | ||
| background: 'transparent', | ||
| cursor: 'pointer', | ||
| color: colors.white, | ||
| ...fontsObject.BODY_3_14_M, | ||
| textAlign: 'left', | ||
| selectors: { | ||
| '&:hover': { | ||
| backgroundColor: colors.gray700, | ||
| }, | ||
| }, | ||
| }); | ||
|
|
||
| export const avatarIcon = style({ | ||
| width: 28, | ||
| height: 28, | ||
| borderRadius: '50%', | ||
| display: 'inline-flex', | ||
| alignItems: 'center', | ||
| justifyContent: 'center', | ||
| flexShrink: 0, | ||
| backgroundColor: colors.gray700, | ||
| color: colors.gray500, | ||
| }); | ||
|
|
||
| export const chipList = style({ | ||
| listStyle: 'none', | ||
| margin: '4px 0 0', | ||
| padding: 0, | ||
| display: 'flex', | ||
| flexDirection: 'column', | ||
| alignItems: 'flex-start', | ||
| }); | ||
This file contains hidden or 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,132 @@ | ||
| import { useState } from 'react'; | ||
| import type { ChangeEvent } from 'react'; | ||
| import { useNavigate } from 'react-router-dom'; | ||
| import { FieldBox } from '@sopt-makers/ui'; | ||
| import { colors } from '@sopt-makers/colors'; | ||
| import { IconUser, IconXCircle } from '@sopt-makers/icons'; | ||
| import { StepLayout, ContentHeading, MemberChip, InputField } from '@components'; | ||
| import { usePeerMembers, useCommentForm } from '@hooks'; | ||
| import type { PeerMember } from '@types'; | ||
| import * as styles from './MvpPage.css'; | ||
|
|
||
| function MvpPage() { | ||
| const navigate = useNavigate(); | ||
| const { update } = useCommentForm(); | ||
| const peerMembers = usePeerMembers(); | ||
|
|
||
| const [searchQuery, setSearchQuery] = useState(''); | ||
| const [selectedMember, setSelectedMember] = useState<PeerMember | null>(null); | ||
| const [reason, setReason] = useState(''); | ||
|
|
||
| const filteredMembers = searchQuery | ||
| ? peerMembers.filter((m) => m.name.includes(searchQuery)) | ||
| : []; | ||
|
|
||
| const isAllFilled = selectedMember !== null && reason.trim().length > 0; | ||
|
|
||
| const handleSelectMember = (member: PeerMember) => { | ||
| setSelectedMember(member); | ||
| setSearchQuery(''); | ||
| }; | ||
|
|
||
| const handleSubmit = () => { | ||
| if (!selectedMember) return; | ||
| update({ mvp: { target_user_id: selectedMember.userId, comment_text: reason } }); | ||
| navigate('/closing'); | ||
| }; | ||
|
|
||
| return ( | ||
| <StepLayout | ||
| showProgressBar | ||
| currentStep={6} | ||
| totalSteps={7} | ||
| nextLabel="제출하기" | ||
| showNextRightIcon={false} | ||
| onNext={handleSubmit} | ||
| isNextDisabled={!isAllFilled} | ||
| > | ||
| <div className={styles.body}> | ||
| <ContentHeading | ||
| title="MVP 선정" | ||
| description={ | ||
| <> | ||
| 마지막이에요! | ||
| <br /> | ||
| 이번 스프린트에서 뛰어난 모습을 보여주었던 동료가 있다면 | ||
| <br /> | ||
| 이름과 이유를 작성해주세요. | ||
| </> | ||
| } | ||
| /> | ||
|
|
||
| <div className={styles.fields}> | ||
| <div className={styles.fieldGroup}> | ||
| <FieldBox.Label | ||
| label="MVP로 선정하고 싶은 동료" | ||
| description="MVP는 한 명만 선택할 수 있어요." | ||
| required | ||
| /> | ||
|
|
||
| <div className={styles.searchContainer}> | ||
| <div className={styles.inputWrapper}> | ||
| <input | ||
| className={styles.searchInput} | ||
| placeholder="멤버 검색" | ||
| value={searchQuery} | ||
| onChange={(e: ChangeEvent<HTMLInputElement>) => | ||
| setSearchQuery(e.target.value) | ||
| } | ||
| /> | ||
| {searchQuery && ( | ||
| <button | ||
| type="button" | ||
| className={styles.clearButton} | ||
| onClick={() => setSearchQuery('')} | ||
| aria-label="검색어 지우기" | ||
| > | ||
| <IconXCircle style={{ width: 20, height: 20, color: colors.gray50 }} /> | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| </button> | ||
| )} | ||
| </div> | ||
|
|
||
| {searchQuery && filteredMembers.length > 0 && ( | ||
| <ul className={styles.dropdown}> | ||
| {filteredMembers.map((member) => ( | ||
| <li key={member.userId}> | ||
| <button | ||
| type="button" | ||
| className={styles.dropdownItem} | ||
| onClick={() => handleSelectMember(member)} | ||
| > | ||
| <span className={styles.avatarIcon} aria-hidden> | ||
| <IconUser style={{ width: 20, height: 20 }} /> | ||
| </span> | ||
| <span>{member.name}</span> | ||
| </button> | ||
| </li> | ||
| ))} | ||
| </ul> | ||
| )} | ||
| </div> | ||
|
|
||
| {selectedMember && ( | ||
| <ul className={styles.chipList}> | ||
| <MemberChip label={selectedMember.name} showRemoveButton={false} /> | ||
| </ul> | ||
| )} | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| </div> | ||
|
|
||
| <InputField | ||
| labelText="MVP 선정 이유를 작성해주세요." | ||
| required | ||
| placeholder="선정하는 이유" | ||
| value={reason} | ||
| onChange={setReason} | ||
| /> | ||
| </div> | ||
| </div> | ||
| </StepLayout> | ||
| ); | ||
| } | ||
|
|
||
| export default MvpPage; | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
스텝 번호가 5/7을 건너뜁니다.
ContinueCommentPage가 step 4/7인데 바로MvpPage를 step 6/7로 표기하여 step 5/7이 누락되어 있습니다. 전체 7단계가 맞다면 MvpPage를 5/7로, ClosingPage를 6/7로 조정하거나, 중간에 빠진 페이지를 보완해야 플로우 문서와 실제 구현(MvpPage.tsx의currentStep={6} totalSteps={7})이 일치합니다.🤖 Prompt for AI Agents