Skip to content

Commit c9909ef

Browse files
authored
Merge pull request #53 from prgrms-web-devcourse-final-project/feat/cocktailPage#17
Feat/페이지별 헤더 컴포넌트
2 parents a04ec15 + e94c75f commit c9909ef

File tree

7 files changed

+51
-2
lines changed

7 files changed

+51
-2
lines changed

src/app/design-system/page.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import Share from '@/shared/components/share/Share';
1414
import Keep from '@/shared/components/keep/Keep';
1515
import Spinner from '@/shared/components/spinner/Spinner';
1616

17-
1817
function Page() {
1918
const [isModalOpen, setModalOpen] = useState(false);
2019
const [isConfirmOpen, setConfirmOpen] = useState(false);

src/app/recipe/page.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1+
import PageHeader from '@/shared/components/pageHeader/PageHeader';
2+
import { Metadata } from 'next';
3+
import Glass from '@/shared/assets/images/recipe_page_header.png';
4+
5+
export const metadata: Metadata = {
6+
title: 'SSOUL | 칵테일레시피',
7+
description: '칵테일 레시피가 궁금하신 분들을 위한 레시피 페이지',
8+
};
9+
110
function Page() {
2-
return <div>recipe</div>;
11+
return (
12+
<div className="w-full">
13+
<PageHeader
14+
src={Glass}
15+
title="Cocktail Recipes"
16+
description="다양하고 재밌는 칵테일 레시피"
17+
/>
18+
<div className="page-layout max-w-1224"></div>
19+
</div>
20+
);
321
}
422
export default Page;
67.8 KB
Loading

src/shared/assets/images/index.ts

Whitespace-only changes.
224 KB
Loading
2.04 KB
Loading
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import Star from '@/shared/assets/images/star_bg.webp';
2+
import Image, { StaticImageData } from 'next/image';
3+
4+
interface Props {
5+
src: StaticImageData;
6+
title: string;
7+
description: string;
8+
}
9+
10+
function PageHeader({ src, title, description }: Props) {
11+
return (
12+
<div
13+
className="h-40 w-full bg-repeat o-cover relative md:h-70 lg:h-100"
14+
style={{
15+
backgroundImage: `url(${Star.src})`,
16+
}}
17+
>
18+
<div className="absolute bottom-0 left-1/2 -translate-x-1/2">
19+
<Image src={src} alt="" width={src.width} height={src.height} />
20+
<div className="text-center text-nowrap font-serif font-bold flex flex-col absolute left-1/2 -translate-x-1/2 bottom-4 md:bottom-9 lg:bottom-[55px]">
21+
<h2 className="text-shadow-[0_0_12px_#1a1a1a] text-2xl md:text-5xl lg:text-3xl lg:text-[64px]">
22+
{title}
23+
</h2>
24+
<p className="text-shadow-[0_0_12px_#1a1a1a] text-xs md:text-xl lg:text-2xl">
25+
{description}
26+
</p>
27+
</div>
28+
</div>
29+
</div>
30+
);
31+
}
32+
export default PageHeader;

0 commit comments

Comments
 (0)