コンポーネントの整理
This commit is contained in:
parent
09e123222f
commit
1d27a80776
@ -101,9 +101,9 @@ export default function Sign(props) {
|
|||||||
const lottieRef = useRef();
|
const lottieRef = useRef();
|
||||||
const isMatsuyama = currentStation[0].StationNumber == "Y55";
|
const isMatsuyama = currentStation[0].StationNumber == "Y55";
|
||||||
//const isMatsuyama = true;
|
//const isMatsuyama = true;
|
||||||
if (isMatsuyama) {
|
return (
|
||||||
return (
|
<TouchableOpacity style={styleSheet.外枠} onPress={oP} onLongPress={oLP}>
|
||||||
<TouchableOpacity style={styleSheet.外枠} onPress={oP} onLongPress={oLP}>
|
{isMatsuyama && (
|
||||||
<LottieView
|
<LottieView
|
||||||
autoPlay
|
autoPlay
|
||||||
loop
|
loop
|
||||||
@ -112,140 +112,75 @@ export default function Sign(props) {
|
|||||||
height: (wp("80%") / 20) * 9,
|
height: (wp("80%") / 20) * 9,
|
||||||
backgroundColor: "#fff",
|
backgroundColor: "#fff",
|
||||||
}}
|
}}
|
||||||
source={{ uri: "https://cdn.lottielab.com/l/D4m3dmEqsjVN77.json?s" }}
|
source={{
|
||||||
|
uri: "https://cdn.lottielab.com/l/D4m3dmEqsjVN77.json?s",
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
<StationNumberMaker
|
)}
|
||||||
currentStation={currentStation}
|
<StationNumberMaker
|
||||||
isMatsuyama={isMatsuyama}
|
currentStation={currentStation}
|
||||||
/>
|
isMatsuyama={isMatsuyama}
|
||||||
<StationNameArea
|
/>
|
||||||
currentStation={currentStation}
|
<StationNameArea
|
||||||
isMatsuyama={isMatsuyama}
|
currentStation={currentStation}
|
||||||
/>
|
isMatsuyama={isMatsuyama}
|
||||||
{isCurrentStation ? (
|
/>
|
||||||
<TouchableOpacity style={{ position: "absolute", right: 0, top: 0 }}>
|
{isCurrentStation ? (
|
||||||
<MaterialCommunityIcons
|
<TouchableOpacity style={{ position: "absolute", right: 0, top: 0 }}>
|
||||||
name="crosshairs-gps"
|
<MaterialCommunityIcons
|
||||||
style={{ padding: 5 }}
|
name="crosshairs-gps"
|
||||||
color="#2E94BB"
|
style={{ padding: 5 }}
|
||||||
size={30}
|
color="#2E94BB"
|
||||||
/>
|
size={30}
|
||||||
</TouchableOpacity>
|
|
||||||
) : (
|
|
||||||
<TouchableOpacity
|
|
||||||
style={{ position: "absolute", right: -15, top: -20 }}
|
|
||||||
onPress={() => {
|
|
||||||
if (testButtonStatus) {
|
|
||||||
const otherData = favoriteStation.filter((d) => {
|
|
||||||
const compare = JSON.stringify(d);
|
|
||||||
const current = JSON.stringify(currentStation);
|
|
||||||
if (compare !== current) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
AS.setItem("favoriteStation", JSON.stringify(otherData));
|
|
||||||
setFavoriteStation(otherData);
|
|
||||||
} else {
|
|
||||||
let ret = favoriteStation;
|
|
||||||
ret.push(currentStation);
|
|
||||||
AS.setItem("favoriteStation", JSON.stringify(ret));
|
|
||||||
setFavoriteStation(ret);
|
|
||||||
}
|
|
||||||
setTestButtonStatus(!testButtonStatus);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<LottieDelayView
|
|
||||||
progress={testButtonStatus ? 1 : 0}
|
|
||||||
speed={1.4}
|
|
||||||
style={{ width: 80, height: 80 }}
|
|
||||||
source={require("../../assets/939-star.json")}
|
|
||||||
lottieRef={lottieRef}
|
|
||||||
loop={false}
|
|
||||||
/>
|
|
||||||
</TouchableOpacity>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Text style={styleSheet.JRStyle}>JR</Text>
|
|
||||||
<View style={styleSheet.下帯B} />
|
|
||||||
<View style={styleSheet.下帯内容B}>
|
|
||||||
<NexPreStationLine
|
|
||||||
preStation={preStation}
|
|
||||||
nexStation={nexStation}
|
|
||||||
isMatsuyama={isMatsuyama}
|
|
||||||
/>
|
/>
|
||||||
</View>
|
</TouchableOpacity>
|
||||||
</TouchableOpacity>
|
) : (
|
||||||
);
|
<TouchableOpacity
|
||||||
} else {
|
style={{ position: "absolute", right: -15, top: -20 }}
|
||||||
return (
|
onPress={() => {
|
||||||
<TouchableOpacity style={styleSheet.外枠} onPress={oP} onLongPress={oLP}>
|
if (testButtonStatus) {
|
||||||
<StationNumberMaker
|
const otherData = favoriteStation.filter((d) => {
|
||||||
currentStation={currentStation}
|
const compare = JSON.stringify(d);
|
||||||
isMatsuyama={isMatsuyama}
|
const current = JSON.stringify(currentStation);
|
||||||
/>
|
if (compare !== current) {
|
||||||
<StationNameArea
|
return true;
|
||||||
currentStation={currentStation}
|
} else {
|
||||||
isMatsuyama={isMatsuyama}
|
return false;
|
||||||
/>
|
}
|
||||||
{isCurrentStation ? (
|
});
|
||||||
<TouchableOpacity style={{ position: "absolute", right: 0, top: 0 }}>
|
AS.setItem("favoriteStation", JSON.stringify(otherData));
|
||||||
<MaterialCommunityIcons
|
setFavoriteStation(otherData);
|
||||||
name="crosshairs-gps"
|
} else {
|
||||||
style={{ padding: 5 }}
|
let ret = favoriteStation;
|
||||||
color="#2E94BB"
|
ret.push(currentStation);
|
||||||
size={30}
|
AS.setItem("favoriteStation", JSON.stringify(ret));
|
||||||
/>
|
setFavoriteStation(ret);
|
||||||
</TouchableOpacity>
|
}
|
||||||
) : (
|
setTestButtonStatus(!testButtonStatus);
|
||||||
<TouchableOpacity
|
}}
|
||||||
style={{ position: "absolute", right: -15, top: -20 }}
|
>
|
||||||
onPress={() => {
|
<LottieDelayView
|
||||||
if (testButtonStatus) {
|
progress={testButtonStatus ? 1 : 0}
|
||||||
const otherData = favoriteStation.filter((d) => {
|
speed={1.4}
|
||||||
const compare = JSON.stringify(d);
|
style={{ width: 80, height: 80 }}
|
||||||
const current = JSON.stringify(currentStation);
|
source={require("../../assets/939-star.json")}
|
||||||
if (compare !== current) {
|
lottieRef={lottieRef}
|
||||||
return true;
|
loop={false}
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
AS.setItem("favoriteStation", JSON.stringify(otherData));
|
|
||||||
setFavoriteStation(otherData);
|
|
||||||
} else {
|
|
||||||
let ret = favoriteStation;
|
|
||||||
ret.push(currentStation);
|
|
||||||
AS.setItem("favoriteStation", JSON.stringify(ret));
|
|
||||||
setFavoriteStation(ret);
|
|
||||||
}
|
|
||||||
setTestButtonStatus(!testButtonStatus);
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<LottieDelayView
|
|
||||||
progress={testButtonStatus ? 1 : 0}
|
|
||||||
speed={1.4}
|
|
||||||
style={{ width: 80, height: 80 }}
|
|
||||||
source={require("../../assets/939-star.json")}
|
|
||||||
lottieRef={lottieRef}
|
|
||||||
loop={false}
|
|
||||||
/>
|
|
||||||
</TouchableOpacity>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<Text style={styleSheet.JRStyle}>JR</Text>
|
|
||||||
<View style={styleSheet.下帯} />
|
|
||||||
<View style={styleSheet.下帯内容}>
|
|
||||||
<NexPreStationLine
|
|
||||||
preStation={preStation}
|
|
||||||
nexStation={nexStation}
|
|
||||||
isMatsuyama={isMatsuyama}
|
|
||||||
/>
|
/>
|
||||||
</View>
|
</TouchableOpacity>
|
||||||
</TouchableOpacity>
|
)}
|
||||||
);
|
|
||||||
}
|
<Text style={styleSheet.JRStyle}>JR</Text>
|
||||||
|
<View style={styleSheet[isMatsuyama ? "下帯B" : "下帯"]} />
|
||||||
|
<View style={styleSheet[isMatsuyama ? "下帯内容B" : "下帯内容"]}>
|
||||||
|
<NexPreStationLine
|
||||||
|
preStation={preStation}
|
||||||
|
nexStation={nexStation}
|
||||||
|
isMatsuyama={isMatsuyama}
|
||||||
|
/>
|
||||||
|
</View>
|
||||||
|
</TouchableOpacity>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const LottieDelayView = ({
|
const LottieDelayView = ({
|
||||||
|
Loading…
Reference in New Issue
Block a user