mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-01 15:23:58 +00:00
fix: correct font variable usage and improve type handling in dynamic filter
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 7m18s
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 7m18s
This commit is contained in:
@ -5,6 +5,7 @@
|
|||||||
@custom-variant dark (&:is(.dark *));
|
@custom-variant dark (&:is(.dark *));
|
||||||
|
|
||||||
@theme inline {
|
@theme inline {
|
||||||
|
--font-bokor: var(--font-bokor);
|
||||||
--font-barlow: var(--font-barlow);
|
--font-barlow: var(--font-barlow);
|
||||||
--font-mono: var(--font-mono);
|
--font-mono: var(--font-mono);
|
||||||
--radius-sm: calc(var(--radius) - 4px);
|
--radius-sm: calc(var(--radius) - 4px);
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import { ThemeProvider } from "@/providers/theme-provider";
|
|
||||||
import { Provider } from "jotai";
|
import { Provider } from "jotai";
|
||||||
|
import { ThemeProvider } from "@/providers/theme-provider";
|
||||||
|
|
||||||
import type { Metadata } from "next";
|
import type { Metadata } from "next";
|
||||||
import { Barlow } from "next/font/google";
|
import { Barlow, Bokor } from "next/font/google";
|
||||||
import NextTopLoader from "nextjs-toploader";
|
import NextTopLoader from "nextjs-toploader";
|
||||||
import { Toaster } from "sonner";
|
import { Toaster } from "sonner";
|
||||||
import "./globals.css";
|
import "./globals.css";
|
||||||
@ -16,6 +16,12 @@ const barlow = Barlow({
|
|||||||
variable: "--font-barlow",
|
variable: "--font-barlow",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const bokor = Bokor({
|
||||||
|
subsets: ["latin"],
|
||||||
|
weight: ["400"],
|
||||||
|
variable: "--font-bokor",
|
||||||
|
});
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "SAR Link Portal",
|
title: "SAR Link Portal",
|
||||||
description: "Sarlink Portal",
|
description: "Sarlink Portal",
|
||||||
@ -29,7 +35,7 @@ export default async function RootLayout({
|
|||||||
const session = await getServerSession(authOptions);
|
const session = await getServerSession(authOptions);
|
||||||
return (
|
return (
|
||||||
<html lang="en" suppressHydrationWarning>
|
<html lang="en" suppressHydrationWarning>
|
||||||
<body className={`${barlow.variable} antialiased font-sans bg-gray-100 dark:bg-black`}>
|
<body className={`${barlow.variable} ${bokor.variable} antialiased font-sans bg-gray-100 dark:bg-black`}>
|
||||||
<AuthProvider session={session || undefined}>
|
<AuthProvider session={session || undefined}>
|
||||||
<Provider>
|
<Provider>
|
||||||
<NextTopLoader color="#f49d1b" showSpinner={false} zIndex={9999} />
|
<NextTopLoader color="#f49d1b" showSpinner={false} zIndex={9999} />
|
||||||
|
@ -244,11 +244,11 @@ export default function DynamicFilter<
|
|||||||
if (input.type === "checkbox-group") {
|
if (input.type === "checkbox-group") {
|
||||||
(clearedInputState as FilterValues<TFilterKeys, TInputs>)[
|
(clearedInputState as FilterValues<TFilterKeys, TInputs>)[
|
||||||
input.name as TFilterKeys
|
input.name as TFilterKeys
|
||||||
] = [] as any;
|
] = [] as FilterValues<TFilterKeys, TInputs>[typeof input.name];
|
||||||
} else {
|
} else if (input.type === "radio-group" || input.type === "string" || input.type === "number") {
|
||||||
(clearedInputState as FilterValues<TFilterKeys, TInputs>)[
|
(clearedInputState as FilterValues<TFilterKeys, TInputs>)[
|
||||||
input.name as TFilterKeys
|
input.name as TFilterKeys
|
||||||
] = "" as any;
|
] = "" as FilterValues<TFilterKeys, TInputs>[typeof input.name];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setInputValues(clearedInputState as FilterValues<TFilterKeys, TInputs>);
|
setInputValues(clearedInputState as FilterValues<TFilterKeys, TInputs>);
|
||||||
@ -297,7 +297,7 @@ export default function DynamicFilter<
|
|||||||
|
|
||||||
// Dynamic `prettyPrintFilter` for badges
|
// Dynamic `prettyPrintFilter` for badges
|
||||||
const prettyPrintFilter = (
|
const prettyPrintFilter = (
|
||||||
key: TFilterKeys,
|
_key: TFilterKeys,
|
||||||
value: string | string[],
|
value: string | string[],
|
||||||
config: FilterInputConfig<TFilterKeys>,
|
config: FilterInputConfig<TFilterKeys>,
|
||||||
) => {
|
) => {
|
||||||
@ -342,7 +342,7 @@ export default function DynamicFilter<
|
|||||||
<Drawer open={isOpen} onOpenChange={setIsOpen}>
|
<Drawer open={isOpen} onOpenChange={setIsOpen}>
|
||||||
<DrawerTrigger asChild>
|
<DrawerTrigger asChild>
|
||||||
<Button
|
<Button
|
||||||
className="w-full sm:w-48 flex items-end justify-between"
|
className="w-full font-barlow sm:w-48 flex items-end justify-between"
|
||||||
onClick={() => setIsOpen(!isOpen)}
|
onClick={() => setIsOpen(!isOpen)}
|
||||||
variant="outline"
|
variant="outline"
|
||||||
>
|
>
|
||||||
|
Reference in New Issue
Block a user