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