Browse Source

improving alignment between components on form screens

master
GabrielTrettel 4 years ago
parent
commit
125537e268
  1. 7
      src/app/screens/RainSharingDataScreen.js
  2. 17
      src/app/screens/RiverFloodSharingDataScreen.js
  3. 11
      src/app/screens/SharingFloodZonesScreen.js

7
src/app/screens/RainSharingDataScreen.js

@ -38,7 +38,7 @@ function RainSharingDataScreen(props) {
> >
Chuva Chuva
</Text> </Text>
<ScrollView style={styles.container}>
<ScrollView>
<Form <Form
initialValues={{ initialValues={{
images: [], images: [],
@ -159,7 +159,7 @@ function RainSharingDataScreen(props) {
); );
} }
const dims = scaleDimsFromWidth(85, 85, 25);
const dims = scaleDimsFromWidth(85, 85, 27);
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
@ -167,6 +167,7 @@ const styles = StyleSheet.create({
backgroundColor: colors.white, backgroundColor: colors.white,
}, },
img_block: { img_block: {
flex: 1,
borderRadius: 5, borderRadius: 5,
padding: 10, padding: 10,
borderStyle: "dotted", borderStyle: "dotted",
@ -181,7 +182,7 @@ const styles = StyleSheet.create({
}, },
imgs_row: { imgs_row: {
flexDirection: "row", flexDirection: "row",
justifyContent: "space-around",
justifyContent: "space-between",
}, },
text: { text: {
fontSize: 14, fontSize: 14,

17
src/app/screens/RiverFloodSharingDataScreen.js

@ -40,7 +40,6 @@ function RiverFloodSharingDataScreen(props) {
</Text> </Text>
<KeyboardAwareScrollView <KeyboardAwareScrollView
resetScrollToCoords={{ x: 0, y: 0 }} resetScrollToCoords={{ x: 0, y: 0 }}
contentContainerStyle={styles.container}
scrollEnabled={true} scrollEnabled={true}
> >
<Form <Form
@ -64,9 +63,7 @@ function RiverFloodSharingDataScreen(props) {
validationSchema={validationSchema} validationSchema={validationSchema}
> >
<View> <View>
<View
style={{ flexDirection: "row", justifyContent: "space-around" }}
>
<View style={styles.imgs_row}>
<TouchableNativeFeedback onPress={() => setRiverScale(0)}> <TouchableNativeFeedback onPress={() => setRiverScale(0)}>
<View <View
borderColor={riverScale == 0 ? colors.primary : colors.white} borderColor={riverScale == 0 ? colors.primary : colors.white}
@ -94,13 +91,7 @@ function RiverFloodSharingDataScreen(props) {
</TouchableNativeFeedback> </TouchableNativeFeedback>
</View> </View>
<View
style={{
marginTop: 10,
flexDirection: "row",
justifyContent: "space-around",
}}
>
<View style={{ ...styles.imgs_row, marginTop: 10 }}>
<TouchableNativeFeedback onPress={() => setRiverScale(2)}> <TouchableNativeFeedback onPress={() => setRiverScale(2)}>
<View <View
borderColor={riverScale == 2 ? colors.primary : colors.white} borderColor={riverScale == 2 ? colors.primary : colors.white}
@ -160,6 +151,10 @@ const styles = StyleSheet.create({
width: 85, width: 85,
height: 85, height: 85,
}, },
imgs_row: {
flexDirection: "row",
justifyContent: "space-between",
},
text: { text: {
fontSize: 14, fontSize: 14,
textAlign: "center", textAlign: "center",

11
src/app/screens/SharingFloodZonesScreen.js

@ -44,7 +44,6 @@ function SharingFloodZonesScreen(props) {
</Text> </Text>
<KeyboardAwareScrollView <KeyboardAwareScrollView
resetScrollToCoords={{ x: 0, y: 0 }} resetScrollToCoords={{ x: 0, y: 0 }}
contentContainerStyle={styles.container}
scrollEnabled={true} scrollEnabled={true}
> >
<Form <Form
@ -115,6 +114,7 @@ function SharingFloodZonesScreen(props) {
); );
} }
const borderWidth = 4; const borderWidth = 4;
const dims = scaleDimsFromWidth(150, 80, 42.0);
const styles = StyleSheet.create({ const styles = StyleSheet.create({
container: { container: {
@ -128,21 +128,20 @@ const styles = StyleSheet.create({
fontWeight: "500", fontWeight: "500",
}, },
image: { image: {
...scaleDimsFromWidth(150, 80, 35.0),
width: dims.width * 0.9,
height: dims.height * 0.9,
resizeMode: "contain", resizeMode: "contain",
}, },
img_block: { img_block: {
padding: 10,
borderRadius: 5, borderRadius: 5,
padding: 10,
borderStyle: "dotted", borderStyle: "dotted",
borderColor: colors.white, borderColor: colors.white,
borderWidth: borderWidth, borderWidth: borderWidth,
justifyContent: "center",
alignItems: "center", alignItems: "center",
width: dims.width,
}, },
imgs_container: { imgs_container: {
alignSelf: "center",
flexGrow: 1,
flexDirection: "row", flexDirection: "row",
justifyContent: "space-between", justifyContent: "space-between",
}, },

Loading…
Cancel
Save