Skip to content

Commit 7876988

Browse files
committed
Redesign
1 parent 6be0af4 commit 7876988

15 files changed

+347
-197
lines changed

awesome-app/App.js

+28-14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import React from "react";
2-
import { StyleSheet, Text, View, Alert, Platform } from "react-native";
2+
import {
3+
StyleSheet,
4+
Text,
5+
View,
6+
Alert,
7+
Platform,
8+
AppState
9+
} from "react-native";
310
import { Constants, Notifications } from "expo";
411
import { NavigationActions } from "react-navigation";
512
import AppContainer from "./screens";
@@ -9,7 +16,8 @@ export default class App extends React.Component {
916
routeName: null,
1017
data: null,
1118
origin: null,
12-
remote: null
19+
remote: null,
20+
shouldSplashHandleNotifications: true
1321
};
1422

1523
constructor(props) {
@@ -31,19 +39,26 @@ export default class App extends React.Component {
3139
handlePushNotification = ({ data, origin, remote }) => {
3240
console.log(origin, data);
3341
if (origin === "selected") {
42+
this.setState({
43+
shouldSplashHandleNotifications: false
44+
});
3445
// User opened the app via push
35-
if (this.isFirstTime) {
36-
this.isFirstTime = false;
37-
this.setState({ routeName: data.goToPage, data, origin, remote });
38-
} else {
39-
this.navigator &&
40-
this.navigator.dispatch(
41-
NavigationActions.navigate({ routeName: data.goToPage, data })
42-
);
43-
}
46+
this.navigator &&
47+
this.navigator.dispatch(
48+
NavigationActions.navigate({ routeName: data.goToPage, data })
49+
);
50+
// if (this.isFirstTime) {
51+
// this.isFirstTime = false;
52+
// this.setState({ routeName: data.goToPage, data, origin, remote });
53+
// } else {
54+
// console.log("I am here");
55+
// this.navigator &&
56+
// this.navigator.dispatch(
57+
// NavigationActions.navigate({ routeName: data.goToPage, data })
58+
// );
59+
// }
4460
} else if (origin === "received") {
4561
// App was open when notification was received
46-
console.log("I am here");
4762
if (Platform.OS == "ios") {
4863
Alert.alert(
4964
"Notification clicked while app is opened",
@@ -81,7 +96,6 @@ export default class App extends React.Component {
8196
const styles = StyleSheet.create({
8297
container: {
8398
marginTop: Constants.statusBarHeight,
84-
flex: 1,
85-
backgroundColor: "#000"
99+
flex: 1
86100
}
87101
});

awesome-app/assets/Pokeballz.png

45.7 KB
Loading

awesome-app/assets/Splashx.png

609 KB
Loading

awesome-app/assets/inprogress.png

301 KB
Loading

awesome-app/assets/pendingcase.png

138 KB
Loading

awesome-app/assets/pikachu.png

96 KB
Loading

awesome-app/assets/pokemons.png

530 KB
Loading

awesome-app/assets/successcase.png

141 KB
Loading

awesome-app/screens/Auth.js

+88-49
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ import {
44
View,
55
TextInput,
66
TouchableOpacity,
7-
AsyncStorage
7+
AsyncStorage,
8+
Image,
9+
Dimensions,
10+
StyleSheet
811
} from "react-native";
12+
import { LinearGradient } from "expo";
13+
14+
const { height, width } = Dimensions.get("window");
915

1016
export default class Auth extends Component {
1117
state = {
@@ -25,9 +31,14 @@ export default class Auth extends Component {
2531
this.setState({ intervalId: emojiInterval });
2632
};
2733

34+
sleep(ms) {
35+
return new Promise(resolve => setTimeout(resolve, ms));
36+
}
37+
2838
logMeIn = async () => {
2939
this.randomEmoji();
3040
let setUserLogin = await AsyncStorage.setItem("userStatus", "true");
41+
await this.sleep(2500);
3142
this.props.navigation.navigate("Notification");
3243
};
3344

@@ -37,55 +48,83 @@ export default class Auth extends Component {
3748

3849
render() {
3950
return (
40-
<View
41-
style={{ flex: 1, alignItems: "stretch", justifyContent: "center" }}
42-
>
43-
<Text
44-
style={{
45-
color: "#fff",
46-
fontSize: 36,
47-
fontWeight: "bold",
48-
alignSelf: "center",
49-
margin: 30
50-
}}
51-
>
52-
{" "}
53-
🔒 Auth 🔒{" "}
54-
</Text>
55-
<TextInput
56-
onChangeText={text => this.setState({ username: text })}
57-
value={this.state.username}
58-
style={{
59-
backgroundColor: "#fff",
60-
margin: 30,
61-
height: 60,
62-
fontSize: 36
63-
}}
64-
/>
65-
<TextInput
66-
secureTextEntry={true}
67-
style={{
68-
backgroundColor: "#fff",
69-
margin: 30,
70-
height: 60,
71-
fontSize: 36
72-
}}
73-
onChangeText={text => this.setState({ password: text })}
74-
value={this.state.password}
75-
/>
76-
<TouchableOpacity
77-
style={{
78-
backgroundColor: "#00FFFF",
79-
height: 60,
80-
margin: 30,
81-
alignItems: "center",
82-
justifyContent: "center"
83-
}}
84-
onPress={this.logMeIn}
85-
>
86-
<Text style={{ fontSize: 36 }}>{this.state.button}</Text>
87-
</TouchableOpacity>
51+
<View style={{ flex: 1 }}>
52+
<View style={{ flex: 1 }}>
53+
<Text
54+
style={{
55+
fontSize: 36,
56+
fontWeight: "bold",
57+
alignSelf: "center",
58+
marginTop: 10
59+
}}
60+
>
61+
🔒 Login 🔒
62+
</Text>
63+
<TextInput
64+
onChangeText={text => this.setState({ username: text })}
65+
value={this.state.username}
66+
style={styles.input}
67+
/>
68+
<TextInput
69+
secureTextEntry={true}
70+
style={styles.input}
71+
onChangeText={text => this.setState({ password: text })}
72+
value={this.state.password}
73+
/>
74+
75+
<TouchableOpacity style={styles.loginButton} onPress={this.logMeIn}>
76+
<LinearGradient
77+
style={styles.gradient}
78+
colors={["#14F1D9", "#3672F8"]}
79+
start={{ x: 0, y: 0.5 }}
80+
end={{ x: 1, y: 0.5 }}
81+
>
82+
<Text style={{ fontSize: 36 }}>{this.state.button}</Text>
83+
</LinearGradient>
84+
</TouchableOpacity>
85+
</View>
86+
{/* Images Code */}
87+
<View style={{ flex: 1 }}>
88+
<View style={{ position: "absolute", top: 75, left: 25 }}>
89+
<Image
90+
source={require("../assets/Pokeballz.png")}
91+
style={{ height: 70, width: 70 }}
92+
/>
93+
</View>
94+
<View style={{ position: "absolute", top: height / 15 }}>
95+
<Image
96+
source={require("../assets/pokemons.png")}
97+
style={{ height: height / 2.3, width }}
98+
resizeMode={"cover"}
99+
/>
100+
</View>
101+
</View>
88102
</View>
89103
);
90104
}
91105
}
106+
107+
const styles = StyleSheet.create({
108+
input: {
109+
borderColor: "gray",
110+
borderWidth: 1,
111+
margin: 15,
112+
height: 60,
113+
fontSize: 36,
114+
borderRadius: 25,
115+
paddingLeft: 10
116+
},
117+
loginButton: {
118+
height: 60,
119+
margin: 15,
120+
alignItems: "center",
121+
justifyContent: "center"
122+
},
123+
gradient: {
124+
height: "100%",
125+
width: "100%",
126+
alignItems: "center",
127+
justifyContent: "center",
128+
borderRadius: 50
129+
}
130+
});

0 commit comments

Comments
 (0)