Merge commit '610f9c21ce7d8bb65c1871c98963fcd2f68fffb0' into feature/refactoring-inject-javascript
This commit is contained in:
commit
84efa42e57
@ -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
7
lib/getPdfViewURL.js
Normal 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`;
|
||||
};
|
Loading…
Reference in New Issue
Block a user