Skip to content

Commit

Permalink
🐬 sow loading screen only after 200ms
Browse files Browse the repository at this point in the history
this removes annoying flashing pages in most cases
  • Loading branch information
anuejn committed Dec 3, 2023
1 parent 031dbda commit 170129f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion frontend/src/pages/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
import { useEffect, useState } from 'react';
import { AppCenter } from '../components/app';
import clsx from 'clsx';

export function LoadingPage() {
const [visible, setVisible] = useState(false);
useEffect(() => {
setTimeout(() => {
setVisible(true);
}, 200);
}, []);

return (
<AppCenter>
<div className="flex flex-col items-center gap-6">
<div className={clsx(visible ? 'flex flex-col items-center gap-6' : 'hidden')}>
<h1 className="font-medium text-4xl">Loading...</h1>
<p>Transcribee is currently loading...</p>
</div>
Expand Down

0 comments on commit 170129f

Please sign in to comment.