EachTrainInfoをコンポーネントファイル分割

This commit is contained in:
harukin-OneMix4
2024-02-06 16:19:30 +09:00
parent b551c75061
commit 32e61a824b
5 changed files with 283 additions and 265 deletions

View File

@@ -0,0 +1,32 @@
import React from "react";
import { View, Text } from "react-native";
export const StateBox = ({ text, title, style }) => (
<View style={{ ...boxStyle, ...style }}>
<Text style={{ fontSize: 12, color: "#0099CC" }}>{title}</Text>
<View style={{ flex: 1 }} />
<View style={{ fontSize: 25, color: "#0099CC", textAlign: "right" }}>
{text?.match("") ? (
<>
<Text style={boxTextStyle}>{text.split("")[0]}</Text>
<Text style={{ color: "#0099CC", textAlign: "right" }}></Text>
<Text style={boxTextStyle}>{text.split("")[1]}</Text>
</>
) : (
<Text style={boxTextStyle}>{text}</Text>
)}
</View>
</View>
);
const boxStyle = {
flex: 1,
backgroundColor: "white",
borderRadius: 10,
padding: 10,
margin: 10,
};
const boxTextStyle = {
fontSize: 25,
color: "#0099CC",
textAlign: "right",
};