Merge commit 'f815b317203b33c719e053857c8df6bfbe6e82fd' into develop

This commit is contained in:
harukin-OneMix4 2023-06-27 22:37:02 +09:00
commit 610f9c21ce
2 changed files with 9 additions and 3 deletions

View File

@ -20,6 +20,7 @@ import {
heightPercentageToDP as hp,
} from "react-native-responsive-screen";
import lineColorList from "../../assets/originData/lineColorList";
import { getPDFViewURL } from "../../lib/getPdfViewURL";
export const StationDeteilView = (props) => {
const {
@ -46,9 +47,7 @@ export const StationDeteilView = (props) => {
const info =
currentStation &&
(currentStation[0].StationTimeTable.match(".pdf")
? `https://docs.google.com/viewer?url=${encodeURI(
currentStation[0].StationTimeTable
)}&embedded=true`
? getPDFViewURL(currentStation[0].StationTimeTable)
: currentStation[0].StationTimeTable);
return (
<ActionSheet

7
lib/getPdfViewURL.js Normal file
View File

@ -0,0 +1,7 @@
import { Platform } from "react-native";
export const getPDFViewURL = (url) => {
if (Platform.OS == "ios") return url;
else
return `https://docs.google.com/viewer?url=${encodeURI(url)}&embedded=true`;
};