Skip to content

Commit

Permalink
feat: 공통 template 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
yougyung committed Feb 21, 2024
1 parent 1bd0de8 commit ddb3728
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
10 changes: 10 additions & 0 deletions app/file-upload/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import Template from '../ui/view/atom/template';

export default function Page() {
return (
<Template className="flex flex-col items-center gap-8">
<div>요소1</div>
<div>요소2</div>
</Template>
);
}
21 changes: 21 additions & 0 deletions app/ui/view/atom/template.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { twMerge } from 'tailwind-merge';

interface TemplateProps {
children: React.ReactNode;
size?: 'md' | 'lg';
className?: string;
}

export default function Template({ children, size = 'md', className }: TemplateProps) {
return (
<div
className={twMerge(
'absolute bg-white top-[7rem] z-10 rounded-xl p-[1.5rem] shadow-lg max-md:w-full',
size === 'md' ? 'md:w-[70%]' : 'md:w-[80%]',
className,
)}
>
{children}
</div>
);
}

0 comments on commit ddb3728

Please sign in to comment.