Skip to content

Commit

Permalink
feat: implement board background and transparent header
Browse files Browse the repository at this point in the history
  • Loading branch information
hwanheejung committed Nov 2, 2024
1 parent 14a84ec commit ae3fe88
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
9 changes: 8 additions & 1 deletion src/app/board/[boardId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,14 @@ const BoardPage = async ({ params }: BoardPageProps) => {

const session = await auth()

const background = `/images/boardThemas/${board.options.THEMA}.png`

return (
<TutorialProvider>
<div className="relative flex h-dvh flex-col bg-gray-50">
<div
className="relative flex h-dvh flex-col bg-cover"
style={{ backgroundImage: `url(${background})` }}
>
<Header
title={
<div className="flex items-center justify-center gap-[3px] text-center">
Expand All @@ -76,6 +81,8 @@ const BoardPage = async ({ params }: BoardPageProps) => {
<ShareBtn boardName={board.title} />
)
}
className="bg-transparent"
shadow={false}
/>
{board.items.length === 0 ? (
<Empty />
Expand Down
10 changes: 8 additions & 2 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { ReactNode } from 'react'
import HeaderBackButton from '@/components/Header/HeaderBackButton'
import { twMerge } from 'tailwind-merge'

interface HeaderProps {
title?: ReactNode
description?: string
leftButton?: ReactNode
rightButton?: ReactNode
shadow?: boolean
className?: string
}

const Header = ({
Expand All @@ -15,14 +17,18 @@ const Header = ({
leftButton = null,
rightButton = null,
shadow = true,
className = '',
}: HeaderProps) => {
return (
<>
<header
className={`fixed z-10 flex h-16 w-full max-w-md justify-between bg-gray-0 p-5 ${shadow && 'shadow-header'}`}
className={twMerge(
`fixed z-10 flex h-16 w-full max-w-md justify-between bg-gray-0 p-5 ${shadow && 'shadow-header'}`,
className,
)}
>
<div className="w-6 cursor-pointer">{leftButton}</div>
<div className="text-gray-700">
<div className="text-gray-900">
<div className="text-center text-md font-semiBold leading-6">
{title}
</div>
Expand Down
3 changes: 3 additions & 0 deletions src/types/board.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ export interface Board {
title: string
items: Polaroid[]
mine: boolean
options: {
THEMA: BoardThemaKeyType
}
}

export interface CreateBoardPayload {
Expand Down

0 comments on commit ae3fe88

Please sign in to comment.