``refactor Rename LoadingScreen component to LoadingSpinner and refactor structure for better reusability``

This commit is contained in:
2025-05-16 15:55:07 +08:00
parent 3556e77a7c
commit 34a7ff7ac9

View File

@@ -1,25 +1,32 @@
import { IonContent, IonPage, IonSpinner } from '@ionic/react'; import { IonContent, IonPage, IonSpinner } from '@ionic/react';
import React from 'react';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
export function LoadingScreen() { export function LoadingSpinner(): React.JSX.Element {
const { t, i18n } = useTranslation(); const { t } = useTranslation();
return (
<div
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
gap: '1rem',
//
marginTop: '33vh',
}}
>
<IonSpinner></IonSpinner>
<div>{t('Loading')}</div>
</div>
);
}
export function LoadingScreen(): React.JSX.Element {
return ( return (
<IonPage> <IonPage>
<IonContent fullscreen> <IonContent fullscreen>
<div <LoadingSpinner />
style={{
display: 'flex',
flexDirection: 'column',
alignItems: 'center',
gap: '1rem',
//
marginTop: '33vh',
}}
>
<IonSpinner></IonSpinner>
<div>{t('Loading')}</div>
</div>
</IonContent> </IonContent>
</IonPage> </IonPage>
); );