Skip to content

Commit bf00ba8

Browse files
author
Horacio Herrera
committed
fix expo update + login base styles
1 parent b02ffc4 commit bf00ba8

File tree

14 files changed

+413
-1422
lines changed

14 files changed

+413
-1422
lines changed

app.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,27 @@
11
{
22
"expo": {
3+
"name": "react-native-workshop",
4+
"description": "This project is really great.",
5+
"slug": "react-native-workshop",
6+
"privacy": "public",
37
"sdkVersion": "30.0.0",
8+
"platforms": ["ios", "android"],
9+
"version": "1.0.0",
410
"orientation": "portrait",
11+
"icon": "./assets/icon.png",
512
"splash": {
13+
"image": "./assets/splash.png",
614
"resizeMode": "contain",
7-
"image": "./splash.png"
15+
"backgroundColor": "#ffffff"
16+
},
17+
"updates": {
18+
"fallbackToCacheTimeout": 0
19+
},
20+
"assetBundlePatterns": [
21+
"**/*"
22+
],
23+
"ios": {
24+
"supportsTablet": true
825
}
926
}
1027
}

assets/icon.png

2.91 KB
Loading
File renamed without changes.

package.json

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,21 @@
11
{
2-
"name": "react-native-workshop",
3-
"version": "0.1.0",
2+
"name": "empty-project-template",
3+
"main": "node_modules/expo/AppEntry.js",
44
"private": true,
5-
"devDependencies": {
6-
"jest-expo": "~27.0.0",
7-
"react-test-renderer": "16.3.1"
8-
},
9-
"main": "./node_modules/react-native-scripts/build/bin/crna-entry.js",
105
"scripts": {
116
"start": "expo start",
12-
"eject": "expo eject",
137
"android": "expo start --android",
148
"ios": "expo start --ios",
15-
"test": "jest"
16-
},
17-
"jest": {
18-
"preset": "jest-expo"
9+
"eject": "expo eject"
1910
},
2011
"dependencies": {
21-
"expo": "^27.0.1",
12+
"expo": "^30.0.0",
2213
"parse-link-header": "^1.0.1",
2314
"prop-types": "^15.6.2",
2415
"react": "16.3.1",
25-
"react-native": "~0.55.2",
16+
"react-native": "https://github.com/expo/react-native/archive/sdk-30.0.0.tar.gz",
2617
"react-native-authentication-helpers": "^0.1.0",
2718
"react-native-elements": "^0.19.1",
28-
"react-navigation": "^2.5.2"
19+
"react-navigation": "^2.14.2"
2920
}
3021
}

src/App/Components/FormInput.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react'
2+
import { View } from "react-native";
3+
import {
4+
FormLabel,
5+
FormInput as BaseFormInput,
6+
FormValidationMessage
7+
} from "react-native-elements";
8+
import PropTypes from 'prop-types'
9+
10+
const FormInput = ({ label, value, style, ...rest}) => (
11+
<View>
12+
<FormLabel>{label}</FormLabel>
13+
<BaseFormInput {...rest} value={value} />
14+
{/* <FormValidationMessage>Error message</FormValidationMessage> */}
15+
</View>
16+
);
17+
18+
FormInput.propTypes = {
19+
label: PropTypes.string.isRequired,
20+
value: PropTypes.string.isRequired,
21+
}
22+
23+
export default FormInput

src/App/Components/TextInput.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/App/Components/Title.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import PropTypes from 'prop-types'
33
import { StyleSheet } from 'react-native'
44
import { Text } from 'react-native-elements'
55

6-
const Title = ({children, style, ...rest}) => (
7-
<Text style={[styles.title, style]} {...rest}>{children}</Text>
6+
const Title = ({style, ...rest}) => (
7+
<Text style={[styles.title, style]} {...rest} />
88
)
99

1010
const styles = StyleSheet.create({

src/App/Navigator.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import React from "react";
22
import { createSwitchNavigator } from "react-navigation";
3-
import { AuthNavigator } from "../Auth";
3+
import LoginScreen from "../Auth/Screens/LoginScreen";
44
import PrivateNavigator from "./PrivateNavigator";
55

66
export const PRIVATE_SCREEN = "PRIVATE_SCREEN";
77
export const PUBLIC_SCREEN = "PUBLIC_SCREEN";
88

99
const Navigator = createSwitchNavigator(
1010
{
11-
[PUBLIC_SCREEN]: AuthNavigator,
11+
[PUBLIC_SCREEN]: LoginScreen,
1212
[PRIVATE_SCREEN]: PrivateNavigator
1313
},
1414
{
15-
//initialRouteName: PUBLIC_SCREEN,
16-
initialRouteName: PRIVATE_SCREEN,
15+
initialRouteName: PUBLIC_SCREEN,
16+
// initialRouteName: PRIVATE_SCREEN,
1717
headerMode: "none"
1818
}
1919
);

src/App/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export { default as Title } from './Components/Title'
1111
export { default as Subheading } from './Components/Subheading'
1212
export { default as ListItem } from './Components/ListItem'
1313
export { default as Divider } from './Components/Divider'
14-
export { default as TextInput } from './Components/TextInput'
14+
export { default as FormInput } from './Components/FormInput'
1515
export { default as Screen } from './Components/Screen'
1616

1717
// Navigation Names

src/Auth/Components/AuthNavigator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ export const SINGUP_SCREEN = 'SIGNUP_SCREEN'
1010
const AuthNavigator = createSwitchNavigator(
1111
{
1212
[LOGIN_SCREEN]: LoginScreen,
13-
//[SINGUP_SCREEN]: SignUpScreen,
13+
// [SINGUP_SCREEN]: SignUpScreen,
1414
},
1515
{
1616
initialRouteName: LOGIN_SCREEN,
1717
headerMode: 'none'
1818
},
1919
)
2020

21-
export default AuthNavigator
21+
export default AuthNavigator

src/Auth/Screens/LoginScreen.js

Lines changed: 30 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,56 @@
1-
import React from 'react'
2-
import { StyleSheet, View } from 'react-native'
3-
import { setUser } from 'react-native-authentication-helpers'
4-
import { Constants } from 'expo'
5-
import { Button, TextInput, Title, Screen, PRIVATE_SCREEN } from '../../App'
1+
import React from "react";
2+
import { StyleSheet, View, TextInput } from "react-native";
3+
import { setUser } from "react-native-authentication-helpers";
4+
import { Constants } from "expo";
5+
import { Button, HeadLine, Title, Screen, PRIVATE_SCREEN, Headline, FormInput } from "../../App";
66

7-
class Auth extends React.Component {
7+
class LoginScreen extends React.Component {
88
state = {
99
email: "",
10-
password: ''
11-
}
10+
password: ""
11+
};
1212

1313
login = () => {
14-
this.props.navigation.navigate(PRIVATE_SCREEN)
15-
}
14+
this.props.navigation.navigate(PRIVATE_SCREEN);
15+
};
1616

17-
handleFormChange = (key, text) => this.setState({[key]: text})
17+
handleFormChange = ({ key, text }) => this.setState({ [key]: text });
1818

1919
render() {
2020
return (
2121
<Screen style={styles.container}>
22-
<Title>APP NAME</Title>
23-
<TextInput
22+
<View style={styles.header}>
23+
<Headline>Twitter Clone</Headline>
24+
<Title>@reactjsacademy</Title>
25+
</View>
26+
<FormInput
2427
label="Email"
2528
value={this.state.email}
26-
onChangeText={(email) => this.handleFormChange("email", email)}
29+
onChangeText={value => this.handleFormChange({ key: "email", value })}
2730
/>
28-
<TextInput
31+
<FormInput
2932
label="Password"
3033
value={this.state.password}
3134
secureTextEntry
32-
onChangeText={(password) => this.handleFormChange("password", password)}
35+
onChangeText={value =>
36+
this.handleFormChange({ key: "password", value })
37+
}
3338
/>
3439
</Screen>
35-
)
40+
);
3641
}
3742
}
3843

3944
const styles = StyleSheet.create({
4045
container: {
41-
padding: 24,
4246
paddingTop: Constants.statusBarHeight
47+
},
48+
header: {
49+
alignItems: 'center',
50+
justifyContent: 'center',
51+
height: 120,
52+
backgroundColor: '#73CFEF'
4353
}
44-
})
54+
});
4555

46-
export default Auth
56+
export default LoginScreen;

src/Timeline/Components/TweetDetail.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { View, Text, StyleSheet, TouchableOpacity, Linking } from 'react-native'
33
import { Paper } from '../../App'
44
import Avatar from '../Components/Avatar'
55
import { Feather } from '@expo/vector-icons';
6-
import { stringify } from 'querystring';
76

87
const IconButton = ({ icon }) => {
98
let Icon;

src/User/Api.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,11 @@
1-
import linkHeader from 'parse-link-header'
2-
31
export const API_SEARCH_BASE_URL = 'https://api.github.com/search/users'
42
export const API_SEARCH_USER_BASE_URL = 'https://api.github.com/users'
53

64
export const fetchUsers = ({ nextUrl, query }) => {
75
const url = nextUrl || `${API_SEARCH_BASE_URL}?q=${query}&sort=followers`
86

97
return fetch(url).then(response => {
10-
const link = linkHeader(response.headers.get('Link'))
118
return response.json().then(users => ({
12-
nextUrl: link.next.url,
139
users
1410
}))
1511
})

0 commit comments

Comments
 (0)