-
Notifications
You must be signed in to change notification settings - Fork 2
feat: #110/대시보드 수정 페이지 일부 기능 구현 #111
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
10 commits
Select commit
Hold shift + click to select a range
4e67145
feat: Update sidebar to reflect dashboard creation and deletion in re…
hyeonjiroh 2da0254
feat: Update dashboard title and color with real-time UI reflection
hyeonjiroh 54a075a
feat: Navigate to dashboard detail page after editing
hyeonjiroh fcd265d
style: Complete responsive layout for InvitationSection
hyeonjiroh 1543c01
feat: Add pagination to invitation list
hyeonjiroh abc3994
Merge branch 'main' of https://github.com/hyeonjiroh/Taskify into fea…
hyeonjiroh 49e1c0b
feat: Implement invitation cancellation with API integration
hyeonjiroh 35a3f8f
chore: Remove unused router instance
hyeonjiroh b57df7f
chore: Remove unused router instance
hyeonjiroh f00a54f
chore: Remove unused code
hyeonjiroh 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
90 changes: 84 additions & 6 deletions
90
src/app/(after-login)/dashboard/[dashboardid]/edit/_components/DashboardEditSection.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
37 changes: 37 additions & 0 deletions
37
src/app/(after-login)/dashboard/[dashboardid]/edit/_components/DeleteButton.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,37 @@ | ||
| "use client"; | ||
|
|
||
| import { useRouter } from "next/navigation"; | ||
| import { useDashboardStore } from "@/lib/store/useDashboardStore"; | ||
| import { deleteDashboard } from "@/lib/apis/dashboardsApi"; | ||
| import ROUTE from "@/lib/constants/route"; | ||
|
|
||
| export default function DeleteButton({ | ||
| id, | ||
| token, | ||
| }: { | ||
| id: number; | ||
| token: string; | ||
| }) { | ||
| const router = useRouter(); | ||
| const setDashboardId = useDashboardStore((state) => state.setDashboardId); | ||
|
|
||
| const handleDeleteClick = async () => { | ||
| await deleteDashboard({ | ||
| token, | ||
| id, | ||
| }); | ||
|
|
||
| router.push(ROUTE.MYDASHBOARD); | ||
| setDashboardId(null); | ||
| }; | ||
|
|
||
| return ( | ||
| <button | ||
| type="button" | ||
| onClick={handleDeleteClick} | ||
| className="max-w-[320px] rounded-lg border border-gray-400 bg-gray-200 font-medium text-lg text-gray-800 tablet:h-[62px] tablet:text-2lg hover:bg-gray-300" | ||
| > | ||
| 대시보드 삭제하기 | ||
| </button> | ||
| ); | ||
| } |
39 changes: 39 additions & 0 deletions
39
src/app/(after-login)/dashboard/[dashboardid]/edit/_components/InvitationCard.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,39 @@ | ||
| import { Invitation } from "@/lib/types"; | ||
| import { deleteInvitation } from "@/lib/apis/dashboardsApi"; | ||
| import Button from "@/components/common/button/Button"; | ||
|
|
||
| type InvitationCardProps = Invitation & { | ||
| token: string; | ||
| }; | ||
|
|
||
| export default function InvitationCard({ | ||
| id, | ||
| dashboard, | ||
| invitee, | ||
| token, | ||
| }: InvitationCardProps) { | ||
| const handleDeleteClick = async () => { | ||
| await deleteInvitation({ | ||
| token, | ||
| dashboardId: dashboard.id, | ||
| invitationId: id, | ||
| }); | ||
|
|
||
| window.location.reload(); | ||
| }; | ||
|
|
||
| return ( | ||
| <div className="py-3 border-b border-gray-400 tablet:py-4"> | ||
| <div className="flex justify-between items-center"> | ||
| <div>{invitee.email}</div> | ||
| <Button | ||
| variant="whiteViolet" | ||
| onClick={handleDeleteClick} | ||
| className="w-[52px] max-h-[32px] tablet:w-[84px]" | ||
| > | ||
| 취소 | ||
| </Button> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
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
28 changes: 28 additions & 0 deletions
28
src/app/(after-login)/dashboard/[dashboardid]/edit/_components/InviteModalButton.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,28 @@ | ||
| import { useModalStore } from "@/lib/store/useModalStore"; | ||
| import Button from "@/components/common/button/Button"; | ||
| import Image from "next/image"; | ||
| import AddIcon from "../../../../../../../public/icon/add_box_icon.svg"; | ||
|
|
||
| export default function InviteModalButton() { | ||
| const { openModal } = useModalStore(); | ||
|
|
||
| return ( | ||
| <Button | ||
| variant="purple" | ||
| radius="sm" | ||
| onClick={() => { | ||
| openModal("invite"); | ||
| }} | ||
| className="flex gap-[6px] w-[86px] max-h-[26px] tablet:gap-2 tablet:w-[105px] tablet:max-h-[32px]" | ||
| > | ||
| <Image | ||
| src={AddIcon} | ||
| className="size-[14px] invert brightness-0 tablet:size-4" | ||
| alt="" | ||
| /> | ||
| <div className="font-medium text-xs leading-[18px] tablet:text-md"> | ||
| 초대하기 | ||
| </div> | ||
| </Button> | ||
| ); | ||
| } |
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
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.
window.location.replace()대신router.push()사용하는 방법도 있대요!window.location.replace()는 페이지를 새로고침하고 히스토리를 덮어쓰지만,router.push()는 SPA(Single Page Application) 내에서 URL을 변경하면서 페이지 전환을 관리하고 히스토리에 기록할 수 있는 차이점이 있다고 합니당