Skip to content

Commit 522073c

Browse files
author
Azran Azwer
committed
styled
1 parent 5d62e45 commit 522073c

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

App.js

+30-6
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,27 @@ export default class App extends Component {
3636
return (
3737
<View style={styles.container}>
3838
<Text testID={"rectangleLengthText"} style={styles.label}>
39-
Length
39+
Length :
4040
</Text>
4141
<TextInput
42+
style={styles.label}
4243
testID={"rectangleLengthInput"}
4344
onChangeText={this.onUpadateLength}
45+
placeholder="Enter a Number"
46+
placeholderTextColor="#808080"
47+
returnKeyType="done"
4448
/>
4549

4650
<Text testID={"rectangleWidthText"} style={styles.label}>
47-
Width
51+
Width :
4852
</Text>
4953
<TextInput
5054
testID={"rectangleWidthInput"}
5155
onChangeText={this.onUpdateWidth}
56+
style={styles.label}
57+
placeholder="Enter a Number"
58+
placeholderTextColor="#808080"
59+
returnKeyType="done"
5260
/>
5361

5462
<TouchableOpacity
@@ -59,16 +67,21 @@ export default class App extends Component {
5967
<Text style={styles.textButton}>Calculate</Text>
6068
</TouchableOpacity>
6169

62-
<Text testID={"rectangleAreaResult"}>{area}</Text>
70+
{area ? (
71+
<Text testID={"rectangleAreaResult"} style={styles.output}>
72+
{area}{" "}
73+
</Text>
74+
) : null}
6375
</View>
6476
);
6577
}
6678
}
6779

6880
const styles = StyleSheet.create({
6981
container: {
70-
flex: 1,
71-
margin: 15
82+
padding: 20,
83+
marginHorizontal: 15,
84+
marginTop: 100
7285
},
7386
button: {
7487
backgroundColor: "#414f6f",
@@ -82,6 +95,17 @@ const styles = StyleSheet.create({
8295
color: "#ffffff"
8396
},
8497
label: {
85-
fontSize: 17
98+
height: 40,
99+
backgroundColor: "rgba(225,225,225,0.2)",
100+
marginBottom: 10,
101+
padding: 10
102+
},
103+
output: {
104+
padding: 15,
105+
color: "#000000",
106+
backgroundColor: "#ADD8E6",
107+
borderRadius: 10,
108+
marginTop: 20,
109+
textAlign: "center"
86110
}
87111
});

0 commit comments

Comments
 (0)