diff --git a/src/screens/Profile/Settings.js b/src/screens/Profile/Settings.js index fba7e50..9d646ed 100644 --- a/src/screens/Profile/Settings.js +++ b/src/screens/Profile/Settings.js @@ -1,5 +1,7 @@ import React from 'react' -import { View } from 'react-native' +import Constants from 'expo-constants' +import * as Updates from 'expo-updates' +import { Text, View } from 'react-native' import { SheetManager } from 'react-native-actions-sheet' import { responsiveHeight } from 'react-native-responsive-dimensions' import { background } from '../../assets' @@ -45,6 +47,17 @@ const SETTINGS = [ }, ] +const getVersionLabel = () => { + const appVersion = Constants.expoConfig?.version || 'inconnue' + const updateId = typeof Updates.updateId === 'string' ? Updates.updateId.slice(0, 8) : null + + if (updateId) { + return `Version ${appVersion} · mise à jour ${updateId}` + } + + return `Version ${appVersion} · ${__DEV__ ? 'développement' : 'intégrée'}` +} + const Settings = () => { const { onSignOut } = useUserData() @@ -84,6 +97,18 @@ const Settings = () => { }} onPress={() => SheetManager.show('DeleteAccount')} /> + + {getVersionLabel()} +