-
Notifications
You must be signed in to change notification settings - Fork 3
[FE] 마인드맵 생성 페이지 #378
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
[FE] 마인드맵 생성 페이지 #378
Changes from 26 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
1ec2b2f
feat: 마인드맵 생성 페이지 추가
pakxe 59ce201
feat: 마인드맵 생성 훅 추가
pakxe c87c974
feat: 이모지 카드 컴포넌트 추가
pakxe 3218fe5
feat: selectFrom 타입 추가
pakxe b830bf2
feat: 마인드맵 타입 카드 컴포넌트 구현
pakxe b528c08
feat: CreateMindmapPage 연결
pakxe beffaa5
feat: 새로운 마인드맵의 타입을 선택하는 step page 구현
pakxe 43e10bc
feat: 새로운 마인드맵의 카테고리를 선택하는 페이지 구현
pakxe 0500901
feat: 퍼널 타입
pakxe a19b385
feat: 팀 마인드맵 디테일 작성을 위한 step page 구현
pakxe bbfe7f8
design: mb 추가
pakxe 10ae65f
fix: className을 제일 상위에서만 받도록 수정
pakxe 4ebd3eb
feat: utility type 들 추가
pakxe bf7daf8
feat: bg 이미지 추가
pakxe 8defb03
chore: assets alias 추가
pakxe 4226515
feat: Landing info 추가
pakxe 4c4d43b
feat: Logo 추가
pakxe 23ece4d
chore: 불필요한 파일 삭제
pakxe 1d0f7d9
design: GNB 블러 추가
pakxe eba3e40
design: hover transition 추가
pakxe 2d9a749
feat: useFunnel 훅 구현
pakxe ef58de5
design: scroll 되도록 수정
pakxe 1f72200
feat: path 추가
pakxe 9c2bb49
refactor: funnel.exit 쓰도록 수정
pakxe 2d09860
feat: MindmapCard에 interaction 추가
pakxe 7e30d40
chore: MindmapDetailPage로 이름 변경
pakxe 627d654
chore: 사용하지 않는 파일 제거
pakxe 3400c4f
chore: 사용하지 않는 파일 제거
pakxe e5b495e
fix: console.error로 수정
pakxe c686139
style: 중괄호 추가
pakxe 068f3bd
refactor: cn사용
pakxe 8c28f15
refactor: cn사용
pakxe b601d6a
fix: import 수정
pakxe 307d6c0
fix: 프로퍼티명 수정
pakxe 5a0c047
refactor: icon logo로 수정
pakxe 6e617b7
feat: mindmap page 추가
pakxe 5cc66c5
chore: 충돌 병합
pakxe 1f44f29
chore: 병합
pakxe fc93f21
chore: 임시 주석 처리
pakxe 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,23 +1,23 @@ | ||
| { | ||
| "$schema": "https://ui.shadcn.com/schema.json", | ||
| "style": "new-york", | ||
| "rsc": false, | ||
| "tsx": true, | ||
| "tailwind": { | ||
| "config": "", | ||
| "css": "src/global.css", | ||
| "baseColor": "neutral", | ||
| "cssVariables": true, | ||
| "prefix": "" | ||
| }, | ||
| "iconLibrary": "lucide", | ||
| "rtl": false, | ||
| "aliases": { | ||
| "components": "@/shared/components", | ||
| "utils": "@/shared/lib/utils", | ||
| "ui": "@/shared/components/ui", | ||
| "lib": "@/shared/lib", | ||
| "hooks": "@/shared/hooks" | ||
| }, | ||
| "registries": {} | ||
| "$schema": "https://ui.shadcn.com/schema.json", | ||
| "style": "new-york", | ||
| "rsc": false, | ||
| "tsx": true, | ||
| "tailwind": { | ||
| "config": "", | ||
| "css": "src/global.css", | ||
| "baseColor": "neutral", | ||
| "cssVariables": true, | ||
| "prefix": "" | ||
| }, | ||
| "iconLibrary": "lucide", | ||
| "rtl": false, | ||
| "aliases": { | ||
| "components": "@/shared/components", | ||
| "utils": "@/shared/lib/utils", | ||
| "ui": "@/shared/components/ui", | ||
| "lib": "@/shared/lib", | ||
| "hooks": "@/shared/hooks" | ||
| }, | ||
| "registries": {} | ||
| } |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
pakxe marked this conversation as resolved.
Show resolved
Hide resolved
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,9 @@ | ||
| import { ComponentPropsWithoutRef } from "react"; | ||
|
|
||
| import logoImg from "@/assets/img/logo.png"; | ||
|
|
||
| type Props = ComponentPropsWithoutRef<"img"> & {}; | ||
|
|
||
| export const Logo = ({ ...rest }: Props) => { | ||
| return <img src={logoImg} {...rest} />; | ||
| }; |
34 changes: 34 additions & 0 deletions
34
frontend/src/features/landing/components/landing_info/LandingInfo.tsx
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,34 @@ | ||
| import { ComponentPropsWithoutRef } from "react"; | ||
|
|
||
| import landingEpisode from "@/assets/img/img_landing_episode.png"; | ||
| import landingMain from "@/assets/img/img_landing_main.png"; | ||
| import landingMindmap from "@/assets/img/img_landing_mindmap.png"; | ||
| import landingSelfTest from "@/assets/img/img_landing_selftest.png"; | ||
| import { exhaustiveCheck } from "@/utils/exhaustive_check"; | ||
|
|
||
| type LandingInfoType = "episode" | "main" | "mindmap" | "self_test"; | ||
| type Props = ComponentPropsWithoutRef<"img"> & { | ||
| name: LandingInfoType; | ||
| }; | ||
|
|
||
| const LandingInfo = ({ name, ...rest }: Props) => { | ||
| return <img src={getLandingInfo(name)} {...rest} />; | ||
| }; | ||
|
|
||
| export default LandingInfo; | ||
|
|
||
| const getLandingInfo = (type: LandingInfoType) => { | ||
| switch (type) { | ||
| case "episode": | ||
| return landingEpisode; | ||
| case "main": | ||
| return landingMain; | ||
| case "mindmap": | ||
| return landingMindmap; | ||
| case "self_test": | ||
| return landingSelfTest; | ||
|
|
||
| default: | ||
| exhaustiveCheck(`${type}의 landing info 는 올바르지 않습니다.`); | ||
| } | ||
| }; |
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
86 changes: 86 additions & 0 deletions
86
frontend/src/features/mindmap/components/MindmapCategoryStep.tsx
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,86 @@ | ||
| import { useCreateMindmap } from "@/features/mindmap/hooks/useCreateMindmap"; | ||
| import { ACTIVITY_CATEGORIES, ActivityCategory } from "@/features/mindmap/types/mindmap"; | ||
| import { CreateMindmapFunnel } from "@/features/mindmap/types/mindmap_funnel"; | ||
| import BottomSticky from "@/shared/components/bottom_sticky/BottomSticky"; | ||
| import Button from "@/shared/components/button/Button"; | ||
| import { EmojiCard } from "@/shared/components/emoji_card/EmojiCard"; | ||
| import Top from "@/shared/components/top/Top"; | ||
| import { FunnelInstance } from "@/shared/hooks/useFunnel"; | ||
| import { linkTo } from "@/shared/utils/route"; | ||
|
|
||
| type CategoryStepFunnel = Extract<FunnelInstance<CreateMindmapFunnel>, { step: "CATEGORY" }>; | ||
|
|
||
| export function MindmapCategoryStep({ funnel }: { funnel: CategoryStepFunnel }) { | ||
| const { mutate: createMindmap, isPending } = useCreateMindmap(); | ||
|
|
||
| const selected = funnel.context.categories ?? []; | ||
|
|
||
| const toggle = (id: ActivityCategory) => { | ||
| funnel.history.setContext((prev) => { | ||
| const prevSelected = prev.categories ?? []; | ||
| const next = prevSelected.includes(id) ? prevSelected.filter((x) => x !== id) : [...prevSelected, id]; | ||
| return { ...prev, categories: next }; | ||
| }); | ||
| }; | ||
|
|
||
| const canSubmit = selected.length > 0; | ||
|
|
||
| const handleSubmit = () => { | ||
| createMindmap( | ||
| { | ||
| isShared: false, | ||
| title: "새로운 마인드맵", | ||
| }, | ||
| { | ||
| onSuccess: (data) => { | ||
| funnel.exit(linkTo.mindmap.detail(data.mindmap.mindmapId), { replace: false }); | ||
| }, | ||
| }, | ||
| ); | ||
| }; | ||
|
|
||
| return ( | ||
| <> | ||
| <div className="flex flex-col flex-1 w-full"> | ||
| <Top | ||
| lowerGap="lg" | ||
| title={ | ||
| <h1 className="typo-title-28-bold text-text-main1 leading-snug"> | ||
| 마인드맵으로 정리할 <br /> 활동 카테고리를 선택하세요. | ||
| </h1> | ||
| } | ||
| lower={ | ||
| <p className="text-text-main2 typo-body-16-medium"> | ||
| 사용 목적에 따라 알맞는 마인드맵 유형을 선택해 주세요. | ||
| </p> | ||
| } | ||
| className="mb-12" | ||
| /> | ||
|
|
||
| <div className="grid grid-cols-2 gap-4 pb-10"> | ||
| {ACTIVITY_CATEGORIES.map((c) => ( | ||
| <EmojiCard | ||
| key={c.id} | ||
| emoji={c.emoji} | ||
| label={c.label} | ||
| selected={selected.includes(c.id)} | ||
| onClick={() => toggle(c.id)} | ||
| /> | ||
| ))} | ||
| </div> | ||
| </div> | ||
|
|
||
| <BottomSticky> | ||
| <Button | ||
| size="md" | ||
| variant="primary" | ||
| layout="fullWidth" | ||
| disabled={!canSubmit || isPending} | ||
| onClick={handleSubmit} | ||
| > | ||
| {isPending ? "생성 중..." : "완료"} | ||
| </Button> | ||
| </BottomSticky> | ||
| </> | ||
| ); | ||
| } |
44 changes: 44 additions & 0 deletions
44
frontend/src/features/mindmap/components/MindmapTypeCard.tsx
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,44 @@ | ||
| import Card from "@/shared/components/card/Card"; | ||
| import Icon, { IconName } from "@/shared/components/icon/Icon"; | ||
| import { cn } from "@/utils/cn"; | ||
|
|
||
| type Props = { | ||
| icon: IconName; | ||
| title: string; | ||
| description: string; | ||
| isSelected: boolean; | ||
| onClick: () => void; | ||
| }; | ||
|
|
||
| const MindmapTypeCard = ({ icon, title, description, isSelected, onClick }: Props) => { | ||
| return ( | ||
| <Card | ||
| className={cn( | ||
| "relative cursor-pointer flex-1 h-75 transition-all py-12.5 px-10.5", | ||
| isSelected | ||
| ? "outline-primary outline-2 shadow-md bg-cobalt-100/30 text-primary" | ||
| : "text-text-sub1 hover:bg-gray-50", | ||
| )} | ||
| onClick={onClick} | ||
| header={ | ||
| <div className="flex flex-col gap-4 mt-2"> | ||
| {isSelected && ( | ||
| <div className="absolute top-6 right-6"> | ||
| <Icon name="ic_check" color="currentColor" size={24} /> | ||
| </div> | ||
| )} | ||
|
|
||
| <Icon name={icon} size={36} color="currentColor" /> | ||
| <h2 className="typo-title-22-bold">{title}</h2> | ||
| </div> | ||
| } | ||
| contents={ | ||
| <div className="mt-auto pt-4"> | ||
| <p className="typo-body-15-medium leading-relaxed break-keep">{description}</p> | ||
| </div> | ||
| } | ||
| /> | ||
| ); | ||
| }; | ||
|
|
||
| export default MindmapTypeCard; |
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.
Uh oh!
There was an error while loading. Please reload this page.