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
10 changes: 10 additions & 0 deletions src/app/recipe/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import StarBg from '@/shared/components/starBg/StarBg';

function page() {
return (
<div className="w-full">
<StarBg className="h-200 lg:h-202" />
</div>
);
}
export default page;
11 changes: 3 additions & 8 deletions src/shared/components/pageHeader/PageHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Star from '@/shared/assets/images/star_bg.webp';
import Image, { StaticImageData } from 'next/image';
import StarBg from '../starBg/StarBg';

interface Props {
src: StaticImageData;
Expand All @@ -9,12 +9,7 @@ interface Props {

function PageHeader({ src, title, description }: Props) {
return (
<div
className="h-40 w-full bg-repeat o-cover relative md:h-65 lg:h-80"
style={{
backgroundImage: `url(${Star.src})`,
}}
>
<StarBg className="relative h-40 md:h-65 lg:h-80">
<div className="absolute bottom-0 left-1/2 -translate-x-1/2">
<Image src={src} alt="" width={src.width} height={src.height} />
<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]">
Expand All @@ -26,7 +21,7 @@ function PageHeader({ src, title, description }: Props) {
</p>
</div>
</div>
</div>
</StarBg>
);
}
export default PageHeader;
20 changes: 20 additions & 0 deletions src/shared/components/starBg/StarBg.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import Star from '@/shared/assets/images/star_bg.webp';

interface Props {
className: string;
children?: React.ReactNode;
}

function StarBg({ className, children }: Props) {
return (
<div
className={`w-full bg-repeat ${className}`}
style={{
backgroundImage: `url(${Star.src})`,
}}
>
{children}
</div>
);
}
export default StarBg;