Skip to content

Commit f827861

Browse files
Add files via upload
1 parent 405edf6 commit f827861

File tree

4 files changed

+48
-18
lines changed

4 files changed

+48
-18
lines changed

app/components/AppText.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
import React from "react";
22
import { Text, StyleSheet, Platform } from "react-native";
3-
3+
import defaultStyles from '../config/styles'
44
function AppText({ children, style }) {
5-
return <Text style={[styles.text, style]}>{children}</Text>;
5+
return <Text style={[defaultStyles, style]}>{children}</Text>;
66
}
77

8-
const styles = StyleSheet.create({
9-
text: {
10-
fontSize: 18,
11-
fontFamily: Platform.OS === "android" ? "Roboto" : "Avenir",
12-
},
13-
});
8+
149

1510
export default AppText;

app/components/AppTextInput.js

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,34 @@
1-
import React from 'react';
2-
3-
function AppTextInput(props) {
4-
return (
5-
<div>
6-
7-
</div>
8-
);
1+
import React from "react";
2+
import { View, StyleSheet, TextInput } from "react-native";
3+
import { MaterialCommunityIcons } from "@expo/vector-icons";
4+
import colors from "../config/colors";
5+
import defaultStyles from "../config/styles"
6+
function AppTextInput({ icon, ...otherProps }) {
7+
return (
8+
<View styles={styles.container}>
9+
{icon && (
10+
<MaterialCommunityIcons
11+
name={icon}
12+
size={20}
13+
color={colors.medium}
14+
style={styles.icon}
15+
/>
16+
)}
17+
<TextInput style={defaultStyles.text} {...otherProps} />
18+
</View>
19+
);
920
}
10-
21+
const styles = StyleSheet.create({
22+
container: {
23+
backgroundColor: colors.light,
24+
borderRadius: 25,
25+
flexDirection: "row",
26+
width: "100%",
27+
padding: 15,
28+
marginVertical: 10,
29+
},
30+
icon: {
31+
marginRight: 10,
32+
},
33+
});
1134
export default AppTextInput;

app/config/colors.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ export default {
55
white: "#fff",
66
medium: "#6e6969",
77
light : "#f8f4f4",
8-
danger :"red"
8+
danger :"red",
9+
dark:"#0c0c0c"
910
};

app/config/styles.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Platform } from "react-native";
2+
import colors from "./colors";
3+
4+
export default {
5+
colors: colors,
6+
text: {
7+
color: colors.dark,
8+
fontSize: 18,
9+
fontFamily: Platform.OS === "android" ? "Roboto" : "Avenir",
10+
},
11+
};

0 commit comments

Comments
 (0)