diff --git a/web/index.html b/web/index.html index 6c89972..bbe7827 100644 --- a/web/index.html +++ b/web/index.html @@ -24,9 +24,34 @@ inbuxa + + -
+
diff --git a/web/src/App.tsx b/web/src/App.tsx index b301169..7e35dbb 100644 --- a/web/src/App.tsx +++ b/web/src/App.tsx @@ -11,7 +11,7 @@ import { push } from "@/jmap/push"; import { client } from "@/jmap/client"; import { ToastHost, toast } from "@/ui/toast"; import { ConfirmHost } from "@/ui/dialog"; -import { Spinner } from "@/ui/misc"; +import { AppLoading, Spinner } from "@/ui/misc"; import { LoginPage } from "@/views/Login"; import { AppShell } from "@/views/AppShell"; import { MailView } from "@/views/mail/MailView"; @@ -69,13 +69,7 @@ export function App() { return () => { live = false; }; }, []); - if (status === "loading" || !languageReady) { - return ( -
- -
- ); - } + if (status === "loading" || !languageReady) return ; return ( /* * Every in-app navigation runs through `aroundNav` -- links, redirects and @@ -346,13 +340,7 @@ function AuthedApp() { // Nothing worth painting until the account's settings are in force; see the // comment on `ready` above. With a cache this was true from the first frame. - if (!ready) { - return ( -
- -
- ); - } + if (!ready) return ; return ( diff --git a/web/src/ui/misc.tsx b/web/src/ui/misc.tsx index 813bca8..3e10f25 100644 --- a/web/src/ui/misc.tsx +++ b/web/src/ui/misc.tsx @@ -4,6 +4,7 @@ import { avatarColor, initials } from "@/lib/address"; import { useContacts } from "@/store/contacts"; import { contactPhoto } from "@/lib/contacts"; import { t } from "@/lib/i18n"; +import { brandImage } from "@/lib/brand"; export function Avatar({ who, size, className }: { who: EmailAddress | { name?: string | null; email?: string } | string | null | undefined; size?: "sm" | "lg" | "xl"; className?: string }) { const email = typeof who === "string" ? who : (who?.email ?? ""); @@ -52,6 +53,22 @@ export function Spinner({ size = "md", label }: { size?: "md" | "lg"; label?: st ); } +/** + * The app's loading view while the session is checked and the account's + * settings arrive (#134): the same markup as the placeholder in index.html, + * which draws it before any JavaScript runs, and styled by the rules there, so + * nothing moves when React takes over. The mark is inbuxa's on every instance, + * as it has to be in index.html. + */ +export function AppLoading() { + return ( +
+ + +
+ ); +} + export function Empty({ icon, title, children }: { icon?: ReactNode; title: string; children?: ReactNode }) { return (