Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,17 @@
}

.optionalInfo {
flex: 1;
display: flex;
justify-content: space-between;
justify-content: flex-end;
align-items: center;
}

.dueDateWrapper {
flex: 1;
display: flex;
gap: 4px;
align-items: center;
gap: 4px;
width: 125px;
}

Expand Down Expand Up @@ -116,15 +118,11 @@

.contentContainer {
flex-direction: row;
align-items: flex-end;
align-items: center;
justify-content: space-between;
gap: 0;
}

.tagContainer {
max-width: 50%;
}

.imageWrapper {
width: 91px;
height: 53px;
Expand All @@ -140,6 +138,10 @@
gap: 16px;
}

.dueDateWrapper {
justify-content: flex-end;
}

.modal {
width: 680px;
}
Expand Down Expand Up @@ -181,4 +183,8 @@
justify-content: space-between;
gap: 0;
}

.dueDateWrapper {
justify-content: flex-start;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default function UpdateTaskModal() {
options={members}
setValue={setValue}
defaultAssignee={
members?.filter((member) => member.userId == card?.assignee.id)[0]
members?.filter((member) => member.userId == card?.assignee?.id)[0]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋‹ด๋‹น์ž์—†์„๋•Œ ์ˆ˜์ •๋ˆ„๋ฅด๋ฉด ์—๋Ÿฌ๋‚˜์„œ ์ถ”๊ฐ€ํ–ˆ์Šด๋‹ค

}
className={styles.dropdown}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ export default function CardInfo({ card, columnTitle }: CardInfoProps) {

return (
<div className={styles.cardInfo}>
<div className={styles.assignmentContainer}>
<Assignment card={card} />
</div>
{card.assignee && (
<div className={styles.assignmentContainer}>
<Assignment card={card} />
</div>
)}
<div className={styles.infoContainer}>
<div className={styles.labelArea}>
<div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
align-items: center;
}

.moreButton:focus {
outline: none;
}

.menuContainer {
position: absolute;
z-index: 999;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import {
useState,
ChangeEvent,
KeyboardEvent,
MouseEvent,
useRef,
} from 'react';
import { useState, ChangeEvent, KeyboardEvent, useRef } from 'react';
import Avatar from '@/components/Avatar';
import Button from '@/components/Button';
import { formatDateToCustomFormat } from '@/utils/dateUtils';
Expand Down Expand Up @@ -58,7 +52,6 @@ export default function CommentDetail({
e.preventDefault();
handleSave();
toggleEditing();
// todo: ์ˆ˜์ •์„ฑ๊ณต์‹œ ํ† ์ŠคํŠธ ๋ฐ•์Šค
}
};

Expand All @@ -80,7 +73,6 @@ export default function CommentDetail({
const handleDeleteOnClick = async () => {
await deleteComment(id);
onDelete(id);
// todo: ์‚ญ์ œ์„ฑ๊ณต์‹œ ํ† ์ŠคํŠธ ๋ฐ•์Šค
};

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
'use client';

import { useRouter } from 'next/navigation';
import useIdStore from '@/store/idStore';
import Button from '@/components/Button';
import { deleteDashboard } from '@/lib/boardService';
import styles from './DeleteButton.module.css';
import useDashboardStore from '@/store/dashboardStore';
import useDashboardTriggerStore from '@/store/dashboardTriggerStore';

export default function DeleteButton() {
const id = useIdStore((state) => state.id);
const { dashboard, setDashboard } = useDashboardStore();
const { updateTrigger } = useDashboardTriggerStore();
const router = useRouter();

const handleClick = async () => {
await deleteDashboard(id);
await deleteDashboard(dashboard!.id.toString());
setDashboard(null);
updateTrigger();
router.replace('/mydashboard');
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ import { Dashboard, UpdateDashboardRequestParams } from '@/types/dashboards';
import Button from '@/components/Button';
import DashboardInput from '@/components/DashboardInput';
import styles from './EditForm.module.css';
import useDashboardTriggerStore from '@/store/dashboardTriggerStore';

export default function EditForm() {
const { updateTrigger } = useDashboardTriggerStore();
const [board, setBoard] = useState<Dashboard>();
const id = useIdStore((state) => state.id);
const {
Expand All @@ -26,6 +28,7 @@ export default function EditForm() {

const onSubmit = async (data: UpdateDashboardRequestParams) => {
const response = await updateBoard(id, data);
updateTrigger();
setBoard(response);
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { useForm } from 'react-hook-form';
import Button from '@/components/Button';
import DashboardInput from '@/components/DashboardInput';
import styles from './CreateDashboardForm.module.css';
import { CreateDashboardRequestBody } from '@/types/dashboards';
import type { CreateDashboardRequestBody } from '@/types/dashboards';
import { createDashboard } from '@/lib/boardService';
import { useRouter } from 'next/navigation';
import useDashboardTriggerStore from '@/store/dashboardTriggerStore';
import styles from './CreateDashboardForm.module.css';

interface CreateDashboardFormProps {
closeModal: () => void;
Expand All @@ -13,6 +14,8 @@ interface CreateDashboardFormProps {
export default function CreateDashboardForm({
closeModal,
}: CreateDashboardFormProps) {
const { updateTrigger } = useDashboardTriggerStore();

const {
register,
handleSubmit,
Expand All @@ -23,6 +26,7 @@ export default function CreateDashboardForm({
const onSubmit = async (newDashboard: CreateDashboardRequestBody) => {
const response = await createDashboard(newDashboard);
closeModal();
updateTrigger();
router.push(`/dashboard/${response.id}`);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import type {
Invitation,
AcceptMyInvitationRequestBody,
} from '@/types/invitation';
import styles from './MyInvitationCard.module.css';
import { updateMyInvitation } from '../../_lib/myInvitationService';
import styles from './MyInvitationCard.module.css';

interface MyInvitationCardProps extends Invitation {
onActionComplete: () => void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@
}

.container {
max-height: 580px;
min-width: 330px;
overflow-y: auto;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด๋ ‡๊ฒŒํ•˜๋‹ˆ๊น ๋Œ“๊ธ€์ชฝ overflow๋ž‘ ๊ฒน์ณ์„œ ๋ญ”๊ฐ€ ๋‚ด๋ง˜๋Œ€๋กœ ์•ˆ๋˜๊ธดํ•œ๋ฐ ์ผ๋‹จ ์ด๋Ÿฌ์ผ€ ๋’€์–ด์š”..

display: flex;
flex-direction: column;
align-items: flex-start;
Expand Down Expand Up @@ -98,6 +100,7 @@
@media screen and (min-width: 768px) {
.container {
min-width: 580px;
max-height: 850px;
padding: 32px;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interface UseDashboardsParams {

export default function useDashboards({ pageSize }: UseDashboardsParams) {
const [page, setPage] = useState(1);
const { data } = useApi<GetDashboardsResponse>('/dashboards', {
const { data, refetch } = useApi<GetDashboardsResponse>('/dashboards', {
method: 'GET',
params: { navigationMethod: 'pagination', page, size: pageSize },
});
Expand All @@ -25,5 +25,5 @@ export default function useDashboards({ pageSize }: UseDashboardsParams) {
});
};

return { page, dashboards, totalPages, handlePageChange };
return { page, dashboards, totalPages, handlePageChange, refetch };
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import axiosInstance from '@/lib/axiosInstance';
import { toast } from '@/store/toastStore';
import {
GetMyInvitationsRequestParam,
GetMyInvitationsResponse,
Expand Down Expand Up @@ -45,6 +46,10 @@ export const updateMyInvitation = async ({
requestBody
);

toast.success({
message: `${requestBody.inviteAccepted ? '์ˆ˜๋ฝ' : '๊ฑฐ์ ˆ'} ์™„๋ฃŒ!`,
});

return response.data;
} catch (error) {
throw error;
Expand Down
1 change: 1 addition & 0 deletions src/components/card/ColumnLabel.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
display: flex;
gap: 6px;
padding: 4px 10px;
white-space: nowrap;
}
7 changes: 7 additions & 0 deletions src/components/header/DashboardMembers.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
display: flex;
align-items: center;
gap: 0;
transform: translateX(5px);
}

.avatar,
Expand All @@ -13,3 +14,9 @@
color: #d25b68;
background: #f4d7da;
}

@media screen and (min-width: 768px) {
.avatarWrapper {
transform: none;
}
}
10 changes: 10 additions & 0 deletions src/components/header/InvitationButton.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,13 @@
.button.button:hover {
background-color: var(--violet-light);
}

.icon {
display: none;
}

@media screen and (min-width: 768px) {
.icon {
display: inline-block;
}
}
3 changes: 2 additions & 1 deletion src/components/header/UserSection.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
.myMenu {
position: absolute;
top: 75px;
right: 0;
right: 10px;
z-index: 999;
}

@media screen and (min-width: 768px) {
Expand Down
28 changes: 28 additions & 0 deletions src/components/header/skeleton/UserInfoSkeleton.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,34 @@
background-color: var(--gray-300);
}

.userIcon::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 50%;
height: 100%;
background: linear-gradient(
90deg,
rgba(255, 255, 255, 0.2) 0%,
rgba(255, 255, 255, 0.6) 50%,
rgba(255, 255, 255, 0.2) 100%
);
animation: shine 1.5s infinite;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

โ˜€

}

@keyframes shine {
0% {
left: -100%;
}
50% {
left: 100%;
}
100% {
left: -100%;
}
}

@media screen and (min-width: 768px) {
.userInfo {
display: flex;
Expand Down
15 changes: 12 additions & 3 deletions src/components/sidebar/Dashboards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,22 @@ import Button from '../Button';
import useDashboards from '@/app/(with-header-sidebar)/mydashboard/_hooks/useDashboards';
import useDashboardStore from '@/store/dashboardStore';
import styles from './Dashboards.module.css';
import { useEffect } from 'react';
import useDashboardTriggerStore from '@/store/dashboardTriggerStore';

const PAGE_SIZE = 12;

export default function Dashboards() {
const { page, dashboards, totalPages, handlePageChange } = useDashboards({
pageSize: PAGE_SIZE,
});
const { trigger } = useDashboardTriggerStore();

const { page, dashboards, totalPages, handlePageChange, refetch } =
useDashboards({
pageSize: PAGE_SIZE,
});

useEffect(() => {
refetch();
Copy link
Collaborator Author

@devmanta devmanta Nov 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ด๊ฑด useDashboards์—์„œ ๊ฐ€์ ธ๋‹ค์“ฐ๋Š” useApi๊ฐ€ ๊ตฌ์กฐ์ ์œผ๋กœ ๋ฌธ์ œ?๊ฐ€์žˆ์–ด์„œ (useApi ๋ถˆ๋Ÿฌ์˜ค๋ฉด ๋ฐ”๋กœapi๋ฅผ ๋จผ์ € ์จ)
์ตœ์ดˆ๋ Œ๋”๋ง๋ ๋•Œ 2๋ฒˆํ˜ธ์ถœํ•˜๋Š” ์ด์Šˆ ์žˆ์Šต๋‹ˆ๋‹ค^.^

}, [trigger]);

if (dashboards.length === 0) {
return null;
Expand Down
3 changes: 2 additions & 1 deletion src/lib/boardService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const updateBoard = async (
title,
color,
});
toast.success({ message: '๋ณ€๊ฒฝ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.' });
toast.success({ message: '๋Œ€์‹œ๋ณด๋“œ๊ฐ€ ์ˆ˜์ •๋˜์—ˆ์Šต๋‹ˆ๋‹ค.' });
return response.data;
} catch (error) {
if (error instanceof Error) {
Expand All @@ -42,6 +42,7 @@ export const createDashboard = async ({
title,
color,
});
toast.success({ message: '๋Œ€์‹œ๋ณด๋“œ๊ฐ€ ์ƒ์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.' });
return response.data;
} catch (error) {
throw error;
Expand Down
Loading