```
replace inline loading text with LoadingScreen component in multiple pages ```
This commit is contained in:
@@ -35,7 +35,7 @@ const LessonContainer: React.FC<ContainerProps> = ({ lesson_type_id: lesson_type
|
|||||||
|
|
||||||
if (loading) return <LoadingScreen />;
|
if (loading) return <LoadingScreen />;
|
||||||
if (!selected_content) return <LoadingScreen />;
|
if (!selected_content) return <LoadingScreen />;
|
||||||
if (selected_content.length == 0) return <>loading</>;
|
if (selected_content.length == 0) return <LoadingScreen />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
@@ -20,6 +20,7 @@ import { Paths } from '../../../Paths';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useUser } from '../../../hooks/use-user';
|
import { useUser } from '../../../hooks/use-user';
|
||||||
|
import { LoadingScreen } from '../../../components/LoadingScreen';
|
||||||
|
|
||||||
const AuthHome = () => {
|
const AuthHome = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -42,7 +43,7 @@ const AuthHome = () => {
|
|||||||
setShowLoading(false);
|
setShowLoading(false);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (showLoading) return <>loading</>;
|
if (showLoading) return <LoadingScreen />;
|
||||||
if (showError) return <>{showError.message}</>;
|
if (showError) return <>{showError.message}</>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@@ -28,6 +28,7 @@ import { useEffect, useState } from 'react';
|
|||||||
import { getUserMetaById } from '../../../db/UserMetas/GetById';
|
import { getUserMetaById } from '../../../db/UserMetas/GetById';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { UserMeta } from '../../../db/UserMetas/type';
|
import { UserMeta } from '../../../db/UserMetas/type';
|
||||||
|
import { LoadingScreen } from '../../../components/LoadingScreen';
|
||||||
|
|
||||||
function StudentInfo(): React.JSX.Element {
|
function StudentInfo(): React.JSX.Element {
|
||||||
const router = useIonRouter();
|
const router = useIonRouter();
|
||||||
@@ -64,7 +65,7 @@ function StudentInfo(): React.JSX.Element {
|
|||||||
void handleFetchUserMeta();
|
void handleFetchUserMeta();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (showLoading) return <>loading</>;
|
if (showLoading) return <LoadingScreen />;
|
||||||
if (showError.show) return <>{showError.message}</>;
|
if (showError.show) return <>{showError.message}</>;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user