From 192d8fe47c4a818c34c0a6601f8d3ecc6c0be348 Mon Sep 17 00:00:00 2001 From: lillijo Date: Thu, 20 Jun 2024 15:17:20 +0200 Subject: [PATCH] small fixes --- public/assets/placeholder.png | Bin 0 -> 373 bytes src/components/filters/filterGroup.tsx | 4 +++- .../header/navigation/mobile/menu.tsx | 2 +- src/components/image.tsx | 20 +++--------------- src/components/project/authors.server.tsx | 17 +-------------- src/components/project/image.server.tsx | 4 ++-- src/components/smoothbutton.tsx | 4 +--- src/types/item.ts | 2 +- 8 files changed, 12 insertions(+), 41 deletions(-) create mode 100644 public/assets/placeholder.png diff --git a/public/assets/placeholder.png b/public/assets/placeholder.png new file mode 100644 index 0000000000000000000000000000000000000000..a7b758ea35a8237903a723cf61ef898b7a404299 GIT binary patch literal 373 zcmeAS@N?(olHy`uVBq!ia0vp^CxAGGgAGU?ZmZ`8Qk(@Ik;M!Q+`=Ht$S`Y;1W=H% zILO_JVcj{Imp~3nx}&cn1H;CC?mvmFKshc?7srqa#pF literal 0 HcmV?d00001 diff --git a/src/components/filters/filterGroup.tsx b/src/components/filters/filterGroup.tsx index 94af56b..743e942 100644 --- a/src/components/filters/filterGroup.tsx +++ b/src/components/filters/filterGroup.tsx @@ -3,6 +3,7 @@ import FilterTag from '@/components/filterTag'; import { useAppStore } from '@/lib/useAppContext'; import { Filter } from '@/types/types'; import { useTranslations } from 'next-intl'; +import { useSearchParams } from 'next/navigation'; export type FilterGroupProps = { title: 'faculties' | 'formats' | 'languages'; @@ -11,7 +12,8 @@ export type FilterGroupProps = { export default function FilterGroup({ title, list }: FilterGroupProps) { const t = useTranslations('Filtering'); - const selectedId = useAppStore((state) => state[list[0]?.searchParam ?? '']); + const searchParams = useSearchParams(); + const selectedId = searchParams.get(list[0]?.searchParam ?? ''); return (
{t(title)}:
diff --git a/src/components/header/navigation/mobile/menu.tsx b/src/components/header/navigation/mobile/menu.tsx index 9d873ea..d1ec71b 100644 --- a/src/components/header/navigation/mobile/menu.tsx +++ b/src/components/header/navigation/mobile/menu.tsx @@ -1,7 +1,7 @@ import { useAppStore } from '@/lib/useAppContext'; import cx from 'classnames'; import { Link } from '@/navigation'; -import { ColorSchemeSwitcher } from '../colorSchemeSwitcher'; +import ColorSchemeSwitcher from '../colorSchemeSwitcher'; import SmoothButton from '@/components/smoothbutton'; export type MenuMobileProps = {}; diff --git a/src/components/image.tsx b/src/components/image.tsx index 7fd5401..cf2ce70 100644 --- a/src/components/image.tsx +++ b/src/components/image.tsx @@ -6,19 +6,6 @@ export type ImageWrapperProps = { src: string; alt?: string; }; -const keyStr = - 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - -const triplet = (e1: number, e2: number, e3: number) => - keyStr.charAt(e1 >> 2) + - keyStr.charAt(((e1 & 3) << 4) | (e2 >> 4)) + - keyStr.charAt(((e2 & 15) << 2) | (e3 >> 6)) + - keyStr.charAt(e3 & 63); - -const rgbDataURL = (r: number, g: number, b: number) => - `data:image/gif;base64,R0lGODlhAQABAPAA${ - triplet(0, r, g) + triplet(b, 255, 255) - }/yH5BAAAAAAALAAAAAABAAEAAAICRAEAOw==`; export default function ImageWrapper({ className, @@ -28,15 +15,14 @@ export default function ImageWrapper({ return ( {alt ); } diff --git a/src/components/project/authors.server.tsx b/src/components/project/authors.server.tsx index 8719208..8cb6c59 100644 --- a/src/components/project/authors.server.tsx +++ b/src/components/project/authors.server.tsx @@ -7,24 +7,9 @@ export default function ProjectCardAuthors({ item }: ProjectCardProps) { return <>; } - return ( - - - {item.authors.join(' ')} - - - ); -} - -function ProjectCardAuthorsContainer({ children }: ReactNodeProps) { return (
- {children} + {item.authors.join(' ')}
); } diff --git a/src/components/project/image.server.tsx b/src/components/project/image.server.tsx index e2e2875..6a55d6c 100644 --- a/src/components/project/image.server.tsx +++ b/src/components/project/image.server.tsx @@ -6,8 +6,8 @@ export default function ProjectCardImage({ item }: ProjectCardProps) { return (
diff --git a/src/components/smoothbutton.tsx b/src/components/smoothbutton.tsx index c2792c4..06e1ce5 100644 --- a/src/components/smoothbutton.tsx +++ b/src/components/smoothbutton.tsx @@ -15,9 +15,7 @@ export default function SmoothButton({ className={cx( 'group absolute h-10 w-10 hover:bg-primary hover:text-highlight', `bg-${color}`, - bottom - ? 'bottom-gutter-xs right-gutter-xs rounded-br-md rounded-tl-md' - : '', + bottom ? 'bottom-0 right-0 rounded-br-md rounded-tl-md' : '', top ? 'right-0 top-0 rounded-bl-md ' : '', )} title={title} diff --git a/src/types/item.ts b/src/types/item.ts index 5cbab63..4de60b0 100644 --- a/src/types/item.ts +++ b/src/types/item.ts @@ -9,7 +9,7 @@ export type ItemContent = { export type Item = { id: string; name: string; - thumbnail?: string; + thumbnail: string; thumbnail_full_size?: string; descriptions?: ItemDescription; languages?: string[];