feat: add configurable headers and instance branding (#6690)
This commit is contained in:
1 parent
97d8390b20
commit
9303dbd284
102 files changed
+12153
-609
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import type { ReactNode } from "react";
|
||||
import type { CSSProperties, ReactNode } from "react";
|
||||
import { Group, Paper, Stack, Text, ThemeIcon, Title } from "@mantine/core";
|
||||
|
||||
import { OnboardingBackdrop } from "./onboarding-backdrop";
|
||||
@@ -11,17 +11,72 @@ interface OnboardingAuthShellProps {
|
||||
icon: ReactNode;
|
||||
children: ReactNode;
|
||||
footer?: ReactNode;
|
||||
appName?: string;
|
||||
showAppName?: boolean;
|
||||
showAppLogo?: boolean;
|
||||
primaryColor?: string;
|
||||
secondaryColor?: string;
|
||||
wordmarkPrimaryColor?: string;
|
||||
wordmarkSecondaryColor?: string;
|
||||
logoImageUrl?: string;
|
||||
backgroundImageUrl?: string;
|
||||
backgroundOverlay?: number;
|
||||
radius?: "xs" | "sm" | "md" | "lg" | "xl";
|
||||
}
|
||||
|
||||
export const OnboardingAuthShell = ({ title, description, icon, children, footer }: OnboardingAuthShellProps) => (
|
||||
<main className={classes.page}>
|
||||
export const OnboardingAuthShell = ({
|
||||
title,
|
||||
description,
|
||||
icon,
|
||||
children,
|
||||
footer,
|
||||
appName,
|
||||
showAppName = false,
|
||||
showAppLogo = false,
|
||||
primaryColor,
|
||||
secondaryColor,
|
||||
wordmarkPrimaryColor,
|
||||
wordmarkSecondaryColor,
|
||||
logoImageUrl,
|
||||
backgroundImageUrl,
|
||||
backgroundOverlay = 0.55,
|
||||
radius = "lg",
|
||||
}: OnboardingAuthShellProps) => (
|
||||
<main
|
||||
className={classes.page}
|
||||
data-background-image={backgroundImageUrl ? true : undefined}
|
||||
style={
|
||||
{
|
||||
"--studio-glow-color": primaryColor,
|
||||
"--studio-secondary-glow-color": secondaryColor,
|
||||
"--auth-background-overlay": backgroundOverlay,
|
||||
} as CSSProperties
|
||||
}
|
||||
>
|
||||
{backgroundImageUrl ? (
|
||||
<div
|
||||
aria-hidden
|
||||
className={classes.authBackground}
|
||||
style={{ backgroundImage: `url(${JSON.stringify(backgroundImageUrl)})` }}
|
||||
/>
|
||||
) : null}
|
||||
<OnboardingBackdrop />
|
||||
<div className={`${classes.shell} ${classes.authShell}`}>
|
||||
<Stack className={classes.authLayout} gap="xl" align="center" justify="center">
|
||||
<div className={classes.authBrand}>
|
||||
<OnboardingWordmark large />
|
||||
</div>
|
||||
<Paper className={`${classes.studio} ${classes.authCard}`} radius="lg" p={{ base: "lg", sm: "xl" }}>
|
||||
{showAppName || showAppLogo ? (
|
||||
<div className={classes.authBrand}>
|
||||
<OnboardingWordmark
|
||||
large
|
||||
appName={appName}
|
||||
showAppName={showAppName}
|
||||
showAppLogo={showAppLogo}
|
||||
primaryColor={wordmarkPrimaryColor}
|
||||
secondaryColor={wordmarkSecondaryColor}
|
||||
logoImageUrl={logoImageUrl}
|
||||
/>
|
||||
</div>
|
||||
) : null}
|
||||
<Paper className={`${classes.studio} ${classes.authCard}`} radius={radius} p={{ base: "lg", sm: "xl" }}>
|
||||
<Stack gap="xl">
|
||||
<Group wrap="nowrap" align="flex-start">
|
||||
<ThemeIcon size="xl" radius="lg" variant="light">
|
||||
|
||||
Reference in new issue
Block a user