) => {
+ setFileExt(event.target.value);
+ };
+
+ return (
+
+ );
+}
diff --git a/002_source/ionic_mobile/src/contexts/CheckScreenWidth/QrHere/styles.css b/002_source/ionic_mobile/src/contexts/CheckScreenWidth/QrHere/styles.css
new file mode 100644
index 0000000..59b0604
--- /dev/null
+++ b/002_source/ionic_mobile/src/contexts/CheckScreenWidth/QrHere/styles.css
@@ -0,0 +1,4 @@
+.App {
+ font-family: sans-serif;
+ text-align: center;
+}
diff --git a/002_source/ionic_mobile/src/contexts/CheckScreenWidth/index.tsx b/002_source/ionic_mobile/src/contexts/CheckScreenWidth/index.tsx
new file mode 100644
index 0000000..852368b
--- /dev/null
+++ b/002_source/ionic_mobile/src/contexts/CheckScreenWidth/index.tsx
@@ -0,0 +1,43 @@
+import * as React from 'react';
+import QrHere from './QrHere';
+import { IonText } from '@ionic/react';
+import { useTranslation } from 'react-i18next';
+import Footer from '../../components/Footer';
+
+export interface ProviderProps {
+ children: React.ReactNode;
+}
+
+export function CheckScreenWidth({ children }: ProviderProps): React.JSX.Element {
+ const { t } = useTranslation();
+ const [showQrCode, setShowQrCode] = React.useState(false);
+ React.useEffect(() => {
+ setShowQrCode(window.screen.width > 800);
+ }, []);
+ return (
+ <>
+ {showQrCode ? (
+ <>
+
+
+
+ {t('please-use-mobile-for-better-experience')}
+
+
+ >
+ ) : (
+ <>{children}>
+ )}
+ >
+ );
+}
diff --git a/002_source/ionic_mobile/src/contexts/I18nProvider.tsx b/002_source/ionic_mobile/src/contexts/I18nProvider.tsx
index 212f9ba..bbff96c 100644
--- a/002_source/ionic_mobile/src/contexts/I18nProvider.tsx
+++ b/002_source/ionic_mobile/src/contexts/I18nProvider.tsx
@@ -4,16 +4,15 @@ import { useTranslation } from 'react-i18next';
import '../i18n';
export interface I18nProviderProps {
- children: React.ReactNode;
language?: string;
}
-export function I18nProvider({ children, language = 'en' }: I18nProviderProps): React.JSX.Element {
+export function I18nProvider({ language = 'en' }: I18nProviderProps): React.JSX.Element {
const { i18n } = useTranslation();
React.useEffect(() => {
//
}, [i18n, language]);
- return <>{children}>;
+ return <>>;
}
diff --git a/002_source/ionic_mobile/src/contexts/index.tsx b/002_source/ionic_mobile/src/contexts/index.tsx
index 016007f..5a2e685 100644
--- a/002_source/ionic_mobile/src/contexts/index.tsx
+++ b/002_source/ionic_mobile/src/contexts/index.tsx
@@ -1,6 +1,7 @@
import { PocketBaseProvider } from '../hooks/usePocketBase';
import { AppStateProvider } from './AppState';
import { UserProvider } from './auth/user-context';
+import { CheckScreenWidth } from './CheckScreenWidth';
import { I18nProvider } from './I18nProvider';
import { MyIonFavoriteProvider } from './MyIonFavorite';
import { MyIonMetricProvider } from './MyIonMetric';
@@ -13,7 +14,8 @@ const queryClient = new QueryClient();
const ContextMeta = ({ children }: { children: React.ReactNode }) => {
return (
<>
-
+
+
@@ -32,7 +34,7 @@ const ContextMeta = ({ children }: { children: React.ReactNode }) => {
-
+
>
);
};
diff --git a/002_source/ionic_mobile/src/locale/en.ts b/002_source/ionic_mobile/src/locale/en.ts
index f7dd738..2f7cbab 100644
--- a/002_source/ionic_mobile/src/locale/en.ts
+++ b/002_source/ionic_mobile/src/locale/en.ts
@@ -2,9 +2,10 @@
// (tip move them in a JSON file and import them)
const en = {
translation: {
- hello: 'world',
- Loading: 'loading',
- lesson: 'lesson',
+ 'hello': 'world',
+ 'Loading': 'loading',
+ 'lesson': 'lesson',
+ 'please-use-mobile-for-better-experience': 'Please use mobile for better experience',
},
};
diff --git a/002_source/ionic_mobile/src/locale/resources.ts b/002_source/ionic_mobile/src/locale/resources.ts
deleted file mode 100644
index f74d0b7..0000000
--- a/002_source/ionic_mobile/src/locale/resources.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-import en from './en';
-
-export default {
- en,
-};
diff --git a/002_source/ionic_mobile/src/locale/zh.ts b/002_source/ionic_mobile/src/locale/zh.ts
index 9d1046e..e504bd4 100644
--- a/002_source/ionic_mobile/src/locale/zh.ts
+++ b/002_source/ionic_mobile/src/locale/zh.ts
@@ -2,9 +2,10 @@
// (tip move them in a JSON file and import them)
const zh = {
translation: {
- hello: '你好',
- Loading: 'loading',
- lesson: 'lesson',
+ 'hello': '你好',
+ 'Loading': '加載中',
+ 'lesson': '課程',
+ 'please-use-mobile-for-better-experience': '為了更好的體驗,請使用手機瀏覽 😊',
},
};