-
Notifications
You must be signed in to change notification settings - Fork 1
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
[Feature] 나의 스터디 페이지 모달 구현 #39
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c5f8156
feat: client에 wowds-ui 패키지 설치
ghdtjgus76 33e2a3b
feat: LinkButton 컴포넌트 추가
ghdtjgus76 f488442
feat: 오늘의 할 일 AssignmentStatusBox 라우팅 기능 추가
ghdtjgus76 794101d
chore: StudyCurriculum LinkButton으로 변경
ghdtjgus76 c69b64f
chore: Modal 컴포넌트 내부에서 className, style 커스텀할 수 있도록 변경
ghdtjgus76 920864d
chore: AttendanceStatusBox 버튼 링크 버튼으로 변경
ghdtjgus76 a2939bf
feat: 출석체크 모달 기능 추가
ghdtjgus76 be69e07
feat: 출석체크 완료 모달 기능 추가
ghdtjgus76 c11492d
chore: 모달 컴포넌트 기본 onClose는 router.back으로 지정하도록 수정
ghdtjgus76 b4f098b
chore: 모달 컴포넌트 onClose 핸들러 삭제
ghdtjgus76 cd88bb6
feat: ui 변경사항 반영
ghdtjgus76 e598f96
chore: 출석 체크 완료 모달 컴포넌트명 변경
ghdtjgus76 4167b3a
rename: check attendance -> attendance check로 네이밍 변경
ghdtjgus76 5faca05
refactor: 모달 parallel route 한 폴더에서 관리하도록 수정
ghdtjgus76 5fbe708
chore: 나의 스터디 페이지 모달 조건부 렌더링 방식으로 변경
ghdtjgus76 00da8dc
chore: Merge branch 'dev' into feature/my-study-modal
ghdtjgus76 639a53b
feat: ui 패키지 스타일 변경사항 반영
ghdtjgus76 5c12da0
fix: 빌드 에러 해결
ghdtjgus76 7ea2897
fix: 스토리북 appDirectory 설정 추가
ghdtjgus76 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
130 changes: 130 additions & 0 deletions
130
apps/client/app/(afterLogin)/my-study/@modal/(.)attendance-check/page.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,130 @@ | ||
"use client"; | ||
|
||
import { css } from "@styled-system/css"; | ||
import { Flex } from "@styled-system/jsx"; | ||
import { Modal, Text } from "@wow-class/ui"; | ||
import Image from "next/image"; | ||
import { useState } from "react"; | ||
import Button from "wowds-ui/Button"; | ||
import TextField from "wowds-ui/TextField"; | ||
|
||
const AttendanceCheckModal = () => { | ||
const [attended, setAttended] = useState(false); | ||
const [error] = useState(false); | ||
const [attendanceNumber, setAttendanceNumber] = useState(""); | ||
|
||
const handleChangeAttendanceNumber = (value: string) => { | ||
setAttendanceNumber(value); | ||
}; | ||
|
||
const handleClickAttendanceCheckButton = () => { | ||
setAttended(true); | ||
}; | ||
|
||
return ( | ||
<Modal> | ||
{attended ? ( | ||
<Flex alignItems="center" direction="column" gap="4px"> | ||
<section | ||
aria-label="attendance-complete-title" | ||
className={attendanceCompleteTitleStyle} | ||
> | ||
<Text as="h1" color="primary" typo="h1"> | ||
기초 웹스터디 | ||
</Text> | ||
<Image | ||
alt="item separator" | ||
height={6} | ||
src="/images/dot.svg" | ||
width={6} | ||
/> | ||
<Text as="h1" color="primary" typo="h1"> | ||
4주차 | ||
</Text> | ||
</section> | ||
<section aria-label="attendance-complete-description"> | ||
<Text as="h1" color="textBlack" typo="h1"> | ||
출석이 완료되었어요. | ||
</Text> | ||
</section> | ||
</Flex> | ||
) : ( | ||
<> | ||
<Flex | ||
alignItems="center" | ||
direction="column" | ||
gap="sm" | ||
marginBottom="40px" | ||
> | ||
<section | ||
aria-label="attendance-check-title" | ||
className={attendanceCheckTitleStyle} | ||
> | ||
<Text as="h1" typo="h1"> | ||
기초 웹스터디 | ||
</Text> | ||
<Image | ||
alt="item separator" | ||
height={6} | ||
src="/images/dot.svg" | ||
width={6} | ||
/> | ||
<Text as="h1" typo="h1"> | ||
4주차 | ||
</Text> | ||
</section> | ||
<section | ||
aria-label="attendance-check-description" | ||
className={attendanceCheckDescriptionStyle} | ||
> | ||
<Text as="p" color="sub" typo="body1"> | ||
스터디 시작 후 멘토의 안내에 따라 출결번호를 입력해주세요. | ||
</Text> | ||
<Text as="p" color="error" typo="body1"> | ||
2024년 5월 23일 0:00 - 23:59까지 | ||
</Text> | ||
</section> | ||
</Flex> | ||
<TextField | ||
error={error} | ||
helperText={error ? textfieldHelperText : ""} | ||
label="출결번호 입력" | ||
placeholder="Ex. 0000" | ||
style={textfieldStyle} | ||
value={attendanceNumber} | ||
onChange={handleChangeAttendanceNumber} | ||
/> | ||
<Button onClick={handleClickAttendanceCheckButton}> | ||
출석 체크하기 | ||
</Button> | ||
</> | ||
)} | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default AttendanceCheckModal; | ||
|
||
const textfieldHelperText = <div>• 출석 실패! 출결번호를 확인해주세요.</div>; | ||
|
||
const attendanceCheckTitleStyle = css({ | ||
display: "flex", | ||
gap: "sm", | ||
}); | ||
|
||
const attendanceCheckDescriptionStyle = css({ | ||
display: "flex", | ||
flexDirection: "column", | ||
alignItems: "center", | ||
gap: "xxs", | ||
}); | ||
|
||
const textfieldStyle = { | ||
height: "89px", | ||
marginBottom: "20px", | ||
}; | ||
|
||
const attendanceCompleteTitleStyle = css({ | ||
display: "flex", | ||
gap: "sm", | ||
}); |
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,5 @@ | ||
const Default = () => { | ||
return null; | ||
}; | ||
|
||
export default Default; |
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
8 changes: 8 additions & 0 deletions
8
apps/client/app/(afterLogin)/my-study/attendance-check/page.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,8 @@ | ||
import { routePath } from "constants/routePath"; | ||
import { redirect } from "next/navigation"; | ||
|
||
const CheckAttendancePage = () => { | ||
return redirect(routePath["my-study"]); | ||
}; | ||
|
||
export default CheckAttendancePage; |
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,5 @@ | ||
const Default = () => { | ||
return null; | ||
}; | ||
|
||
export default Default; |
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 @@ | ||
const Layout = ({ | ||
children, | ||
modal, | ||
}: { | ||
children: React.ReactNode; | ||
modal: React.ReactNode; | ||
}) => { | ||
return ( | ||
<main> | ||
{children} | ||
{modal} | ||
</main> | ||
); | ||
}; | ||
|
||
export default Layout; |
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,21 @@ | ||
"use client"; | ||
|
||
import { useRouter } from "next/navigation"; | ||
import type { ComponentProps } from "react"; | ||
import Button from "wowds-ui/Button"; | ||
|
||
interface LinkButtonProps extends ComponentProps<typeof Button> { | ||
href: string; | ||
} | ||
|
||
const LinkButton = ({ href, ...rest }: LinkButtonProps) => { | ||
const router = useRouter(); | ||
|
||
const handleClickLinkButton = () => { | ||
router.push(href); | ||
}; | ||
|
||
return <Button onClick={handleClickLinkButton} {...rest} />; | ||
}; | ||
|
||
export default LinkButton; | ||
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 |
---|---|---|
|
@@ -9,6 +9,9 @@ const preview: Preview = { | |
date: /Date$/i, | ||
}, | ||
}, | ||
nextjs: { | ||
appDirectory: true, | ||
}, | ||
}, | ||
}; | ||
|
||
|
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
Oops, something went wrong.
Oops, something went wrong.
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.
p5;
next/link
의<Link>
로 감싸는 것이 아닌Button
컴포넌트를 확장시켜 쓰신건 뎁스를 줄이려는 의도가 맞을까요? 서버컴포넌트에서의 활용을 생각하면<Link>
가 더 적합하다고 생각합니다.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.
음 일단 해당 컴포넌트를 구현한 이유가 두 가지입니다.
위 구현체에서 Button 컴포넌트 대신 Link 컴포넌트를 사용하게 되면 디자인 부분을 다시 다 구현해야 한다는 번거로움이 있어 현재로서는 이 방식이 최선이라고 생각했습니다!