Skip to content

Commit

Permalink
Merge pull request #6 from fabianamasini/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
fabianamasini authored May 17, 2020
2 parents df62a63 + 4cde0b8 commit 0a62120
Show file tree
Hide file tree
Showing 21 changed files with 406 additions and 213 deletions.
14 changes: 3 additions & 11 deletions coronasavior/App.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
import React from 'react';
import Router from './router.js';
import { StyleSheet, Text } from 'react-native';
import Routes from './router.js';


export default function App() {
return (
<Router />
<Routes/>
);
}

const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: '#fff',
alignItems: 'center',
justifyContent: 'center',
},
});
Binary file added coronasavior/assets/distance.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coronasavior/assets/home_green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coronasavior/assets/medal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coronasavior/assets/quiz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coronasavior/assets/saude.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coronasavior/assets/stayhome.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added coronasavior/assets/wash_hands.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions coronasavior/components/FloatingLabelInput.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import React, { useState } from 'react';
import React, { useState, forwardRef } from 'react';
import { StyleSheet, View, TextInput, Text } from 'react-native'

import { styles } from '../utils/style.js'

const FloatingLabelInput = (props) => {
const FloatingLabelInput = forwardRef((props, ref) => {
const [isFocused, setIsFocused] = useState(false)
const [error, setError] = useState("")

const handleFocus = () => {
setIsFocused(true)
Expand All @@ -24,7 +21,7 @@ const FloatingLabelInput = (props) => {
color: isFocused || props.value.length > 0 ? '#000':'#aaa' ,
}
})

return (
<View style={{ paddingTop: 20, paddingBottom: 20 }}>
<Text style={componentStyles.labelStyle}>{props.label}</Text>
Expand All @@ -33,11 +30,14 @@ const FloatingLabelInput = (props) => {
onFocus={handleFocus}
onBlur={handleBlur}
onChangeText={props.action}
onChange={() => setError('')}
secureTextEntry={props.security ? props.security : false}
blurOnSubmit={false}
accessibilityLabel={props.accessibility}
ref={ref}
onSubmitEditing={props.onSubmitEditing}
/>
</View>
)
}
})

export default FloatingLabelInput;
131 changes: 60 additions & 71 deletions coronasavior/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions coronasavior/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
},
"dependencies": {
"@react-native-community/masked-view": "^0.1.10",
"@react-navigation/drawer": "^5.7.4",
"@react-navigation/native": "^5.3.2",
"@react-navigation/stack": "^5.3.5",
"axios": "^0.19.2",
"expo": "~37.0.3",
"react": "~16.9.0",
Expand All @@ -18,9 +21,7 @@
"react-native-reanimated": "~1.7.0",
"react-native-safe-area-context": "^1.0.0",
"react-native-screens": "~2.2.0",
"react-native-web": "~0.11.7",
"react-navigation": "^4.3.9",
"react-navigation-stack": "^2.5.0"
"react-native-web": "~0.11.7"
},
"devDependencies": {
"babel-preset-expo": "~8.1.0",
Expand Down
65 changes: 17 additions & 48 deletions coronasavior/router.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,21 @@
import { createAppContainer } from 'react-navigation';
import { createStackNavigator } from 'react-navigation-stack';
import React from 'react';
import { createStackNavigator } from '@react-navigation/stack'
import { NavigationContainer } from '@react-navigation/native'

import { lightGreen } from './utils/constants'
import stackNav from './routes/stackNavigation'
import drawerNav from './routes/drawerNavigation'

import Login from './screens/login';
import SignUp from './screens/signup';
import Profile from './screens/profile';
import Home from './screens/home';
const Stack = createStackNavigator()

const Routes = createAppContainer(
createStackNavigator({
Login : {
screen: Login,
navigationOptions: {
headerShown: true,
headerLeft: () => null
}
},
SignUp : {
screen: SignUp,
navigationOptions: {
headerShown: true,
headerLeft: () => null
}
},
Profile : {
screen: Profile,
navigationOptions: {
headerShown: true,
headerLeft: () => null
}
},
Home : {
screen: Home,
navigationOptions: {
headerShown: true,
headerLeft: () => null
}
}
}, {
defaultNavigationOptions: {
headerTintColor: '#fff',
headerBackTitleVisible: false,
headerStyle: {
backgroundColor: lightGreen,
}
}
})
);
function Routes() {
return (
<NavigationContainer>
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name='Stack' component={stackNav}/>
<Stack.Screen name='Drawer' component={drawerNav} />
</Stack.Navigator>
</NavigationContainer>
)
}

export default Routes;
export default Routes;
18 changes: 18 additions & 0 deletions coronasavior/routes/drawerNavigation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { createDrawerNavigator } from '@react-navigation/drawer';
import React from 'react';

import Profile from '../screens/profile';
import Home from '../screens/home';

const Drawer = createDrawerNavigator()

function drawerNav() {
return (
<Drawer.Navigator>
<Drawer.Screen name='Home' component={Home} />
<Drawer.Screen name='Profile' component={Profile}/>
</Drawer.Navigator>
)
}

export default drawerNav;
Loading

0 comments on commit 0a62120

Please sign in to comment.