Merge commit '610f9c21ce7d8bb65c1871c98963fcd2f68fffb0' into feature/refactoring-inject-javascript
This commit is contained in:
commit
84efa42e57
@ -20,6 +20,7 @@ import {
|
|||||||
heightPercentageToDP as hp,
|
heightPercentageToDP as hp,
|
||||||
} from "react-native-responsive-screen";
|
} from "react-native-responsive-screen";
|
||||||
import lineColorList from "../../assets/originData/lineColorList";
|
import lineColorList from "../../assets/originData/lineColorList";
|
||||||
|
import { getPDFViewURL } from "../../lib/getPdfViewURL";
|
||||||
|
|
||||||
export const StationDeteilView = (props) => {
|
export const StationDeteilView = (props) => {
|
||||||
const {
|
const {
|
||||||
@ -46,9 +47,7 @@ export const StationDeteilView = (props) => {
|
|||||||
const info =
|
const info =
|
||||||
currentStation &&
|
currentStation &&
|
||||||
(currentStation[0].StationTimeTable.match(".pdf")
|
(currentStation[0].StationTimeTable.match(".pdf")
|
||||||
? `https://docs.google.com/viewer?url=${encodeURI(
|
? getPDFViewURL(currentStation[0].StationTimeTable)
|
||||||
currentStation[0].StationTimeTable
|
|
||||||
)}&embedded=true`
|
|
||||||
: currentStation[0].StationTimeTable);
|
: currentStation[0].StationTimeTable);
|
||||||
return (
|
return (
|
||||||
<ActionSheet
|
<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