diff --git a/front/components/APKDownloadButton.tsx b/front/components/APKDownloadButton.tsx new file mode 100644 index 0000000..88308c8 --- /dev/null +++ b/front/components/APKDownloadButton.tsx @@ -0,0 +1,20 @@ +import { ArrowCircleDown2 } from 'iconsax-react-native'; +import ButtonBase from './UI/ButtonBase'; +import { translate } from '../i18n/i18n'; +import { Linking } from 'react-native'; + +const APKDownloadButton = () => { + return ( + + Linking.openURL('https://github.com/Chroma-Case/Chromacase/releases/download/v0.8.4/android-build.apk') + } + /> + ); +}; + +export default APKDownloadButton; diff --git a/front/components/UI/ScaffoldAuth.tsx b/front/components/UI/ScaffoldAuth.tsx index bb9adde..148b21f 100644 --- a/front/components/UI/ScaffoldAuth.tsx +++ b/front/components/UI/ScaffoldAuth.tsx @@ -1,7 +1,7 @@ import { LinearGradient } from 'expo-linear-gradient'; import { Stack, View, Text, Wrap, Image, Row, Column, ScrollView, useToast } from 'native-base'; import { FunctionComponent } from 'react'; -import { Linking, useWindowDimensions } from 'react-native'; +import { Linking, Platform, useWindowDimensions } from 'react-native'; import ButtonBase from './ButtonBase'; import { translate } from '../../i18n/i18n'; import API, { APIError } from '../../API'; @@ -11,6 +11,7 @@ import { useDispatch } from '../../state/Store'; import { setAccessToken } from '../../state/UserSlice'; import useColorScheme from '../../hooks/colorScheme'; import { useAssets } from 'expo-asset'; +import APKDownloadButton from '../APKDownloadButton'; const handleGuestLogin = async (apiSetter: (accessToken: string) => void): Promise => { const apiAccess = await API.createAndGetGuestAccount(); @@ -81,7 +82,7 @@ const ScaffoldAuth: FunctionComponent = ({ )} { try { handleGuestLogin((accessToken: string) => { @@ -164,6 +165,7 @@ const ScaffoldAuth: FunctionComponent = ({ {link.label} + { Platform.OS === "web" && } diff --git a/front/i18n/Translations.ts b/front/i18n/Translations.ts index 64adbbc..a9f8275 100644 --- a/front/i18n/Translations.ts +++ b/front/i18n/Translations.ts @@ -1,5 +1,7 @@ export const en = { error: 'Error', + guestMode: "Guest Mode", + downloadAPK: "Download Android App", goBackHome: 'Go Back Home', anErrorOccured: 'An Error Occured', welcome: 'Welcome', @@ -319,6 +321,8 @@ export const en = { export const fr: typeof en = { error: 'Erreur', + downloadAPK: "Télécharger l'App Android", + guestMode: "Mode Invité", goBackHome: "Retourner à l'accueil", anErrorOccured: 'Une erreur est survenue', welcome: 'Bienvenue', @@ -638,6 +642,8 @@ export const fr: typeof en = { export const sp: typeof en = { error: 'Error', + downloadAPK: "Descarga la Aplicación de Android", + guestMode: "Modo Invitado", anErrorOccured: 'ocurrió un error', goBackHome: 'regresar a casa', welcomeMessage: 'Benvenido', diff --git a/front/views/settings/SettingsProfile.tsx b/front/views/settings/SettingsProfile.tsx index fe167cd..5f05db0 100644 --- a/front/views/settings/SettingsProfile.tsx +++ b/front/views/settings/SettingsProfile.tsx @@ -10,7 +10,8 @@ import { Google, PasswordCheck, SmsEdit, UserSquare, Verify } from 'iconsax-reac import ChangeEmailForm from '../../components/forms/changeEmailForm'; import ChangePasswordForm from '../../components/forms/changePasswordForm'; import LogoutButtonCC from '../../components/UI/LogoutButtonCC'; -import { ScrollView } from 'react-native'; +import { Platform, ScrollView } from 'react-native'; +import APKDownloadButton from '../../components/APKDownloadButton'; const handleChangeEmail = async (newEmail: string): Promise => { await API.updateUserEmail(newEmail); @@ -162,6 +163,7 @@ const ProfileSettings = () => { }, ]} /> + { Platform.OS === "web" && }