Openstatus www.openstatus.dev
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix/custom domain on save (#224)

* chore: little stuff

* fix: ssr error - checking csr user instead

* hotfix: missing custom domain

authored by

Maximilian Kaske and committed by
GitHub
f603b1ba 794b8901

+31 -30
+7 -2
apps/web/src/app/app/(auth)/layout.tsx
··· 1 1 import * as React from "react"; 2 - 3 - // TODO: update description 2 + import { redirect } from "next/navigation"; 3 + import { auth } from "@clerk/nextjs"; 4 4 5 5 export default function AuthLayout({ 6 6 children, 7 7 }: { 8 8 children: React.ReactNode; 9 9 }) { 10 + const { userId } = auth(); 11 + 12 + if (userId) { 13 + redirect("/app"); 14 + } 10 15 return ( 11 16 <div className="grid min-h-screen grid-cols-1 md:grid-cols-2 xl:grid-cols-3"> 12 17 <aside className="border-border col-span-1 flex w-full items-center justify-center border p-3 backdrop-blur-[2px] md:p-6">
+1 -9
apps/web/src/app/app/(auth)/sign-in/[[...sign-in]]/page.tsx
··· 1 - import { redirect } from "next/navigation"; 2 - import { auth, SignIn } from "@clerk/nextjs"; 1 + import { SignIn } from "@clerk/nextjs"; 3 2 4 3 export default function Page() { 5 - const { userId } = auth(); 6 - 7 - // TODO: we can improve the UX here. If user is logged in, (s)he will see the screen for a quick moment 8 - if (userId) { 9 - redirect("/app"); 10 - } 11 - 12 4 return <SignIn redirectUrl={"/app"} afterSignInUrl={"/app"} />; 13 5 }
+1 -9
apps/web/src/app/app/(auth)/sign-up/[[...sign-up]]/page.tsx
··· 1 - import { redirect } from "next/navigation"; 2 - import { auth, SignUp } from "@clerk/nextjs"; 1 + import { SignUp } from "@clerk/nextjs"; 3 2 4 3 export default function Page() { 5 - const { userId } = auth(); 6 - 7 - // TODO: we can improve the UX here. If user is logged in, (s)he will see the screen for a quick moment 8 - if (userId) { 9 - redirect("/app"); 10 - } 11 - 12 4 return <SignUp redirectUrl={"/app"} afterSignUpUrl={"/app"} />; 13 5 }
-1
apps/web/src/app/blog/[slug]/page.tsx
··· 75 75 ); 76 76 }; 77 77 78 - // TODO: add author.avatar and author.url 79 78 return ( 80 79 <> 81 80 <BackButton href="/blog" />
+1
apps/web/src/components/forms/status-page-form.tsx
··· 54 54 workspaceId: defaultValues?.workspaceId || 0, 55 55 id: defaultValues?.id || 0, 56 56 monitors: defaultValues?.monitors ?? [], 57 + customDomain: defaultValues?.customDomain || "", // HOTFIX: we need to keep all the other overwrites. Ideally, we append it in the api.update({ ...defaultValues, ...props }) 57 58 workspaceSlug: "", 58 59 icon: defaultValues?.icon || "", 59 60 },
+1 -1
apps/web/src/components/layout/app-header.tsx
··· 19 19 href="/" 20 20 className="font-cal text-muted-foreground hover:text-foreground text-lg" 21 21 > 22 - openstatus 22 + OpenStatus 23 23 </Link> 24 24 <div className="flex items-center gap-4"> 25 25 {/* can be moved to a different place */}
+10 -7
apps/web/src/components/layout/marketing-footer.tsx
··· 22 22 </div> 23 23 <div className="flex flex-col gap-3 text-sm"> 24 24 <p className="text-foreground font-semibold">Community</p> 25 - <FooterLink 26 - href="https://github.com/openstatushq/openstatus" 27 - label="GitHub" 28 - /> 29 - <FooterLink href="https://discord.gg/dHD4JtSfsn" label="Discord" /> 25 + <FooterLink href="/github" label="GitHub" external /> 26 + <FooterLink href="/discord" label="Discord" external /> 30 27 </div> 31 28 <div className="flex flex-col gap-3 text-sm"> 32 29 <p className="text-foreground font-semibold">Resources</p> ··· 44 41 ); 45 42 } 46 43 47 - function FooterLink({ href, label }: Record<"href" | "label", string>) { 48 - const isExternal = href.startsWith("http"); 44 + interface FooterLinkProps { 45 + href: string; 46 + label: string; 47 + external?: boolean; 48 + } 49 + 50 + function FooterLink({ href, label, external = false }: FooterLinkProps) { 51 + const isExternal = external || href.startsWith("http"); 49 52 50 53 const LinkSlot = isExternal ? "a" : Link; 51 54
+10 -1
apps/web/src/components/layout/marketing-header.tsx
··· 1 + "use client"; 2 + 1 3 import Link from "next/link"; 4 + import { useUser } from "@clerk/nextjs"; 2 5 3 6 import { Button } from "@/components/ui/button"; 4 7 import { cn } from "@/lib/utils"; ··· 9 12 } 10 13 11 14 export function MarketingHeader({ className }: Props) { 15 + const { isSignedIn } = useUser(); 16 + 12 17 return ( 13 18 <header 14 19 className={cn( ··· 22 27 <Link href="/blog">Blog</Link> 23 28 </Button> 24 29 <Button asChild className="rounded-full"> 25 - <Link href="/app/sign-up">Sign Up</Link> 30 + {isSignedIn ? ( 31 + <Link href="/app">Dashboard</Link> 32 + ) : ( 33 + <Link href="/app/sign-up">Sign Up</Link> 34 + )} 26 35 </Button> 27 36 </div> 28 37 </header>