33 lines
		
	
	
		
			934 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			33 lines
		
	
	
		
			934 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import React, { FC } from "react";
 | |
| import { Linking } from "react-native";
 | |
| import { FontAwesome } from "@expo/vector-icons";
 | |
| import { TicketBox } from "@/components/atom/TicketBox";
 | |
| type Props = {
 | |
|   info: string;
 | |
|   address: string;
 | |
|   usePDFView: string;
 | |
|   navigate: (screen: string, params?: object) => void;
 | |
|   onExit: () => void;
 | |
|   goTo: string;
 | |
|   useShow: string;
 | |
| };
 | |
| export const StationTimeTableButton: FC<Props> = (props) => {
 | |
|   const { info, address, usePDFView, navigate, onExit, goTo, useShow } = props;
 | |
|   return (
 | |
|     <TicketBox
 | |
|       backgroundColor={"#8F5902"}
 | |
|       icon={<FontAwesome name="table" color="white" size={50} />}
 | |
|       flex={1}
 | |
|       onPressButton={() => {
 | |
|         usePDFView == "true"
 | |
|           ? Linking.openURL(address)
 | |
|           : navigate("howto", { info, goTo, useShow });
 | |
|         onExit();
 | |
|       }}
 | |
|       onLongPressButton={() => Linking.openURL(address)}
 | |
|     >
 | |
|       時刻表
 | |
|     </TicketBox>
 | |
|   );
 | |
| };
 |