Openstatus www.openstatus.dev

fix: link, font and toast error (#1302)

authored by

Maximilian Kaske and committed by
GitHub
c14536d3 8b6d0611

+31 -12
+3 -4
apps/dashboard/src/app/(public)/login/layout.tsx
··· 1 1 import Image from "next/image"; 2 - import Link from "next/link"; 3 2 import { redirect } from "next/navigation"; 4 3 5 4 import { auth } from "@/lib/auth"; ··· 14 13 15 14 return ( 16 15 <div className="grid min-h-screen grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-5"> 17 - <aside className="col-span-1 flex w-full flex-col gap-4 border border-border p-4 backdrop-blur-[2px] md:p-8 xl:col-span-2"> 18 - <Link href="/" className="relative h-8 w-8"> 16 + <aside className="col-span-1 flex w-full flex-col gap-4 border border-border p-4 backdrop-blur-[2px] md:p-8 xl:col-span-2 bg-sidebar"> 17 + <a href="https://openstatus.dev" className="relative h-8 w-8"> 19 18 <Image 20 19 src="https://openstatus.dev/icon.png" 21 20 alt="OpenStatus" ··· 23 22 width={32} 24 23 className="rounded-full border border-border" 25 24 /> 26 - </Link> 25 + </a> 27 26 <div className="mx-auto flex w-full max-w-lg flex-1 flex-col justify-center gap-8 text-center md:text-left"> 28 27 <div className="mx-auto grid gap-3"> 29 28 <h1 className="font-cal text-3xl text-foreground">
+4 -4
apps/dashboard/src/app/(public)/login/page.tsx
··· 16 16 const { redirectTo } = searchParamsCache.parse(searchParams); 17 17 18 18 return ( 19 - <div className="my-4 grid w-full max-w-xl gap-6 md:p-10"> 20 - <div className="flex flex-col gap-2 text-center"> 19 + <div className="my-4 grid w-full max-w-lg gap-6"> 20 + <div className="flex flex-col gap-1 text-center"> 21 21 <h1 className="font-semibold text-3xl tracking-tight">Sign In</h1> 22 22 <p className="text-muted-foreground text-sm"> 23 23 Get started now. No credit card required. ··· 56 56 <p className="px-8 text-center text-muted-foreground text-sm"> 57 57 By clicking continue, you agree to our{" "} 58 58 <Link 59 - href="/legal/terms" 59 + href="https://openstatus.dev/legal/terms" 60 60 className="underline underline-offset-4 hover:text-primary hover:no-underline" 61 61 > 62 62 Terms of Service 63 63 </Link>{" "} 64 64 and{" "} 65 65 <Link 66 - href="/legal/privacy" 66 + href="https://openstatus.dev/legal/privacy" 67 67 className="underline underline-offset-4 hover:text-primary hover:no-underline" 68 68 > 69 69 Privacy Policy
+7 -1
apps/dashboard/src/app/layout.tsx
··· 5 5 import { TailwindIndicator } from "@/components/tailwind-indicator"; 6 6 import { ThemeProvider } from "@/components/theme-provider"; 7 7 import { Toaster } from "@/components/ui/sonner"; 8 + import { cn } from "@/lib/utils"; 8 9 import LocalFont from "next/font/local"; 9 10 import { NuqsAdapter } from "nuqs/adapters/next/app"; 10 11 import { ogMetadata, twitterMetadata } from "./metadata"; ··· 45 46 return ( 46 47 <html lang="en" suppressHydrationWarning> 47 48 <body 48 - className={`${geistSans.variable}${geistMono.variable}${cal.variable} antialiased`} 49 + className={cn( 50 + geistSans.variable, 51 + geistMono.variable, 52 + cal.variable, 53 + "antialiased", 54 + )} 49 55 > 50 56 <NuqsAdapter> 51 57 <ThemeProvider
+8 -1
apps/dashboard/src/components/forms/onboarding/create-monitor.tsx
··· 11 11 } from "@/components/ui/form"; 12 12 import { Input } from "@/components/ui/input"; 13 13 import { zodResolver } from "@hookform/resolvers/zod"; 14 + import { isTRPCClientError } from "@trpc/client"; 14 15 import { useTransition } from "react"; 15 16 import { useForm } from "react-hook-form"; 16 17 import { toast } from "sonner"; ··· 47 48 toast.promise(promise, { 48 49 loading: "Saving...", 49 50 success: () => "Saved", 50 - error: "Failed to save", 51 + error: (error) => { 52 + if (isTRPCClientError(error)) { 53 + return error.message; 54 + } 55 + console.error(error); 56 + return "Failed to save"; 57 + }, 51 58 }); 52 59 await promise; 53 60 } catch (error) {
+8 -1
apps/dashboard/src/components/forms/onboarding/create-page.tsx
··· 11 11 FormMessage, 12 12 } from "@/components/ui/form"; 13 13 import { zodResolver } from "@hookform/resolvers/zod"; 14 + import { isTRPCClientError } from "@trpc/client"; 14 15 import { useTransition } from "react"; 15 16 import { useForm } from "react-hook-form"; 16 17 import { toast } from "sonner"; ··· 45 46 toast.promise(promise, { 46 47 loading: "Saving...", 47 48 success: () => "Saved", 48 - error: "Failed to save", 49 + error: (error) => { 50 + if (isTRPCClientError(error)) { 51 + return error.message; 52 + } 53 + console.error(error); 54 + return "Failed to save"; 55 + }, 49 56 }); 50 57 await promise; 51 58 } catch (error) {