aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--App.js1
-rw-r--r--app.json13
-rw-r--r--assets/adaptive-icon.pngbin17547 -> 11583 bytes
-rw-r--r--assets/favicon.pngbin1466 -> 575 bytes
-rw-r--r--assets/icon.pngbin22380 -> 575 bytes
-rw-r--r--assets/splash.pngbin47346 -> 11583 bytes
-rw-r--r--components/Edit.jsx31
-rw-r--r--components/List.jsx13
-rw-r--r--components/Menu.jsx16
-rw-r--r--eas.json21
-rw-r--r--helpers.jsx20
11 files changed, 74 insertions, 41 deletions
diff --git a/App.js b/App.js
index c74c19c..336ffee 100644
--- a/App.js
+++ b/App.js
@@ -81,7 +81,6 @@ const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#000',
- // height: '100%',
},
error: {
color: 'red',
diff --git a/app.json b/app.json
index c0e5576..84ba331 100644
--- a/app.json
+++ b/app.json
@@ -1,15 +1,15 @@
{
"expo": {
- "name": "AwesomeProject",
- "slug": "AwesomeProject",
+ "name": "Notes",
+ "slug": "notes",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
- "userInterfaceStyle": "light",
+ "userInterfaceStyle": "dark",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
- "backgroundColor": "#ffffff"
+ "backgroundColor": "#000000"
},
"updates": {
"fallbackToCacheTimeout": 0
@@ -23,8 +23,9 @@
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
- "backgroundColor": "#FFFFFF"
- }
+ "backgroundColor": "#000000"
+ },
+ "package": "com.pruss.notes"
},
"web": {
"favicon": "./assets/favicon.png"
diff --git a/assets/adaptive-icon.png b/assets/adaptive-icon.png
index 03d6f6b..0a70c25 100644
--- a/assets/adaptive-icon.png
+++ b/assets/adaptive-icon.png
Binary files differ
diff --git a/assets/favicon.png b/assets/favicon.png
index e75f697..e1f04a0 100644
--- a/assets/favicon.png
+++ b/assets/favicon.png
Binary files differ
diff --git a/assets/icon.png b/assets/icon.png
index a0b1526..e1f04a0 100644
--- a/assets/icon.png
+++ b/assets/icon.png
Binary files differ
diff --git a/assets/splash.png b/assets/splash.png
index 0e89705..0a70c25 100644
--- a/assets/splash.png
+++ b/assets/splash.png
Binary files differ
diff --git a/components/Edit.jsx b/components/Edit.jsx
index d2ec6b3..3ca7b32 100644
--- a/components/Edit.jsx
+++ b/components/Edit.jsx
@@ -71,18 +71,18 @@ const Edit = ({ edit, setEdit, session, setSession, showError }) => {
setEdit={setEdit}
saveNote={edit._id ? saveNote : createNote}
/>
- {
- content === undefined || saving
- ? <Text style={styles.text}>{saving ? 'Saving...' : 'Loading...'}</Text>
- : (
- <View style={styles.container}>
- <TextInput
- placeholder="Title"
- placeholderTextColor="#BBB"
- style={styles.title}
- value={title}
- onChange={e => setTitle(e.nativeEvent.text)}
- />
+ <View style={styles.container}>
+ <TextInput
+ placeholder="Title"
+ placeholderTextColor="#BBB"
+ style={styles.title}
+ value={title}
+ onChange={e => setTitle(e.nativeEvent.text)}
+ />
+ {
+ content === undefined || saving
+ ? <Text style={styles.text}>{saving ? 'Saving...' : 'Loading content...'}</Text>
+ : (
<TextInput
placeholder="Content"
placeholderTextColor="#BBB"
@@ -92,9 +92,9 @@ const Edit = ({ edit, setEdit, session, setSession, showError }) => {
value={content}
onChange={e => setContent(e.nativeEvent.text)}
/>
- </View>
- )
- }
+ )
+ }
+ </View>
</>
)
}
@@ -119,7 +119,6 @@ const styles = StyleSheet.create({
paddingVertical: 10,
},
text: {
- padding: 15,
color: 'white',
}
});
diff --git a/components/List.jsx b/components/List.jsx
index 02a93a1..b7bdc07 100644
--- a/components/List.jsx
+++ b/components/List.jsx
@@ -104,19 +104,6 @@ const styles = StyleSheet.create({
color: 'white',
padding: 20,
},
- menu: {
- backgroundColor: 'lightgrey',
- height: 55,
- width: '100%',
- flexDirection: 'row',
- alignItems: 'flex-end',
- justifyContent: 'space-between',
- padding: 10,
- },
- menuText: {
- fontWeight: 'bold',
- paddingHorizontal: 10,
- },
button: {
width: 80,
alignItems: 'center',
diff --git a/components/Menu.jsx b/components/Menu.jsx
index f6de610..fb82f34 100644
--- a/components/Menu.jsx
+++ b/components/Menu.jsx
@@ -1,5 +1,6 @@
-import { StyleSheet, Text, View } from 'react-native';
+import { StyleSheet, Text, View, Alert } from 'react-native';
import AsyncStorage from '@react-native-async-storage/async-storage';
+import { confirmLogout } from '../helpers'
const Menu = ({ session, setSession, setEdit, showError, saveNote }) => {
const logout = async () => {
@@ -38,12 +39,16 @@ const Menu = ({ session, setSession, setEdit, showError, saveNote }) => {
>
New Note
</Text>
- <Text style={styles.menuText}>{session.email}</Text>
<Text
style={styles.menuText}
- onPress={logout}
>
- Logout
+ Sort
+ </Text>
+ <Text
+ style={styles.menuText}
+ onPress={() => confirmLogout({ logout, email: session.email })}
+ >
+ {session.email}
</Text>
</>
)
@@ -54,7 +59,7 @@ const Menu = ({ session, setSession, setEdit, showError, saveNote }) => {
const styles = StyleSheet.create({
menu: {
- backgroundColor: 'lightgrey',
+ backgroundColor: '#333',
height: 60,
width: '100%',
flexDirection: 'row',
@@ -65,6 +70,7 @@ const styles = StyleSheet.create({
menuText: {
fontWeight: 'bold',
paddingHorizontal: 15,
+ color: 'white',
},
});
diff --git a/eas.json b/eas.json
new file mode 100644
index 0000000..f4721ac
--- /dev/null
+++ b/eas.json
@@ -0,0 +1,21 @@
+{
+ "build": {
+ "preview": {
+ "android": {
+ "buildType": "apk"
+ }
+ },
+ "preview2": {
+ "android": {
+ "gradleCommand": ":app:assembleRelease"
+ }
+ },
+ "preview3": {
+ "developmentClient": true
+ },
+ "production": {}
+ },
+ "cli": {
+ "version": ">= 0.52.0"
+ }
+}
diff --git a/helpers.jsx b/helpers.jsx
new file mode 100644
index 0000000..cf95ac2
--- /dev/null
+++ b/helpers.jsx
@@ -0,0 +1,20 @@
+import { Alert } from 'react-native';
+
+export const confirmLogout = ({ logout, email }) => {
+ Alert.alert(
+ 'Are you sure?',
+ `Do you want to log out user ${email}?`,
+ [
+ {
+ text: 'Logout',
+ onPress: logout,
+ style: 'destructive',
+ },
+ {
+ text: 'Cancel',
+ onPress: () => {},
+ style: 'cancel',
+ },
+ ],
+ );
+}