Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
18 changes: 12 additions & 6 deletions src/pages/Chat/ChatRoom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,12 @@ function ChatRoom() {
</div>
</div>

<span className="mb-1 shrink-0 self-end text-xs text-indigo-300">
{formatTime(message.createdAt)}
</span>
<div className="flex shrink-0 flex-col items-start gap-0.5 self-end">
{message.unreadCount > 0 && (
<span className="text-[10px] font-medium text-[#4B9FE1]">{message.unreadCount}</span>
)}
<span className="text-[10px] text-indigo-300">{formatTime(message.createdAt)}</span>
</div>
Comment thread
coderabbitai[bot] marked this conversation as resolved.
</div>
)}

Expand All @@ -134,9 +137,12 @@ function ChatRoom() {
{message.content}
</div>

<span className="mb-1 shrink-0 self-end text-xs text-indigo-300">
{formatTime(message.createdAt)}
</span>
<div className="flex shrink-0 flex-col items-end self-end">
{message.unreadCount > 0 && (
<span className="text-[10px] font-medium text-[#4B9FE1]">{message.unreadCount}</span>
)}
<span className="text-[10px] text-indigo-300">{formatTime(message.createdAt)}</span>
</div>
</div>
)}
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Club/Application/hooks/useApplyToClub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const useApplyToClub = (clubId: number) => {
const navigate = useNavigate();
const queryClient = useQueryClient();

const { mutateAsync: applyToClub } = useMutation({
const { mutateAsync: applyToClub, isPending } = useMutation({
mutationKey: ['applyToClub', clubId],
mutationFn: (body: ClubApplyRequest) => applyClub(clubId, body),
onSuccess: () => {
Expand All @@ -17,7 +17,7 @@ const useApplyToClub = (clubId: number) => {
},
});

return { applyToClub };
return { applyToClub, isPending };
};

export default useApplyToClub;
4 changes: 2 additions & 2 deletions src/pages/Club/Application/hooks/useClubApply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ const useClubApply = (clubId: number) => {
const hasFeeData = clubFee.amount !== null && clubFee.accountNumber !== null;
const isFeeRequired = recruitment.isFeeRequired && hasFeeData;

const { applyToClub } = useApplyToClub(clubId);
const { applyToClub, isPending } = useApplyToClub(clubId);

const applyDirectly = () => applyToClub({ answers: [] });

const hasQuestions = clubQuestions && clubQuestions.questions.length > 0;

return { clubQuestions, applyToClub, applyDirectly, hasQuestions, isFeeRequired };
return { clubQuestions, applyToClub, applyDirectly, hasQuestions, isFeeRequired, isPending };
};

export default useClubApply;
5 changes: 3 additions & 2 deletions src/pages/Club/Application/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import useClubApply from './hooks/useClubApply';
function ApplicationPage() {
const { clubId } = useParams();
const navigate = useNavigate();
const { clubQuestions, applyToClub, isFeeRequired } = useClubApply(Number(clubId));
const { clubQuestions, applyToClub, isFeeRequired, isPending } = useClubApply(Number(clubId));
const { answers: storedAnswers, clubId: storedClubId } = useClubApplicationStore();
const setApplication = useClubApplicationStore((s) => s.setApplication);
const [answers, setAnswers] = useState<Record<number, string>>(() =>
Expand Down Expand Up @@ -80,7 +80,8 @@ function ApplicationPage() {
<button
type="button"
onClick={handleConfirm}
className="bg-primary text-h3 w-full rounded-lg py-3.5 text-center text-white"
disabled={isPending}
className="bg-primary text-h3 w-full rounded-lg py-3.5 text-center text-white disabled:opacity-50"
>
제출하기
</button>
Expand Down
5 changes: 3 additions & 2 deletions src/pages/Club/ClubDetail/components/ClubRecruitment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface ClubRecruitProps {
function ClubRecruitment({ clubId, isMember }: ClubRecruitProps) {
const navigate = useNavigate();
const { data: clubRecruitment } = useGetClubRecruitment(clubId);
const { hasQuestions, applyDirectly, isFeeRequired } = useClubApply(clubId);
const { hasQuestions, applyDirectly, isFeeRequired, isPending } = useClubApply(clubId);
const { value: isConfirmOpen, setTrue: openConfirm, setFalse: closeConfirm } = useBooleanState();

const setApplication = useClubApplicationStore((s) => s.setApplication);
Expand Down Expand Up @@ -95,7 +95,8 @@ function ClubRecruitment({ clubId, isMember }: ClubRecruitProps) {
<button
type="button"
onClick={handleApply}
className="bg-primary text-h3 w-full rounded-lg py-3.5 text-center text-white"
disabled={isPending}
className="bg-primary text-h3 w-full rounded-lg py-3.5 text-center text-white disabled:opacity-50"
>
지원하기
</button>
Expand Down