diff --git a/App.js b/App.js index 04675dc..d17f794 100644 --- a/App.js +++ b/App.js @@ -35,12 +35,12 @@ export default function App() { , + tabBarIcon: initIcon("barchart", "AntDesign"), }} /> , + tabBarIcon: initIcon("ios-radio", "Ionicons"), }} /> , + tabBarIcon: initIcon("md-train", "Ionicons"), }} /> ); } -const top = ({ navigation }) => { + +const initIcon = (name, type, props) => { + switch (type) { + case "Ionicons": + return ({ focused, color, size }) => ( + + ); + case "AntDesign": + return ({ focused, color, size }) => ( + + ); + } +}; + +const Top = ({ navigation }) => { const webview = useRef(); //地図用 const [mapsStationData, setMapsStationData] = useState(undefined); + useEffect(() => { getStationList2().then(setMapsStationData); }, []); + useEffect(() => { const unsubscribe = navigation.addListener("tabLongPress", (e) => { navigation.navigate("favoriteList");