Installation de expo-secure-store pour stocker les données de connexion à l'API

This commit is contained in:
Emmy D'Anello 2024-12-09 18:29:48 +01:00
parent 4a4233925d
commit c08fbb762a
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
6 changed files with 38 additions and 3 deletions

View File

@ -43,7 +43,8 @@
"locationAlwaysAndWhenInUsePermission": "Allow $(PRODUCT_NAME) to use your location." "locationAlwaysAndWhenInUsePermission": "Allow $(PRODUCT_NAME) to use your location."
} }
], ],
"expo-task-manager" "expo-task-manager",
"expo-secure-store"
], ],
"experiments": { "experiments": {
"typedRoutes": true "typedRoutes": true

View File

@ -45,6 +45,14 @@ export default function TabLayout() {
tabBarIcon: ({ color }) => <MaterialIcons name="history" size={24} color={color} />, tabBarIcon: ({ color }) => <MaterialIcons name="history" size={24} color={color} />,
}} }}
/> />
<Tabs.Screen
name="settings"
options={{
title: 'Paramètres',
headerTitleStyle: {fontSize: 32},
tabBarIcon: ({ color }) => <MaterialIcons name="settings" size={24} color={color} />,
}}
/>
</Tabs> </Tabs>
) )
} }

View File

@ -0,0 +1,15 @@
import { FlatList, ScrollView } from 'react-native'
import { ThemedText } from '@/components/ThemedText'
import { ThemedView } from '@/components/ThemedView'
// import * as SecureStore from 'expo-secure-store'
export default function HistoryScreen() {
// const token = SecureStore.getItem("apiToken")
return (
<ScrollView>
<ThemedView>
<FlatList data={["Se connecter à l'API"]} renderItem={({item}) => <ThemedText>{item}</ThemedText>} />
</ThemedView>
</ScrollView>
)
}

View File

@ -10,7 +10,7 @@ export default function Map() {
const accuracyCircle = circle([userLocation?.coords.longitude ?? 0, userLocation?.coords.latitude ?? 0], userLocation?.coords.accuracy ?? 0, {steps: 64, units: 'meters'}) const accuracyCircle = circle([userLocation?.coords.longitude ?? 0, userLocation?.coords.latitude ?? 0], userLocation?.coords.accuracy ?? 0, {steps: 64, units: 'meters'})
return ( return (
<MapView <MapView
logoEnabled={true} logoEnabled={false}
style={styles.map} style={styles.map}
styleURL="https://openmaptiles.geo.data.gouv.fr/styles/osm-bright/style.json"> styleURL="https://openmaptiles.geo.data.gouv.fr/styles/osm-bright/style.json">
{/* FIXME Il faudra pouvoir avoir un bouton de suivi pour activer le suivi de la caméro */} {/* FIXME Il faudra pouvoir avoir un bouton de suivi pour activer le suivi de la caméro */}

View File

@ -23,6 +23,7 @@
"expo-linking": "~7.0.3", "expo-linking": "~7.0.3",
"expo-location": "^18.0.2", "expo-location": "^18.0.2",
"expo-router": "~4.0.9", "expo-router": "~4.0.9",
"expo-secure-store": "~14.0.0",
"expo-splash-screen": "~0.29.13", "expo-splash-screen": "~0.29.13",
"expo-status-bar": "~2.0.0", "expo-status-bar": "~2.0.0",
"expo-symbols": "~0.2.0", "expo-symbols": "~0.2.0",
@ -7817,6 +7818,15 @@
"node": ">=10" "node": ">=10"
} }
}, },
"node_modules/expo-secure-store": {
"version": "14.0.0",
"resolved": "https://registry.npmjs.org/expo-secure-store/-/expo-secure-store-14.0.0.tgz",
"integrity": "sha512-VyhtRFXP+7hQmHhKlHIOWid1Q/IRpM7Uif32tZHLZHvQ6FNz2cUkr26XWGvCa7btYbrR6OL++FBFZYjbIcRZTw==",
"license": "MIT",
"peerDependencies": {
"expo": "*"
}
},
"node_modules/expo-splash-screen": { "node_modules/expo-splash-screen": {
"version": "0.29.13", "version": "0.29.13",
"resolved": "https://registry.npmjs.org/expo-splash-screen/-/expo-splash-screen-0.29.13.tgz", "resolved": "https://registry.npmjs.org/expo-splash-screen/-/expo-splash-screen-0.29.13.tgz",

View File

@ -47,7 +47,8 @@
"react-native-screens": "~4.1.0", "react-native-screens": "~4.1.0",
"react-native-web": "~0.19.13", "react-native-web": "~0.19.13",
"react-native-webview": "13.12.2", "react-native-webview": "13.12.2",
"react-redux": "^9.1.2" "react-redux": "^9.1.2",
"expo-secure-store": "~14.0.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.25.2", "@babel/core": "^7.25.2",