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
2 changes: 1 addition & 1 deletion src/app/components/layout/auth/Background.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default function Background({ children }: { children: React.ReactNode }) {
return (
<div className="flex min-h-[calc(100vh-64px)] items-center justify-center bg-gradient-to-r from-primary-orange-100 to-primary-orange-200 px-4 py-12 sm:px-6 lg:px-8">
<div className="mt-[64px] flex min-h-[calc(100vh-64px)] items-center justify-center bg-gradient-to-r from-primary-orange-100 to-primary-orange-200 px-4 py-12 sm:px-6 lg:px-8">
{children}
</div>
);
Expand Down
5 changes: 3 additions & 2 deletions src/app/components/modal/modals/apply/MyApplicationModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import Image from "next/image";
import { useUser } from "@/hooks/queries/user/me/useUser";
import { useGuestApplication } from "@/hooks/queries/user/me/useGuestApplication";
import Chip from "@/app/components/chip/Chip";
import { FaCheckCircle } from "react-icons/fa";

const ModalOverlay = ({ onClick }: { onClick: (e: React.MouseEvent) => void }) => (
<div className="bg-black fixed inset-0 z-50 bg-opacity-50" role="presentation">
Expand Down Expand Up @@ -56,7 +57,7 @@ const ModalHeader = () => {
};

const ResumeDownloadButton = ({ resumeId, resumeName }: ResumeDownloadProps) => {
const { downloadResume } = useResumeDownLoad();
const { downloadResume, downloading } = useResumeDownLoad();

const handleResumeDownload = () => {
downloadResume({ resumeId, resumeName });
Expand All @@ -66,7 +67,7 @@ const ResumeDownloadButton = ({ resumeId, resumeName }: ResumeDownloadProps) =>
<div className="flex w-full items-center justify-between border-b pb-2">
<span className="text-grayscale-400">이력서 다운로드</span>
<button onClick={handleResumeDownload} className="hover:text-primary-orange-500 transition-colors">
<FiDownload className="text-2xl" />
{downloading ? <FaCheckCircle className="text-2xl" /> : <FiDownload className="text-2xl" />}
</button>
</div>
);
Expand Down
6 changes: 5 additions & 1 deletion src/hooks/useResumeDownLoad.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
"use client";
import axios from "axios";
import { useState } from "react";
import toast from "react-hot-toast";

interface UseResumeDownloadProps {
Expand All @@ -7,8 +9,10 @@ interface UseResumeDownloadProps {
}

export const useResumeDownLoad = () => {
const [downloading, setDownloading] = useState(false);
const downloadResume = async ({ resumeId, resumeName }: UseResumeDownloadProps) => {
try {
setDownloading(true);
// API를 통해 이력서 파일을 다운로드
const response = await axios.get(`/api/resume/${resumeId}/download`, {
responseType: "blob",
Expand Down Expand Up @@ -36,5 +40,5 @@ export const useResumeDownLoad = () => {
}
};

return { downloadResume };
return { downloadResume, downloading };
};
Loading