Merge branch 'fe/develop' of https://lab.ssafy.com/s11-s-project/S11P21S002 into fe/fix/upload

This commit is contained in:
정현조 2024-10-08 13:45:16 +09:00
commit eea5b77c9c
7 changed files with 54 additions and 67 deletions

View File

@ -1,42 +1,24 @@
import * as React from 'react'; import * as React from 'react';
import Modal from './Modal'; import Modal from './Modal';
import { cn } from '@/lib/utils';
export interface FooterProps extends React.HTMLAttributes<HTMLDivElement> {}
export default function Footer({ className, ...props }: FooterProps) { export default function Footer() {
const [isTermsOpen, setIsTermsOpen] = React.useState(false); const [modalState, setModalState] = React.useState<'terms' | 'privacy' | null>(null);
const [isPrivacyOpen, setIsPrivacyOpen] = React.useState(false);
return ( return (
<footer <footer className="select-none bg-gray-100">
className={cn('mt-[100px] border-t border-gray-200 bg-gray-100', className)} <div className="container py-8 text-gray-400">
{...props} <div className="body-small flex flex-col items-start gap-5">
> <div>
{' '} <div className="heading">WorLabel</div>
<div className="container py-10"> <span>Copyright © 2024 WorLabel All rights reserved</span>
<div className="flex flex-col items-start gap-5">
<div className="relative">
<div className="font-heading text-lg text-gray-600 md:text-xl">WorLabel</div>
<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-2">
<button <button onClick={() => setModalState('terms')}> </button>
className="font-body-small text-gray-500 hover:text-primary" <span className="h-3 w-px rounded bg-gray-400" />
onClick={() => setIsTermsOpen(true)} <button onClick={() => setModalState('privacy')}> </button>
>
</button>
<div className="h-4 w-px bg-gray-400" />
<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 <Modal
title="서비스 이용약관" title="서비스 이용약관"
content={ content={
@ -86,10 +68,9 @@ export default function Footer({ className, ...props }: FooterProps) {
</p> </p>
</> </>
} }
open={isTermsOpen} open={modalState === 'terms'}
onClose={() => setIsTermsOpen(false)} onClose={() => setModalState(null)}
/> />
{/* Privacy Policy Modal */}
<Modal <Modal
title="개인정보 처리방침" title="개인정보 처리방침"
content={ content={
@ -142,8 +123,8 @@ export default function Footer({ className, ...props }: FooterProps) {
</p> </p>
</> </>
} }
open={isPrivacyOpen} open={modalState === 'privacy'}
onClose={() => setIsPrivacyOpen(false)} onClose={() => setModalState(null)}
/> />
</footer> </footer>
); );

View File

@ -199,10 +199,16 @@ export default function ImagePreSignedForm({
) : ( ) : (
<p className="text-gray-500"> <p className="text-gray-500">
{uploadType === 'folder' {uploadType === 'folder'
? '폴더를 업로드하려면 여기를 클릭하거나 폴더를 드래그하여 여기에 놓으세요' ? '폴더를 업로드하려면 여기를 클릭하거나'
: uploadType === 'zip' : uploadType === 'zip'
? 'ZIP 파일을 업로드하려면 여기를 클릭하거나 ZIP 파일을 드래그하여 여기에 놓으세요' ? '압축 파일을 업로드하려면 여기를 클릭하거나'
: '파일을 업로드하려면 여기를 클릭하거나 파일을 드래그하여 여기에 놓으세요'} : '파일을 업로드하려면 여기를 클릭하거나'}
<br />
{uploadType === 'folder'
? '폴더를 드래그하여 여기에 놓으세요'
: uploadType === 'zip'
? '압축 파일을 드래그하여 여기에 놓으세요'
: '파일을 드래그하여 여기에 놓으세요'}
</p> </p>
)} )}
</div> </div>
@ -217,7 +223,7 @@ export default function ImagePreSignedForm({
{({ index, style }) => ( {({ index, style }) => (
<div <div
key={index} key={index}
className="flex items-center justify-between border-b border-gray-200 p-2" className="flex items-center justify-between border-gray-200 p-2"
style={style} style={style}
> >
<span className="truncate">{files[index].path}</span> <span className="truncate">{files[index].path}</span>

View File

@ -15,7 +15,7 @@ export default function PageLayout() {
</main> </main>
</Suspense> </Suspense>
</div> </div>
<Footer className="mt-0" /> <Footer />
</div> </div>
</> </>
); );

View File

@ -147,7 +147,7 @@ export default function WorkspaceBrowseLayout() {
</NavLink> </NavLink>
)) ))
) : ( ) : (
<p className="text-gray-500"> .</p> <p className="p-2 text-gray-500"> .</p>
)} )}
</div> </div>
</div> </div>

View File

@ -1,12 +1,6 @@
import React from 'react'; import React from 'react';
import { Menu } from 'lucide-react'; import { Menu } from 'lucide-react';
import { import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '../ui/dropdown-menu';
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuSeparator,
DropdownMenuTrigger,
} from '../ui/dropdown-menu';
import { Dialog, DialogContent, DialogHeader, DialogTrigger } from '../ui/dialogCustom'; import { Dialog, DialogContent, DialogHeader, DialogTrigger } from '../ui/dialogCustom';
import ImagePreSignedForm from '../ImagePreSignedForm'; import ImagePreSignedForm from '../ImagePreSignedForm';
@ -23,8 +17,6 @@ export default function WorkspaceDropdownMenu({
const [fileCount, setFileCount] = React.useState<number>(0); const [fileCount, setFileCount] = React.useState<number>(0);
const [uploadType, setUploadType] = React.useState<'file' | 'folder' | 'zip'>('file'); const [uploadType, setUploadType] = React.useState<'file' | 'folder' | 'zip'>('file');
const handleCloseUpload = () => setIsOpenUpload(false);
const handleFileCount = (fileCount: number) => { const handleFileCount = (fileCount: number) => {
setFileCount(fileCount); setFileCount(fileCount);
}; };
@ -44,7 +36,6 @@ export default function WorkspaceDropdownMenu({
> >
</DropdownMenuItem> </DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem <DropdownMenuItem
onClick={() => { onClick={() => {
setUploadType('folder'); setUploadType('folder');
@ -53,7 +44,6 @@ export default function WorkspaceDropdownMenu({
> >
</DropdownMenuItem> </DropdownMenuItem>
<DropdownMenuSeparator />
<DropdownMenuItem <DropdownMenuItem
onClick={() => { onClick={() => {
setUploadType('zip'); setUploadType('zip');
@ -73,17 +63,17 @@ export default function WorkspaceDropdownMenu({
<DialogContent className="max-w-2xl"> <DialogContent className="max-w-2xl">
<DialogHeader <DialogHeader
title={ title={
fileCount > 0 uploadType === 'folder'
? `파일 업로드 (${fileCount})` ? '폴더 업로드'
: uploadType === 'file' : uploadType === 'zip'
? '파일 업로드' ? '압축 파일 업로드'
: uploadType === 'folder' : fileCount > 0
? '폴더 업로드' ? `파일 업로드 (${fileCount})`
: '압축 파일 업로드' : '파일 업로드'
} }
/> />
<ImagePreSignedForm <ImagePreSignedForm
onClose={handleCloseUpload} onClose={() => setIsOpenUpload(false)}
onRefetch={onRefetch} onRefetch={onRefetch}
onFileCount={handleFileCount} onFileCount={handleFileCount}
projectId={projectId} projectId={projectId}

View File

@ -182,7 +182,7 @@ export default function ProjectContextMenu({ projectId, folderId, node, onRefetc
id="uploadZip" id="uploadZip"
onClick={handleItemClick} onClick={handleItemClick}
> >
ZIP
</Item> </Item>
</> </>
)} )}
@ -202,7 +202,17 @@ export default function ProjectContextMenu({ projectId, folderId, node, onRefetc
> >
<DialogTrigger asChild></DialogTrigger> <DialogTrigger asChild></DialogTrigger>
<DialogContent className="max-w-2xl"> <DialogContent className="max-w-2xl">
<DialogHeader title={fileCount > 0 ? `업로드 (${fileCount})` : '업로드'} /> <DialogHeader
title={
uploadType === 'folder'
? '폴더 업로드'
: uploadType === 'zip'
? '압축 파일 업로드'
: fileCount > 0
? `파일 업로드 (${fileCount})`
: '파일 업로드'
}
/>
<ImagePreSignedForm <ImagePreSignedForm
onClose={() => setIsOpenUpload(false)} onClose={() => setIsOpenUpload(false)}
onRefetch={onRefetch} onRefetch={onRefetch}

View File

@ -9,16 +9,16 @@ export default function Home() {
const { accessToken } = useAuthStore(); const { accessToken } = useAuthStore();
return ( return (
<div className="flex h-full w-full flex-col items-center justify-center bg-gray-50"> <div className="flex h-full w-full flex-col items-center justify-center break-keep bg-gray-50 px-10">
<div className="text-center"> <div className="text-center">
<p className="text-5xl font-semibold leading-[60px] text-black"> <p className="text-5xl font-semibold leading-[1.2] text-gray-900">
<span className="text-primary"> </span> <span className="font-bold text-primary"> </span>
<br /> <br />
<span className="text-primary">WorLabel</span> <span className="font-bold text-primary">WorLabel</span>
</p> </p>
</div> </div>
<div className="mt-4 text-center"> <div className="mt-4 text-center">
<p className="text-xl font-light leading-[28px] text-black"> <p className="body font-light leading-[28px] text-gray-500">
WorLabel로 . WorLabel로 .
<br /> <br />
. .