コードの整理
This commit is contained in:
@@ -6,30 +6,46 @@ type stateBox = {
|
||||
title: string;
|
||||
style?: ViewStyle;
|
||||
mode?: number;
|
||||
endText?: string;
|
||||
};
|
||||
export const StateBox: FC<stateBox> = ({ text, title, style, mode }) => (
|
||||
<View style={{ ...(mode == 2 ? boxStyle2 : boxStyle), ...style }}>
|
||||
<Text style={{ fontSize: 12, color: "#0099CC" }}>{title}</Text>
|
||||
<View style={{ flex: 1 }} />
|
||||
<View style={{ flexDirection: mode == 2 ? "row" : "column" }}>
|
||||
{text?.match("~") ? (
|
||||
<>
|
||||
<Text style={mode == 2 ? boxTextStyle2 : boxTextStyle}>
|
||||
{text.split("~")[0]}
|
||||
export const StateBox: FC<stateBox> = (props) => {
|
||||
const { text, title, style, mode, endText } = props;
|
||||
return (
|
||||
<View style={{ ...(mode == 2 ? boxStyle2 : boxStyle), ...style }}>
|
||||
<Text style={{ fontSize: 12, color: "#0099CC" }}>{title}</Text>
|
||||
<View style={{ flex: 1 }} />
|
||||
<View style={{ flexDirection: mode == 2 ? "row" : "column" }}>
|
||||
{text?.match("~") ? (
|
||||
<>
|
||||
<Text style={mode == 2 ? boxTextStyle2 : boxTextStyle}>
|
||||
{text.split("~")[0]}
|
||||
</Text>
|
||||
<Text style={{ color: "#0099CC", textAlign: "right" }}>
|
||||
{mode == 2 ? "→" : "↓"}
|
||||
</Text>
|
||||
<Text style={mode == 2 ? boxTextStyle2 : boxTextStyle}>
|
||||
{text.split("~")[1]}
|
||||
</Text>
|
||||
</>
|
||||
) : (
|
||||
<Text style={mode == 2 ? boxTextStyle2 : boxTextStyle}>{text}</Text>
|
||||
)}
|
||||
</View>
|
||||
{endText && (
|
||||
<View style={{ flexDirection: mode == 2 ? "row" : "column" }}>
|
||||
<Text
|
||||
style={{
|
||||
...{ ...(mode == 2 ? boxTextStyle2 : boxTextStyle) },
|
||||
fontSize: 10,
|
||||
}}
|
||||
>
|
||||
{endText}
|
||||
</Text>
|
||||
<Text style={{ color: "#0099CC", textAlign: "right" }}>
|
||||
{mode == 2 ? "→" : "↓"}
|
||||
</Text>
|
||||
<Text style={mode == 2 ? boxTextStyle2 : boxTextStyle}>
|
||||
{text.split("~")[1]}
|
||||
</Text>
|
||||
</>
|
||||
) : (
|
||||
<Text style={mode == 2 ? boxTextStyle2 : boxTextStyle}>{text}</Text>
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
);
|
||||
};
|
||||
const boxStyle: ViewStyle = {
|
||||
flex: 1,
|
||||
backgroundColor: "white",
|
||||
|
Reference in New Issue
Block a user