archive
/
zxcvbn-app
Archived
1
Fork 0
This repository has been archived on 2023-03-26. You can view files and clone it, but cannot push or open issues or pull requests.
zxcvbn-app/src/index.tsx

51 lines
1.0 KiB
TypeScript
Raw Normal View History

2016-09-16 14:41:18 +01:00
import React, { Component } from 'react';
import {
2016-09-17 14:40:54 +01:00
Text,
View,
Navigator,
StyleSheet
2016-09-16 14:41:18 +01:00
} from 'react-native';
2016-09-17 14:40:54 +01:00
import Routes from './navigation/Routes';
import RouteMapper from './navigation/RouteMapper';
import './types';
2016-09-16 14:41:18 +01:00
const styles = StyleSheet.create({
2016-09-17 14:40:54 +01:00
wrapper: {
flex: 1
} as React.ViewStyle,
navbar: {
flexDirection: 'row',
justifyContent: 'center',
backgroundColor: '#888'
} as React.ViewStyle
2016-09-16 14:41:18 +01:00
});
2016-09-17 14:40:54 +01:00
export default class App extends Component<any, any> {
renderScene(route: any, nav : any) {
const Component = route.component;
const props = route.props || {};
return (
<Component
nav={nav}
currentRoute={route}
{...props} />
);
}
render() {
return (
<View style={styles.wrapper}>
<Navigator
renderScene={this.renderScene}
initialRoute={Routes.main}
navigationBar={
<Navigator.NavigationBar
style={styles.navbar}
routeMapper={RouteMapper} />
} />
</View>
);
}
}