-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat/#64] 열린피드백 질문 작성/전송 확인/완료 토스트 구현 #65
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
Merged
Changes from all commits
Commits
Show all changes
2 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,118 @@ | ||
| import { | ||
| ActionArea, | ||
| ActionAreaButton, | ||
| TextArea, | ||
| TextAreaContent, | ||
| TopNavigationButton, | ||
| Typography, | ||
| } from "@wanteddev/wds"; | ||
| import { IconChevronLeft } from "@wanteddev/wds-icon"; | ||
| import { useId, useState } from "react"; | ||
| import { useNavigate } from "react-router-dom"; | ||
|
|
||
| import ConfirmModal from "@/components/ui/ConfirmModal"; | ||
| import ScreenHeader from "@/components/ui/ScreenHeader"; | ||
| import { useScreenHeader } from "@/components/ui/useScreenHeader"; | ||
|
|
||
| const FEEDBACKS_QUESTION_MAX_LENGTH = 500; | ||
|
|
||
| // Figma: 피드백 질문 (nodeId 1410:49972), 피드백 질문 확인 모달 (nodeId 1410:49980) | ||
| // 실제 제출 API 전까지는 확인 모달에서 "보내기"를 누르면 바로 열린피드백 목록으로 보내고, | ||
| // 목록 화면에 완료 토스트(Figma nodeId 1410:50080)를 띄우라고 navigate state로 신호를 넘긴다. | ||
| function FeedbacksNewScreen() { | ||
| const navigate = useNavigate(); | ||
| const [content, setContent] = useState(""); | ||
| const [isConfirmOpen, setIsConfirmOpen] = useState(false); | ||
| const headingId = useId(); | ||
|
|
||
| const canSubmit = content.trim().length > 0; | ||
|
|
||
| // 이 화면으로 바로 들어오면(딥링크·새로고침) 뒤로 갈 히스토리가 없어서 navigate(-1)이 | ||
| // 아무 일도 하지 않는다 — 행사 신청 화면과 같은 이유로 그럴 땐 목록으로 보낸다. | ||
| const goBack = () => { | ||
| const historyIndex = (window.history.state as { idx?: number } | null)?.idx; | ||
| if (historyIndex !== undefined && historyIndex > 0) { | ||
| navigate(-1); | ||
| return; | ||
| } | ||
| navigate("/feedbacks", { replace: true }); | ||
| }; | ||
|
|
||
| useScreenHeader( | ||
| <ScreenHeader | ||
| leading={ | ||
| <TopNavigationButton | ||
| aria-label="뒤로가기" | ||
| onClick={goBack} | ||
| variant="icon" | ||
| > | ||
| <IconChevronLeft /> | ||
| </TopNavigationButton> | ||
| } | ||
| title="피드백 작성" | ||
| variant="normal" | ||
| />, | ||
| ); | ||
|
|
||
| return ( | ||
| <div className="flex h-full flex-col"> | ||
| <div className="scrollbar-hidden flex-1 overflow-y-auto"> | ||
| <div className="flex flex-col gap-2 px-5 pt-2"> | ||
| <Typography | ||
| color="semantic.label.neutral" | ||
| id={headingId} | ||
| variant="label1" | ||
| weight="bold" | ||
| > | ||
| 궁금하거나 건의하고 싶은 내용을 자유롭게 적어 주세요. | ||
| </Typography> | ||
| <TextArea | ||
| aria-labelledby={headingId} | ||
| aria-required="true" | ||
| maxLength={FEEDBACKS_QUESTION_MAX_LENGTH} | ||
| minRows={1} | ||
| onChange={(event) => setContent(event.target.value)} | ||
| placeholder="피드백 내용을 입력하세요." | ||
| trailingContent={ | ||
| <TextAreaContent variant="characterCounter"> | ||
| {FEEDBACKS_QUESTION_MAX_LENGTH} | ||
| </TextAreaContent> | ||
| } | ||
| value={content} | ||
| width="100%" | ||
| /> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div className="shrink-0"> | ||
| <ActionArea background> | ||
| <ActionAreaButton | ||
| disabled={!canSubmit} | ||
| onClick={() => setIsConfirmOpen(true)} | ||
| sx={{ paddingBlock: "16px" }} | ||
| > | ||
| 피드백 보내기 | ||
| </ActionAreaButton> | ||
| </ActionArea> | ||
| <div className="h-safe-bottom-extra bg-background-elevated-normal sm:h-[14px]" /> | ||
| </div> | ||
|
|
||
| <ConfirmModal | ||
| cancelLabel="수정" | ||
| confirmLabel="보내기" | ||
| description="보내 주신 피드백은 정기 답변에서 함께 답변해 드려요." | ||
| onCancel={() => setIsConfirmOpen(false)} | ||
| onConfirm={() => | ||
| navigate("/feedbacks", { | ||
| replace: true, | ||
| state: { feedbackSent: true }, | ||
| }) | ||
| } | ||
| open={isConfirmOpen} | ||
| title="피드백을 보낼까요?" | ||
| /> | ||
| </div> | ||
| ); | ||
| } | ||
|
|
||
| export default FeedbacksNewScreen; | ||
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.
Uh oh!
There was an error while loading. Please reload this page.