replace inline loading text with LoadingScreen component in multiple pages
```
This commit is contained in:
louiscklaw
2025-05-14 16:27:30 +08:00
parent 0aefbfaeae
commit 56f0f30ffb
3 changed files with 5 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ const LessonContainer: React.FC<ContainerProps> = ({ lesson_type_id: lesson_type
if (loading) return <LoadingScreen />;
if (!selected_content) return <LoadingScreen />;
if (selected_content.length == 0) return <>loading</>;
if (selected_content.length == 0) return <LoadingScreen />;
return (
<>

View File

@@ -20,6 +20,7 @@ import { Paths } from '../../../Paths';
import { useTranslation } from 'react-i18next';
import { useEffect, useState } from 'react';
import { useUser } from '../../../hooks/use-user';
import { LoadingScreen } from '../../../components/LoadingScreen';
const AuthHome = () => {
const { t } = useTranslation();
@@ -42,7 +43,7 @@ const AuthHome = () => {
setShowLoading(false);
}, []);
if (showLoading) return <>loading</>;
if (showLoading) return <LoadingScreen />;
if (showError) return <>{showError.message}</>;
return (

View File

@@ -28,6 +28,7 @@ import { useEffect, useState } from 'react';
import { getUserMetaById } from '../../../db/UserMetas/GetById';
import { useTranslation } from 'react-i18next';
import { UserMeta } from '../../../db/UserMetas/type';
import { LoadingScreen } from '../../../components/LoadingScreen';
function StudentInfo(): React.JSX.Element {
const router = useIonRouter();
@@ -64,7 +65,7 @@ function StudentInfo(): React.JSX.Element {
void handleFetchUserMeta();
}, []);
if (showLoading) return <>loading</>;
if (showLoading) return <LoadingScreen />;
if (showError.show) return <>{showError.message}</>;
return (