Skip to content

Commit

Permalink
chore: cleanup main header & sidebar
Browse files Browse the repository at this point in the history
  • Loading branch information
etiennecl committed Mar 12, 2024
1 parent ba64f90 commit e98c463
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 26 deletions.
20 changes: 1 addition & 19 deletions src/app/[locale]/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,37 +3,19 @@ import { Hits } from '@/components/hits';
import { QuestionsResult } from '@/components/questions';
import { SearchProvider } from '@/components/search-provider';
import { SearchBox } from '@/components/searchbox';
import { SearchRequest } from '@/lib/client';
import { Star } from 'lucide-react';

const parseSearchRequest = (searchParams: {
[key: string]: string | string[] | undefined;
}): SearchRequest => {
const req: SearchRequest = {
query: '',
};

if (typeof searchParams.q === 'string') {
req.query = searchParams.q;
}

return req;
};

export default async function Search({
searchParams,
}: {
params: { locale: string };
searchParams: { [key: string]: string | string[] | undefined };
}) {
const req = parseSearchRequest(searchParams);

return (
<SearchProvider>
<div className="min-w-96 flex-grow">
<div className="relative">
<header className="absolute left-0 z-40 h-[48px] w-full border-b bg-background">
<Star />
{/* <Star /> */}
</header>
<div className="absolute left-0 h-screen w-full overflow-y-auto pt-[48px]">
<div className="flex flex-col items-center justify-center gap-8 py-8">
Expand Down
14 changes: 7 additions & 7 deletions src/app/[locale]/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import Link from 'next/link';
'use client';

import { useRouter } from 'next/navigation';
import { CliniaIcon } from '@clinia-ui/icons';
import { Button } from '@clinia-ui/react';

export const Sidebar = () => {
const router = useRouter();
return (
<aside className="fixed left-0 top-0 z-40 h-screen w-56 -translate-x-full border-r transition-transform sm:translate-x-0">
<div className="h-full overflow-y-auto px-3 py-4">
<Button variant="link">
<Link href="/">
<CliniaIcon />
</Link>
</Button>
<div className="cursor-pointer p-2" onClick={() => router.push('/')}>
<CliniaIcon />
</div>
</div>
</aside>
);
Expand Down

0 comments on commit e98c463

Please sign in to comment.