Created
May 1, 2017 20:08
-
-
Save alexjosesilva/07b3582821fe531a5b4b12240bdfaeac to your computer and use it in GitHub Desktop.
#App5: Telas de Navegação com REACT NATIVE
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* App5: Area de Navegacao do usuario | |
* Sessao: 10 | |
* Alex Jose | |
*/ | |
import React, { Component } from 'react'; | |
import { | |
StatusBar, | |
View, | |
Image | |
} from 'react-native'; | |
import BarraNavegacao from './BarraNavegacao'; | |
const detalheClientes = require('../imgs/logo.png'); | |
const cliente1 = require('../imgs/cliente1.png'); | |
const cliente2 = require('../imgs/cliente2.png'); | |
export default class CenaCliente extends Component { | |
render() { | |
return ( | |
<View style={{ flex: 1, backgroundColor: '#FFF' }}> | |
<StatusBar //hidden backgroundColor='#B9C941' /> | |
<View style={styles.cabecalho}> | |
<Image source={detalheClientes} /> | |
<Text style={styles.txtTitulo}>Nossos Clientes</Text> | |
</View> | |
<View style={styles.detalheCliente}> | |
<Image source={cliente1} /> | |
<Text style={styles.txtDetalheCliente}>Lorem ipsum dolorem</Text> | |
</View> | |
<View style={styles.detalheCliente}> | |
<Image source={cliente2} /> | |
<Text style={styles.txtDetalheCliente}>Lorem ipsum dolorem</Text> | |
</View> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
cabecalho: { | |
flexDirection: 'row', | |
marginTop: 20 | |
}, | |
txtTitulo: { | |
fontSize: 30, | |
color: '#B9C941', | |
marginLeft: 10, | |
marginTop: 25 | |
}, | |
detalheCliente: { | |
padding: 20, | |
marginTop: 10 | |
}, | |
txtDetalheCliente: { | |
fontSize: 18, | |
marginLeft: 20 | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
View, | |
StatusBar, | |
Image, | |
Text, | |
StyleSheet | |
} from 'react-native'; | |
//importar o componente barra navegação | |
import BarraNavegacao from './BarraNavegacao'; | |
const detalheClientes = require('../imgs/detalhe_cliente.png'); | |
const cliente1 = require('../imgs/cliente1.png'); | |
const cliente2 = require('../imgs/cliente2.png'); | |
export default class CenaClientes extends Component { | |
render() { | |
return ( | |
<View style={{ flex: 1, backgroundColor: '#FFF' }}> | |
<StatusBar | |
//hidden | |
backgroundColor='#B9C941' | |
/> | |
<BarraNavegacao voltar navigator={this.props.navigator} corDeFundo='#B9C941' /> | |
<View style={styles.cabecalho}> | |
<Image source={detalheClientes} /> | |
<Text style={styles.txtTitulo}>Nossos Clientes</Text> | |
</View> | |
<View style={styles.detalheCliente}> | |
<Image source={cliente1} /> | |
<Text style={styles.txtDetalheCliente}>Lorem ipsum dolorem</Text> | |
</View> | |
<View style={styles.detalheCliente}> | |
<Image source={cliente2} /> | |
<Text style={styles.txtDetalheCliente}>Lorem ipsum dolorem</Text> | |
</View> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
cabecalho: { | |
flexDirection: 'row', | |
marginTop: 20 | |
}, | |
txtTitulo: { | |
fontSize: 30, | |
color: '#B9C941', | |
marginLeft: 10, | |
marginTop: 25 | |
}, | |
detalheCliente: { | |
padding: 20, | |
marginTop: 10 | |
}, | |
txtDetalheCliente: { | |
fontSize: 18, | |
marginLeft: 20 | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
View, | |
StatusBar, | |
Image, | |
Text, | |
StyleSheet | |
} from 'react-native'; | |
//importar o componente barra navegação | |
import BarraNavegacao from './BarraNavegacao'; | |
const detalheContatos = require('../imgs/detalhe_contato.png'); | |
export default class CenaContatos extends Component { | |
render() { | |
return ( | |
<View style={{ flex: 1, backgroundColor: '#FFF' }}> | |
<StatusBar | |
//hidden | |
backgroundColor='#61BD8C' | |
/> | |
<BarraNavegacao voltar navigator={this.props.navigator} corDeFundo='#61BD8C' /> | |
<View style={styles.cabecalho}> | |
<Image source={detalheContatos} /> | |
<Text style={styles.txtTitulo}>Contatos</Text> | |
</View> | |
<View style={styles.detalheContatos}> | |
<Text style={styles.txtContatos}>TEL: (11) 1234-1234</Text> | |
<Text style={styles.txtContatos}>CEL: (11) 91234-1234</Text> | |
<Text style={styles.txtContatos}>EMAIL: contato@atmconsultoria.com</Text> | |
</View> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
cabecalho: { | |
flexDirection: 'row', | |
marginTop: 20 | |
}, | |
txtTitulo: { | |
fontSize: 30, | |
color: '#61BD8C', | |
marginLeft: 10, | |
marginTop: 25 | |
}, | |
detalheContatos: { | |
marginTop: 20, | |
padding: 20 | |
}, | |
txtContatos: { | |
fontSize: 18 | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
View, | |
StatusBar, | |
Image, | |
Text, | |
StyleSheet | |
} from 'react-native'; | |
//importar o componente barra navegação | |
import BarraNavegacao from './BarraNavegacao'; | |
const detalheEmpresa = require('../imgs/detalhe_empresa.png'); | |
export default class CenaEmpresa extends Component { | |
render() { | |
return ( | |
<View style={{ flex: 1, backgroundColor: '#FFF' }}> | |
<StatusBar | |
//hidden | |
backgroundColor='#EC7148' | |
/> | |
<BarraNavegacao voltar navigator={this.props.navigator} corDeFundo='#EC7148' /> | |
<View style={styles.cabecalho}> | |
<Image source={detalheEmpresa} /> | |
<Text style={styles.txtTitulo}>A Empresa</Text> | |
</View> | |
<View style={styles.detalheEmpresa}> | |
<Text style={styles.txtEmpresa}> | |
A ATM Consultoria está no mercado a mais de 20 anos... | |
</Text> | |
</View> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
cabecalho: { | |
flexDirection: 'row', | |
marginTop: 20 | |
}, | |
txtTitulo: { | |
fontSize: 30, | |
color: '#EC7148', | |
marginLeft: 10, | |
marginTop: 25 | |
}, | |
detalheEmpresa: { | |
marginTop: 20, | |
padding: 20 | |
}, | |
txtEmpresa: { | |
fontSize: 18 | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
View, | |
StatusBar, | |
Image, | |
StyleSheet, | |
TouchableHighlight | |
} from 'react-native'; | |
//importar o componente barra navegação | |
import BarraNavegacao from './BarraNavegacao'; | |
const logo = require('../imgs/logo.png'); | |
const menuCliente = require('../imgs/menu_cliente.png'); | |
const menuContato = require('../imgs/menu_contato.png'); | |
const menuEmpresa = require('../imgs/menu_empresa.png'); | |
const menuServico = require('../imgs/menu_servico.png'); | |
export default class CenaPrincipal extends Component { | |
render() { | |
return ( | |
<View> | |
<StatusBar | |
//hidden | |
backgroundColor='#CCC' | |
/> | |
<BarraNavegacao /> | |
<View style={styles.logo}> | |
<Image source={logo} /> | |
</View> | |
<View style={styles.menu}> | |
<View style={styles.menuGrupo}> | |
<TouchableHighlight | |
underlayColor={'#B9C941'} | |
activeOpacity={0.3} | |
onPress={() => { | |
this.props.navigator.push({ id: 'cliente' }); | |
}} | |
> | |
<Image style={styles.imgMenu} source={menuCliente} /> | |
</TouchableHighlight> | |
<TouchableHighlight | |
underlayColor={'#61BD8C'} | |
activeOpacity={0.3} | |
onPress={() => { | |
this.props.navigator.push({ id: 'contato' }); | |
}} | |
> | |
<Image style={styles.imgMenu} source={menuContato} /> | |
</TouchableHighlight> | |
</View> | |
<View style={styles.menuGrupo}> | |
<TouchableHighlight | |
underlayColor={'#EC7148'} | |
activeOpacity={0.3} | |
onPress={() => { | |
this.props.navigator.push({ id: 'empresa' }); | |
}} | |
> | |
<Image style={styles.imgMenu} source={menuEmpresa} /> | |
</TouchableHighlight> | |
<TouchableHighlight | |
underlayColor={'#19D1C8'} | |
activeOpacity={0.3} | |
onPress={() => { | |
this.props.navigator.push({ id: 'servico' }); | |
}} | |
> | |
<Image style={styles.imgMenu} source={menuServico} /> | |
</TouchableHighlight> | |
</View> | |
</View> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
logo: { | |
marginTop: 30, | |
alignItems: 'center' | |
}, | |
menu: { | |
alignItems: 'center' | |
}, | |
menuGrupo: { | |
flexDirection: 'row' | |
}, | |
imgMenu: { | |
margin: 15 | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
View, | |
StatusBar, | |
Image, | |
Text, | |
StyleSheet | |
} from 'react-native'; | |
//importar o componente barra navegação | |
import BarraNavegacao from './BarraNavegacao'; | |
const detalheServico = require('../imgs/detalhe_servico.png'); | |
export default class CenaServico extends Component { | |
render() { | |
return ( | |
<View style={{ flex: 1, backgroundColor: '#FFF' }}> | |
<StatusBar | |
//hidden | |
backgroundColor='#19D1C8' | |
/> | |
<BarraNavegacao voltar navigator={this.props.navigator} corDeFundo='#19D1C8' /> | |
<View style={styles.cabecalho}> | |
<Image source={detalheServico} /> | |
<Text style={styles.txtTitulo}>Nossos Serviços</Text> | |
</View> | |
<View style={styles.detalheServico}> | |
<Text style={styles.txtServico}>. Consultoria</Text> | |
<Text style={styles.txtServico}>. Processos</Text> | |
<Text style={styles.txtServico}>. Acompanhamento de Projetos</Text> | |
</View> | |
</View> | |
); | |
} | |
} | |
const styles = StyleSheet.create({ | |
cabecalho: { | |
flexDirection: 'row', | |
marginTop: 20 | |
}, | |
txtTitulo: { | |
fontSize: 30, | |
color: '#19D1C8', | |
marginLeft: 10, | |
marginTop: 25 | |
}, | |
detalheServico: { | |
marginTop: 20, | |
padding: 20 | |
}, | |
txtServico: { | |
fontSize: 18 | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
AppRegistry, | |
Navigator | |
} from 'react-native'; | |
import CenaPrincipal from './src/components/CenaPrincipal'; | |
import CenaClientes from './src/components/CenaClientes'; | |
import CenaContatos from './src/components/CenaContatos'; | |
import CenaEmpresa from './src/components/CenaEmpresa'; | |
import CenaServicos from './src/components/CenaServicos'; | |
export default class App5 extends Component { | |
render() { | |
return ( | |
<Navigator | |
initialRoute={{ id: 'principal' }} | |
renderScene={(route, navigator) => { | |
switch (route.id) { | |
case 'principal': | |
return (<CenaPrincipal navigator={navigator} />); | |
case 'cliente': | |
return (<CenaClientes navigator={navigator} />); | |
case 'contato': | |
return (<CenaContatos navigator={navigator} />); | |
case 'empresa': | |
return (<CenaEmpresa navigator={navigator} />); | |
case 'servico': | |
return (<CenaServicos navigator={navigator} />); | |
default: | |
return false; | |
} | |
}} | |
/> | |
); | |
} | |
} | |
AppRegistry.registerComponent('App5', () => App5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment