import { Text, ScrollView, useWindowDimensions, StyleSheet } from 'react-native'; import React from 'react'; import { SceneMap, TabBar, TabView } from 'react-native-tab-view'; interface ChargingStationTabViewProps { titles: string[]; } export const ChargingStationTabView: React.FC = ({ titles }) => { const layout = useWindowDimensions(); //tab 1 const FirstRoute = () => ( 若客戶逾時超過15分鐘,系統將視作自動放棄預約,客戶需要重新預約一次。 本公司有權保留全數費用,恕不退還。 ); //tab 2 const SecondRoute = () => ( ); const renderScene = SceneMap({ firstRoute: FirstRoute, secondRoute: SecondRoute }); const [routes] = React.useState([ { key: 'firstRoute', title: titles[0] }, { key: 'secondRoute', title: titles[1] } ]); const [index, setIndex] = React.useState(0); const renderTabBar = (props: any) => ( ); return ( ( {route.title} ), }} /> ); }; const styles = StyleSheet.create({ grayColor: { color: '#888888' }, topLeftTriangle: { width: 0, height: 0, borderLeftWidth: 50, borderBottomWidth: 50, borderLeftColor: '#02677D', borderBottomColor: 'transparent', position: 'absolute', top: 0, left: 0 }, text: { fontWeight: 300, color: '#000000' } });