diff --git a/components/Apps/FixedPositionBox.tsx b/components/Apps/FixedPositionBox.tsx index 15b6ce2..cb34f7d 100644 --- a/components/Apps/FixedPositionBox.tsx +++ b/components/Apps/FixedPositionBox.tsx @@ -7,7 +7,7 @@ import { useState } from "react"; export const FixedPositionBox = () => { const { fixedPosition, setFixedPosition } = useCurrentTrain(); - const [displaySize, setDisplaySize] = useState(50); + const [displaySize, setDisplaySize] = useState(76); return ( { height: displaySize, flexDirection: "row", }} + pointerEvents="box-none" > {fixedPosition.type === "station" && ( = ({ }, [trainTimeAndNumber, currentTrain /*finalSwitch*/]); return ( - { - const payload = { - currentStation: station, - navigate, - goTo: "menu", - onExit: () => SheetManager.hide("StationDetailView"), - }; - //@ts-ignore - SheetManager.show("StationDetailView", { payload }); - }} + - { + const payload = { + currentStation: station, + navigate, + goTo: "menu", + onExit: () => SheetManager.hide("StationDetailView"), + }; + //@ts-ignore + SheetManager.show("StationDetailView", { payload }); }} > - - - {station[0]?.Station_JP} - + + + {station[0]?.Station_JP} + + + + + 次の発車予定: + + + + + {selectedTrain.length > 0 ? ( + selectedTrain.map((d) => ( + + )) + ) : ( + + + 当駅を発着する走行中の列車はありません。 + + + )} + + + + { + setFixedPosition({ type: null, value: null }); + }} + > + + + + 駅位置ロック中 + + + + + - - + { + LayoutAnimation.configureNext({ + duration: 500, + update: { type: "spring", springDamping: 0.7 }, + }); + if (displaySize === 76) { + setDisplaySize(226); + } else { + setDisplaySize(76); + } }} > - 次の発車予定: - - - - - {selectedTrain.length > 0 ? ( - selectedTrain.map((d) => ( - + + - )) - ) : ( - - - 当駅を発着する走行中の列車はありません。 + + {displaySize == 76 ? "時刻表を展開する" : "時刻表を縮小する"} - )} + - { - setFixedPosition({ type: null, value: null }); - }} - > - - - - 駅位置ロック中 - - - - - - - { - LayoutAnimation.configureNext({ - duration: 500, - update: { type: "spring", springDamping: 0.7 }, - }); - if (displaySize === 50) { - setDisplaySize(200); - } else { - setDisplaySize(50); - } - }} - > - - - - - {displaySize == 50 ? "時刻表を展開する" : "時刻表を縮小する"} - - - - + ); }; diff --git a/components/Apps/FixedPositionBox/FixedTrainBox.tsx b/components/Apps/FixedPositionBox/FixedTrainBox.tsx index e7fab97..aa266b1 100644 --- a/components/Apps/FixedPositionBox/FixedTrainBox.tsx +++ b/components/Apps/FixedPositionBox/FixedTrainBox.tsx @@ -215,322 +215,331 @@ export const FixedTrain: FC = ({ }`; return ( - - - - {customTrainType.shortName} - - {customData.trainName && ( - 6 ? 8 : 14, - color: "white", - maxWidth: displaySize === 50 ? 60 : 200, - textAlignVertical: "center", - }} - > - {trainNameText} - - )} - - - + > + + + + {customTrainType.shortName} + + {customData.trainName && ( + 6 ? 8 : 14, + color: "white", + maxWidth: displaySize === 76 ? 60 : 200, + textAlignVertical: "center", + }} + > + {trainNameText} + + )} + + + - - 4 ? 9 : 12, - color: "white", - fontWeight: "bold", - textAlignVertical: "center", - margin: 0, - padding: 0, - height: "100%", + flexDirection: "row", + alignContent: "center", + alignSelf: "center", + alignItems: "center", }} > - {ToData}行 - + + 4 ? 9 : 12, + color: "white", + fontWeight: "bold", + textAlignVertical: "center", + margin: 0, + padding: 0, + height: "100%", + }} + > + {ToData}行 + + - - {displaySize === 200 && ( - - )} - - - {nextStationData[0]?.Station_JP == train?.Pos ? "ただいま" : "次は"} - - - - {nextStationData[0]?.Station_JP || "不明"} - - {displaySize === 50 && ( + {displaySize === 226 && ( )} - - - - { - setFixedPosition({ type: null, value: null }); - }} - > - - - - 列車追跡中 - - - - - - - { - LayoutAnimation.configureNext({ - duration: 500, - update: { type: "spring", springDamping: 0.7 }, - }); - if (displaySize === 50) { - setDisplaySize(200); - } else { - setDisplaySize(50); - } - }} - > - - - - - {displaySize == 50 ? "列車情報展開" : "列車情報縮小"} - + + {nextStationData[0]?.Station_JP == train?.Pos + ? "ただいま" + : "次は"} + + + + {nextStationData[0]?.Station_JP || "不明"} + + {displaySize === 76 && ( + + )} + - + + + + { + setFixedPosition({ type: null, value: null }); + }} + > + + + + 列車追跡中 + + + + + + + { + LayoutAnimation.configureNext({ + duration: 200, + update: { type: "easeInEaseOut", springDamping: 0.4 }, + }); + if (displaySize === 76) { + setDisplaySize(226); + } else { + setDisplaySize(76); + } + }} + > + + + + + {displaySize == 76 ? "列車情報展開" : "列車情報縮小"} + + + + ); };