ほぼすべての駅名標機能で内部ブラウザを利用できるように変更
This commit is contained in:
@@ -43,7 +43,13 @@ export const StationDeteilView = (props) => {
|
||||
}
|
||||
setTrainBus(data[0]);
|
||||
}, [currentStation]);
|
||||
|
||||
const info =
|
||||
currentStation &&
|
||||
(currentStation[0].StationTimeTable.match(".pdf")
|
||||
? `https://docs.google.com/viewer?url=${encodeURI(
|
||||
currentStation[0].StationTimeTable
|
||||
)}&embedded=true`
|
||||
: currentStation[0].StationTimeTable);
|
||||
return (
|
||||
<ActionSheet
|
||||
ref={StationBoardAcSR}
|
||||
@@ -86,13 +92,12 @@ export const StationDeteilView = (props) => {
|
||||
setFavoriteStation={setFavoriteStation}
|
||||
oP={() => {
|
||||
navigate("howto", {
|
||||
info: `https://docs.google.com/viewer?url=${encodeURI(
|
||||
currentStation[0].StationTimeTable
|
||||
)}&embedded=true`,
|
||||
info,
|
||||
onExit,
|
||||
});
|
||||
StationBoardAcSR.current?.hide();
|
||||
}}
|
||||
oLP={() => Linking.openURL(currentStation[0].StationTimeTable)}
|
||||
/>
|
||||
</View>
|
||||
)}
|
||||
@@ -118,6 +123,12 @@ export const StationDeteilView = (props) => {
|
||||
});
|
||||
StationBoardAcSR.current?.hide();
|
||||
}}
|
||||
oLP={() => {
|
||||
Linking.openURL(
|
||||
currentStation[0].JrHpUrl.replace("/index.html", "/") +
|
||||
"/kounai_map.html"
|
||||
);
|
||||
}}
|
||||
uri={currentStation[0].JrHpUrl.replace("/index.html", "/")}
|
||||
/>
|
||||
)}
|
||||
@@ -128,7 +139,14 @@ export const StationDeteilView = (props) => {
|
||||
backgroundColor={"#AD7FA8"}
|
||||
icon={<Foundation name="web" color="white" size={50} />}
|
||||
flex={1}
|
||||
onPressButton={() =>
|
||||
onPressButton={() => {
|
||||
navigate("howto", {
|
||||
info: currentStation[0].JrHpUrl,
|
||||
onExit,
|
||||
});
|
||||
StationBoardAcSR.current?.hide();
|
||||
}}
|
||||
onLongPressButton={() =>
|
||||
Linking.openURL(currentStation[0].JrHpUrl)
|
||||
}
|
||||
>
|
||||
@@ -140,7 +158,14 @@ export const StationDeteilView = (props) => {
|
||||
backgroundColor={"#8F5902"}
|
||||
icon={<FontAwesome name="table" color="white" size={50} />}
|
||||
flex={1}
|
||||
onPressButton={() =>
|
||||
onPressButton={() => {
|
||||
navigate("howto", {
|
||||
info,
|
||||
onExit,
|
||||
});
|
||||
StationBoardAcSR.current?.hide();
|
||||
}}
|
||||
onLongPressButton={() =>
|
||||
Linking.openURL(currentStation[0].StationTimeTable)
|
||||
}
|
||||
>
|
||||
@@ -164,7 +189,14 @@ export const StationDeteilView = (props) => {
|
||||
backgroundColor={"#CE5C00"}
|
||||
icon={<Ionicons name="bus" color="white" size={50} />}
|
||||
flex={1}
|
||||
onPressButton={() => Linking.openURL(trainBus.address)}
|
||||
onPressButton={() => {
|
||||
navigate("howto", {
|
||||
info: trainBus.address,
|
||||
onExit,
|
||||
});
|
||||
StationBoardAcSR.current?.hide();
|
||||
}}
|
||||
onLongPressButton={() => Linking.openURL(trainBus.address)}
|
||||
>
|
||||
並行バス
|
||||
</TicketBox>
|
||||
@@ -332,6 +364,7 @@ const 駅構内図 = (props) => {
|
||||
margin: 2,
|
||||
}}
|
||||
onPress={props.oP}
|
||||
onLongPress={props.oLP}
|
||||
//onPress={() => setOpen(!open)}
|
||||
>
|
||||
<View style={{ flex: 1 }} />
|
||||
|
Reference in New Issue
Block a user