Hangry/app/components/Public/commonTextView.js

62 lines
1.5 KiB
JavaScript
Raw Normal View History

2024-02-27 16:19:55 +08:00
import React from "react";
import { View, TextInput, TouchableOpacity } from "react-native";
import Text from "react-native-text";
import { scale, verticalScale, moderateScale } from "react-native-size-matters";
import Size from "../../config/size";
import { Fonts } from "../../config/fonts";
import theme from "../../config/colors";
const size = new Size();
import { width, height } from "../../config/screen";
const CommonTextView = props => {
return (
<View
style={{
borderBottomColor: "black",
borderBottomWidth: 1,
marginTop: 15,
marginBottom: 10,
width: "70%"
}}
>
<Text
style={{
color: theme.coolGrey,
fontFamily: Fonts.century,
fontSize: 13
}}
>
{props.title}
</Text>
{!props.input ? (
<Text
style={{
marginTop: 5,
color: theme.coolGrey,
fontFamily: Fonts.century,
fontSize: 13
}}
>
{props.content}
</Text>
) : (
<View style={{ flexDirection: "row", justifyContent: "space-between" }}>
<TextInput placeholder={"text here"} />
<TouchableOpacity
style={{
justifyContent: "center",
alignItems: "center",
borderWidth: 1,
borderColor: "black"
}}
>
<Text>{props.buttonTitle}</Text>
</TouchableOpacity>
</View>
)}
</View>
);
};
export default CommonTextView;