瀏覽代碼

avance un peu

master
DemiBSel 3 年之前
父節點
當前提交
5318227c0d
共有 4 個檔案被更改,包括 38 行新增2 行删除
  1. 26
    2
      App.js
  2. 6
    0
      db/database-connect.js
  3. 5
    0
      package-lock.json
  4. 1
    0
      package.json

+ 26
- 2
App.js 查看文件

@@ -1,10 +1,29 @@
1 1
 import { StatusBar } from 'expo-status-bar';
2 2
 import React from 'react';
3
-import { StyleSheet, Text, View } from 'react-native';
3
+import { StyleSheet, Text, View, TextInput } from 'react-native';
4
+import { Button } from 'react-native-web';
4 5
 
5 6
 export default function App() {
6 7
   return (
7
-    <View style={styles.container}>
8
+    <View style={styles.container, {
9
+      flexDirection: "column"
10
+    }}>
11
+      <View style={styles.controlBar}>
12
+        <View style={{
13
+          flexDirection: 'row'
14
+        }}>
15
+          <Text>Objectif</Text>
16
+          <TextInput/>
17
+        </View>
18
+        <View style={{
19
+          alignItems: 'flex-end',
20
+          flexDirection: 'row'
21
+        }}>
22
+        <Button title={"Jour"}></Button>
23
+        <Button title={"Mois"}></Button>
24
+        <Button title={"YTD"}></Button>
25
+        </View>
26
+      </View>
8 27
       <Text>Open up App.js to start working on your app!</Text>
9 28
       <StatusBar style="auto" />
10 29
     </View>
@@ -18,4 +37,9 @@ const styles = StyleSheet.create({
18 37
     alignItems: 'center',
19 38
     justifyContent: 'center',
20 39
   },
40
+  controlBar: {
41
+    flex: 1,
42
+    flexDirection: "row",
43
+    justifyContent: 'space-between'
44
+  }
21 45
 });

+ 6
- 0
db/database-connect.js 查看文件

@@ -0,0 +1,6 @@
1
+import {openDatabase} from 'react-native-sqlite-storage';
2
+
3
+// TODO reprends ici https://blog.logrocket.com/using-sqlite-with-react-native/
4
+export const getDBConnection = async () => {
5
+    return openDatabase({name: 'todo-data.db', location: 'default'});
6
+  };

+ 5
- 0
package-lock.json 查看文件

@@ -6149,6 +6149,11 @@
6149 6149
         "warn-once": "^0.1.0"
6150 6150
       }
6151 6151
     },
6152
+    "react-native-sqlite-storage": {
6153
+      "version": "6.0.1",
6154
+      "resolved": "https://registry.npmjs.org/react-native-sqlite-storage/-/react-native-sqlite-storage-6.0.1.tgz",
6155
+      "integrity": "sha512-1tDFjrint6X6qSYKf3gDyz+XB+X79jfiL6xTugKHPRtF0WvqMtVgdLuNqZunIXjNEvNtNVEbXaeZ6MsguFu00A=="
6156
+    },
6152 6157
     "react-native-web": {
6153 6158
       "version": "0.17.1",
6154 6159
       "resolved": "https://registry.npmjs.org/react-native-web/-/react-native-web-0.17.1.tgz",

+ 1
- 0
package.json 查看文件

@@ -18,6 +18,7 @@
18 18
     "react-native-reanimated": "~2.2.0",
19 19
     "react-native-safe-area-context": "3.3.2",
20 20
     "react-native-screens": "~3.8.0",
21
+    "react-native-sqlite-storage": "^6.0.1",
21 22
     "react-native-web": "0.17.1"
22 23
   },
23 24
   "devDependencies": {

Loading…
取消
儲存