styling stuff is hard!
This commit is contained in:
parent
6caac1019d
commit
d1e8478544
4 changed files with 31 additions and 12 deletions
|
@ -7,12 +7,28 @@ import {
|
||||||
} from 'react-native';
|
} from 'react-native';
|
||||||
import _ from 'underscore';
|
import _ from 'underscore';
|
||||||
|
|
||||||
|
const RESULTS_DATA = require('../data/results');
|
||||||
|
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flexDirection: 'row',
|
||||||
alignItems: 'center',
|
|
||||||
justifyContent: 'center'
|
|
||||||
} as React.ViewStyle,
|
} as React.ViewStyle,
|
||||||
|
mainText: {
|
||||||
|
fontSize: 16,
|
||||||
|
marginBottom: 3,
|
||||||
|
} as React.TextStyle,
|
||||||
|
description: {
|
||||||
|
fontSize: 13,
|
||||||
|
color: '#888'
|
||||||
|
} as React.TextStyle,
|
||||||
|
column: {
|
||||||
|
} as React.ViewStyle,
|
||||||
|
rightColumn: {
|
||||||
|
flex: 1,
|
||||||
|
alignSelf: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'flex-end'
|
||||||
|
} as React.ViewStyle
|
||||||
});
|
});
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
|
@ -20,8 +36,17 @@ interface Props {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default function Result(props: Props) {
|
export default function Result(props: Props) {
|
||||||
return (
|
return (
|
||||||
<Text>{props.data.key}: {JSON.stringify(props.data.value)}</Text>
|
<View style={styles.container}>
|
||||||
|
<View style={[styles.column]}>
|
||||||
|
<Text style={styles.mainText}>{props.data.key}: {}</Text>
|
||||||
|
<Text style={styles.description}>Something else</Text>
|
||||||
|
</View>
|
||||||
|
<View style={[styles.column, styles.rightColumn]}>
|
||||||
|
<Text>foobar</Text>
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,11 +19,11 @@ const styles = StyleSheet.create({
|
||||||
flex: 1
|
flex: 1
|
||||||
} as React.ViewStyle,
|
} as React.ViewStyle,
|
||||||
listItem: {
|
listItem: {
|
||||||
|
flex: 1,
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
borderBottomColor: '#333',
|
borderBottomColor: '#333',
|
||||||
paddingTop: 5,
|
paddingTop: 5,
|
||||||
paddingBottom: 8,
|
paddingBottom: 8,
|
||||||
paddingHorizontal: 16
|
|
||||||
} as React.ViewStyle
|
} as React.ViewStyle
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
1
src/data/results.ts
Normal file
1
src/data/results.ts
Normal file
|
@ -0,0 +1 @@
|
||||||
|
export default {};
|
|
@ -11,16 +11,9 @@ import BlankResults from '../components/BlankResults';
|
||||||
const styles = StyleSheet.create({
|
const styles = StyleSheet.create({
|
||||||
container: {
|
container: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
alignItems: 'stretch',
|
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
backgroundColor: '#FFF',
|
backgroundColor: '#FFF',
|
||||||
} as React.ViewStyle,
|
} as React.ViewStyle,
|
||||||
|
|
||||||
text: {
|
|
||||||
fontSize: 20,
|
|
||||||
textAlign: 'center',
|
|
||||||
margin: 10,
|
|
||||||
} as React.TextStyle
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
Reference in a new issue