Merge branch 'fe/fix/upload' into 'fe/develop'

Desing: 홈페이지 디자인 변경

See merge request s11-s-project/S11P21S002!302
This commit is contained in:
김진현 2024-10-08 09:54:00 +09:00
commit b6fd8bf1a1
4 changed files with 159 additions and 7 deletions

View File

@ -0,0 +1,31 @@
import { Dialog, DialogContent, DialogOverlay, DialogTitle, DialogClose } from '@radix-ui/react-dialog';
import { X } from 'lucide-react';
interface ModalProps {
title: string;
content: React.ReactNode;
open: boolean;
onClose: () => void;
}
export default function Modal({ title, content, open, onClose }: ModalProps) {
return (
<Dialog
open={open}
onOpenChange={onClose}
>
<DialogOverlay className="fixed inset-0 bg-black/50" />
<DialogContent className="fixed left-1/2 top-1/2 w-[90%] max-w-lg -translate-x-1/2 -translate-y-1/2 transform rounded-lg bg-white p-6 shadow-lg">
<div className="flex items-center justify-between">
<DialogTitle className="text-xl font-bold">{title}</DialogTitle>
<DialogClose asChild>
<button className="text-gray-500 hover:text-black">
<X size={24} />
</button>
</DialogClose>
</div>
<div className="mt-4">{content}</div>
</DialogContent>
</Dialog>
);
}

View File

@ -1,14 +1,18 @@
import * as React from 'react'; import * as React from 'react';
import Modal from './Modal';
import { cn } from '@/lib/utils'; import { cn } from '@/lib/utils';
export interface FooterProps extends React.HTMLAttributes<HTMLDivElement> {} export interface FooterProps extends React.HTMLAttributes<HTMLDivElement> {}
export default function Footer({ className, ...props }: FooterProps) { export default function Footer({ className, ...props }: FooterProps) {
const [isTermsOpen, setIsTermsOpen] = React.useState(false);
const [isPrivacyOpen, setIsPrivacyOpen] = React.useState(false);
return ( return (
<footer <footer
className={cn('mt-[100px] border-t border-gray-200 bg-gray-100', className)} className={cn('mt-[100px] border-t border-gray-200 bg-gray-100', className)}
{...props} {...props}
> >
{' '}
<div className="container py-10"> <div className="container py-10">
<div className="flex flex-col items-start gap-5"> <div className="flex flex-col items-start gap-5">
<div className="relative"> <div className="relative">
@ -16,12 +20,131 @@ export default function Footer({ className, ...props }: FooterProps) {
<p className="font-body-small mt-2 text-gray-500">Copyright © 2024 WorLabel All rights reserved</p> <p className="font-body-small mt-2 text-gray-500">Copyright © 2024 WorLabel All rights reserved</p>
</div> </div>
<div className="inline-flex items-center gap-4"> <div className="inline-flex items-center gap-4">
<div className="font-body-small text-gray-500"> </div> <button
className="font-body-small text-gray-500 hover:text-primary"
onClick={() => setIsTermsOpen(true)}
>
</button>
<div className="h-4 w-px bg-gray-400" /> <div className="h-4 w-px bg-gray-400" />
<div className="font-body-small text-gray-500"> </div> <button
className="font-body-small text-gray-500 hover:text-primary"
onClick={() => setIsPrivacyOpen(true)}
>
</button>
</div> </div>
</div> </div>
</div> </div>
{/* Terms of Service Modal */}
<Modal
title="서비스 이용약관"
content={
<>
<p>
<strong>1 </strong>
</p>
<p>
WorLabel( "회사") ( "서비스")
.
</p>
<br />
<p>
<strong>2 </strong>
</p>
<p>
1. "서비스" .
<br />
2. "회원" .
</p>
<br />
<p>
<strong>3 </strong>
</p>
<p>
1. , .
<br />
2. , .
</p>
<br />
<p>
<strong>4 </strong>
</p>
<p>
1. .
<br />
2. .
</p>
<br />
<p>
<strong>5 </strong>
</p>
<p>
1. , .
<br />
2. , .
</p>
</>
}
open={isTermsOpen}
onClose={() => setIsTermsOpen(false)}
/>
{/* Privacy Policy Modal */}
<Modal
title="개인정보 처리방침"
content={
<>
<p>
<strong>1 </strong>
</p>
<p>
1. .
<br />
2. 같습니다: 이름, , , , .
</p>
<br />
<p>
<strong>2 </strong>
</p>
<p>
1. :
<br />
- , , .
<br />
2. .
</p>
<br />
<p>
<strong>3 </strong>
</p>
<p>
1. .
<br />
2. , .
</p>
<br />
<p>
<strong>4 3 </strong>
</p>
<p>
1. .
<br />
2. , .
</p>
<br />
<p>
<strong>5 </strong>
</p>
<p>
1. , .
<br />
2. .
</p>
</>
}
open={isPrivacyOpen}
onClose={() => setIsPrivacyOpen(false)}
/>
</footer> </footer>
); );
} }

View File

@ -148,8 +148,7 @@ export default function ImagePreSignedForm({
onProgress: (progress) => { onProgress: (progress) => {
setUploadStatus((prevStatus) => { setUploadStatus((prevStatus) => {
const completedFiles = Math.round((progress / 100) * files.length); const completedFiles = Math.round((progress / 100) * files.length);
const newStatus = prevStatus.map((status, index) => (index < completedFiles ? 'success' : status)); return prevStatus.map((status, index) => (index < completedFiles ? 'success' : status));
return newStatus;
}); });
}, },
useSingleUpload: uploadType === 'file', useSingleUpload: uploadType === 'file',
@ -166,7 +165,7 @@ export default function ImagePreSignedForm({
} }
}; };
const totalProgress = Math.round((uploadStatus.filter((status) => status !== null).length / files.length) * 100); const totalProgress = Math.round((uploadStatus.filter((status) => status === 'success').length / files.length) * 100);
useEffect(() => { useEffect(() => {
onFileCount(files.length); onFileCount(files.length);

View File

@ -42,7 +42,6 @@ export default function Home() {
asChild asChild
variant="blue" variant="blue"
size="lg" size="lg"
className="mt-8"
> >
<Link to="/browse"></Link> <Link to="/browse"></Link>
</Button> </Button>