Skip to content

Commit

Permalink
feat: improvement algolia search, anchoring
Browse files Browse the repository at this point in the history
  • Loading branch information
nsdonato committed Mar 31, 2024
1 parent dc611aa commit 4d77731
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
6 changes: 1 addition & 5 deletions app/[menu]/[submenu]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ export default async function SubmenuPage({ params }: SubmenuPageProps) {

return (
<>
<Header
href={data.title}
title={data.title}
description={data.description}
/>
<Header title={data.title} description={data.description} />
<div className='grid gap-4 grid-cols-1 md:grid-cols-2 lg:grid-cols-4 mt-8'>
{data.pageItems.map(item => (
<Card key={item.imgPlaceholder} item={item} />
Expand Down
1 change: 0 additions & 1 deletion app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export default async function Home() {
return (
<>
<Header
href='Inicio'
title='Inicio'
description={['En Internet siempre veo las mismas preguntas:']}
/>
Expand Down
11 changes: 3 additions & 8 deletions components/header/header.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
type HeaderProps = {
title: string
description: string[]
href?: string
}

export const Header = ({ title, description, href }: HeaderProps) => {
export const Header = ({ title, description }: HeaderProps) => {
return (
<header>
<h1
id={`${href ?? title}`}
className='text-5xl font-bold mb-10 underline underline-offset-8 decoration-pink-500 block'>
<a className='pointer-events-none' href={`#${href ?? title}`}>
{title}
</a>
<h1 className='text-5xl font-bold mb-10 underline underline-offset-8 decoration-pink-500 block'>
{title}
</h1>
{description.map((parrafo, index) => (
<p key={index} className='text-balance last-of-type:pt-4'>
Expand Down

0 comments on commit 4d77731

Please sign in to comment.