Fakultas Ilmu Komputer UI

Commit 3f768e55 authored by angelin depthios's avatar angelin depthios
Browse files

Merge branch 'plain-button' into 'master'

feat: add description in Plain button

See merge request !59
parents 65364bfa 4eaa9261
......@@ -5,13 +5,29 @@ import Colors from "../../constants/Colors";
type props = {
text: string;
onPress: () => void;
desc?: boolean;
descText?: string;
};
const PlainButton = ({ text, onPress }: props) => {
const PlainButton = ({ text, desc, onPress, descText }: props) => {
return (
<View>
<TouchableOpacity style={styles.button} onPress={() => onPress()}>
<View style={styles.textContainter}>
<Text style={styles.texts}>{text}</Text>
{desc && (
<View style={styles.desc}>
<View style={{ marginRight: 3 }}>
<MaterialIcons
name="group"
size={15}
color={Colors.icon.inactive}
/>
</View>
<View style={{ flex: 1, paddingRight: 7 }}>
<Text style={styles.descText}>{descText}</Text>
</View>
</View>
)}
</View>
<View style={styles.iconContainer}>
<MaterialIcons
......@@ -31,7 +47,7 @@ export default PlainButton;
const styles = StyleSheet.create({
button: {
width: 363,
width: "100%",
borderRadius: 8,
elevation: 4,
flexDirection: "row",
......@@ -41,13 +57,13 @@ const styles = StyleSheet.create({
},
textContainter: {
flex: 1,
marginRight: 25,
marginLeft: 8,
marginVertical: 8,
paddingRight: 25,
paddingLeft: 8,
paddingVertical: 8,
},
iconContainer: {
marginRight: 16,
marginVertical: 23,
paddingRight: 16,
paddingVertical: 23,
},
texts: {
fontWeight: "300",
......@@ -55,6 +71,15 @@ const styles = StyleSheet.create({
fontSize: 16,
textAlign: "left",
textAlignVertical: "center",
color: "#666666",
color: Colors.text.body,
},
desc: {
paddingTop: 5,
flexDirection: "row",
alignItems: "center",
},
descText: {
fontSize: 12,
color: Colors.text.disabled,
},
});
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment