Skip to content

Commit

Permalink
Introduce item id subtext
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemans committed Dec 19, 2024
1 parent e990d55 commit 4508bd8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 6 additions & 1 deletion web/src/layouts/SimpleCenterPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { getTitle } from '@/util/title';

export type SCPageProperties = PropsWithChildren<{
title: string;
subtext?: string;
width?: 'xl' | '2xl' | '3xl' | '4xl' | '5xl';
suffix?: ReactNode;
className?: ClassValue;
Expand All @@ -14,6 +15,7 @@ export type SCPageProperties = PropsWithChildren<{
export const SCPage: FC<SCPageProperties> = ({
children,
title,
subtext,
width = '4xl',
suffix,
className,
Expand All @@ -35,7 +37,10 @@ export const SCPage: FC<SCPageProperties> = ({
)}
>
<div className="flex items-end justify-between">
<h1 className="h1 pl-4">{title}</h1>
<div>
<h1 className="h1 pl-4">{title}</h1>
{subtext && <div className="text-sm pl-4">{subtext}</div>}
</div>
{suffix}
</div>
{children}
Expand Down
5 changes: 3 additions & 2 deletions web/src/routes/item/$itemId/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const Route = createFileRoute('/item/$itemId/')({
console.log('params', params);

if (params.itemId == '') {
return redirect({ to: '/items' });
return redirect({ to: '/items', search: { view: 'full' } });
}

// Ensure instance settings are loaded
Expand Down Expand Up @@ -71,6 +71,7 @@ export const Route = createFileRoute('/item/$itemId/')({
return (
<SCPage
title={(item.data && item.data.name) || `Item ${itemId}`}
subtext={`#${itemId}`}
suffix={
<Button asChild>
<Link
Expand All @@ -83,7 +84,7 @@ export const Route = createFileRoute('/item/$itemId/')({
</Button>
}
>
<div className="card pt-4">
<div className="card pt-4 no-padding">
<div className="px-4">
<MediaGallery media_ids={media.data} />
</div>
Expand Down

0 comments on commit 4508bd8

Please sign in to comment.