feat: add header menu and search components with menu data for news page
This commit is contained in:
parent
d2534bd94e
commit
89da497cc9
30
app/data/menu.ts
Normal file
30
app/data/menu.ts
Normal file
@ -0,0 +1,30 @@
|
||||
export const MENU = [
|
||||
{
|
||||
title: 'Spotlight',
|
||||
url: '/topic?category=spotlight',
|
||||
},
|
||||
{
|
||||
title: 'Berita',
|
||||
url: '/topic?category=berita',
|
||||
},
|
||||
{
|
||||
title: 'Kasus',
|
||||
url: '/topic?category=kasus',
|
||||
},
|
||||
{
|
||||
title: 'Kajian',
|
||||
url: '/topic?category=kajian',
|
||||
},
|
||||
{
|
||||
title: 'Lifestyle',
|
||||
url: '/topic?category=lifestyle',
|
||||
},
|
||||
{
|
||||
title: 'Event',
|
||||
url: '/topic?category=event',
|
||||
},
|
||||
{
|
||||
title: 'Travel',
|
||||
url: '/topic?category=travel',
|
||||
},
|
||||
]
|
||||
24
app/pages/news/header-menu.tsx
Normal file
24
app/pages/news/header-menu.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
import { Link } from 'react-router'
|
||||
|
||||
import { MENU } from '~/data/menu'
|
||||
|
||||
import { HeaderSearch } from './header-search'
|
||||
|
||||
export const HeaderMenu = () => {
|
||||
return (
|
||||
<div className="flex h-[60px] items-center justify-between bg-[#2E2F7C] text-xl font-medium text-white">
|
||||
{MENU.map((item) => (
|
||||
<Link
|
||||
key={item.title}
|
||||
to={item.url}
|
||||
className={
|
||||
'flex h-full items-center justify-center border-r border-white px-[35px]'
|
||||
}
|
||||
>
|
||||
{item.title}
|
||||
</Link>
|
||||
))}
|
||||
<HeaderSearch />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
10
app/pages/news/header-search.tsx
Normal file
10
app/pages/news/header-search.tsx
Normal file
@ -0,0 +1,10 @@
|
||||
export const HeaderSearch = () => {
|
||||
return (
|
||||
<form className="flex-1 px-[35px]">
|
||||
<input
|
||||
placeholder="Cari..."
|
||||
className="placeholder:text-white focus:ring-0 focus:outline-none"
|
||||
/>
|
||||
</form>
|
||||
)
|
||||
}
|
||||
@ -1,5 +1,6 @@
|
||||
import React, { type FC, type PropsWithChildren } from 'react'
|
||||
|
||||
import { HeaderMenu } from './header-menu'
|
||||
import { HeaderTop } from './header-top'
|
||||
|
||||
export const NewsPage: FC<PropsWithChildren> = ({ children }) => {
|
||||
@ -7,6 +8,7 @@ export const NewsPage: FC<PropsWithChildren> = ({ children }) => {
|
||||
<main className="min-h-dvh bg-[#ECECEC]">
|
||||
<header>
|
||||
<HeaderTop />
|
||||
<HeaderMenu />
|
||||
</header>
|
||||
{children}
|
||||
</main>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user