Skip to content

Commit 668bc28

Browse files
yz778mrdjohnson
authored andcommitted
feat: add spinner to loading page
1 parent ad772b4 commit 668bc28

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

src/icons/StartupSpinner.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
export default function Image() {
2+
return (
3+
<svg
4+
className="mb-4 h-12 w-12 animate-spin text-white"
5+
xmlns="http://www.w3.org/2000/svg"
6+
fill="none"
7+
viewBox="0 0 24 24"
8+
>
9+
<circle
10+
className="opacity-25"
11+
cx="12"
12+
cy="12"
13+
r="10"
14+
stroke="currentColor"
15+
strokeWidth="4"
16+
></circle>
17+
<path
18+
className="opacity-75"
19+
fill="currentColor"
20+
d="M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"
21+
></path>
22+
</svg>
23+
)
24+
}

src/main.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,24 @@ import { initDb } from '~/core/db'
22
import React, { Suspense } from 'react'
33
import ReactDOM from 'react-dom/client'
44
import { KBarProvider } from 'kbar'
5-
import { HeroUIProvider } from "@heroui/react"
5+
import { HeroUIProvider } from '@heroui/react'
66
import { MemoryRouter } from 'react-router-dom'
77

88
import App from '~/App'
99
import DaisyUiThemeProvider from '~/containers/DaisyUiThemeProvider'
1010

1111
import '~/index.css'
12+
import StartupSpinner from './icons/StartupSpinner'
1213

1314
const errorPage = (
14-
<div className="flex h-screen w-screen place-content-center bg-slate-700 text-3xl text-black">
15-
Waiting for app to load, hard refresh may be needed
15+
<div className="flex h-screen w-screen items-center justify-center bg-base-100">
16+
<div className="flex flex-col items-center">
17+
<StartupSpinner />
18+
<span className="text-3xl text-white">Starting LLM X</span>
19+
<span className="mt-2 text-base text-gray-300">
20+
Try a hard refresh if this takes too long
21+
</span>
22+
</div>
1623
</div>
1724
)
1825

0 commit comments

Comments
 (0)