From 139c9deb75d54d72cc819f5308001ec66d3962bc Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Wed, 20 Jul 2022 19:39:51 -0500 Subject: [PATCH] Add icons to main tabs --- src/view/index.ts | 15 ++++++++++++++- src/view/routes/index.tsx | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/view/index.ts b/src/view/index.ts index da8847bd..d636844c 100644 --- a/src/view/index.ts +++ b/src/view/index.ts @@ -1,8 +1,12 @@ import moment from 'moment' import {library} from '@fortawesome/fontawesome-svg-core' +import {faBars} from '@fortawesome/free-solid-svg-icons/faBars' +import {faBell} from '@fortawesome/free-solid-svg-icons/faBell' import {faComment} from '@fortawesome/free-regular-svg-icons/faComment' import {faHeart} from '@fortawesome/free-regular-svg-icons/faHeart' +import {faHouse} from '@fortawesome/free-solid-svg-icons/faHouse' +import {faMagnifyingGlass} from '@fortawesome/free-solid-svg-icons/faMagnifyingGlass' import {faShareFromSquare} from '@fortawesome/free-solid-svg-icons/faShareFromSquare' import {faRetweet} from '@fortawesome/free-solid-svg-icons/faRetweet' @@ -27,5 +31,14 @@ export function setup() { yy: '%dy', }, }) - library.add(faComment, faHeart, faRetweet, faShareFromSquare) + library.add( + faBars, + faBell, + faComment, + faHeart, + faHouse, + faMagnifyingGlass, + faRetweet, + faShareFromSquare, + ) } diff --git a/src/view/routes/index.tsx b/src/view/routes/index.tsx index 2d47a047..11245219 100644 --- a/src/view/routes/index.tsx +++ b/src/view/routes/index.tsx @@ -9,6 +9,7 @@ import { import {createNativeStackNavigator} from '@react-navigation/native-stack' import {createBottomTabNavigator} from '@react-navigation/bottom-tabs' import {observer} from 'mobx-react-lite' +import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import type {RootTabsParamList} from './types' import {useStores} from '../../state' import * as platform from '../../platform/detection' @@ -54,8 +55,19 @@ const tabBarScreenOptions = ({ }) => ({ headerShown: false, tabBarIcon: (_state: {focused: boolean; color: string; size: number}) => { - // TODO: icons - return {route.name?.[0] || ''} + switch (route.name) { + case 'Home': + return + case 'Search': + return + case 'Notifications': + return + case 'Menu': + return + default: + return + } + // return {route.name?.[0] || ''} }, })