diff --git a/src/components/navbar/DefaultNavBar.tsx b/src/components/navbar/DefaultNavBar.tsx index 5180ff2a..5373021e 100644 --- a/src/components/navbar/DefaultNavBar.tsx +++ b/src/components/navbar/DefaultNavBar.tsx @@ -14,10 +14,15 @@ import IconButton from '@mui/material/IconButton'; import { useMediaQuery } from '@mui/material'; import { useTheme } from '@mui/material/styles'; import CollectionsBookmarkIcon from '@mui/icons-material/CollectionsBookmark'; +import CollectionsOutlinedBookmarkIcon from '@mui/icons-material/CollectionsBookmarkOutlined'; import NewReleasesIcon from '@mui/icons-material/NewReleases'; +import NewReleasesOutlinedIcon from '@mui/icons-material/NewReleasesOutlined'; import ExploreIcon from '@mui/icons-material/Explore'; +import ExploreOutlinedIcon from '@mui/icons-material/ExploreOutlined'; import ExtensionIcon from '@mui/icons-material/Extension'; +import ExtensionOutlinedIcon from '@mui/icons-material/ExtensionOutlined'; import GetAppIcon from '@mui/icons-material/GetApp'; +import GetAppOutlinedIcon from '@mui/icons-material/GetAppOutlined'; import SettingsIcon from '@mui/icons-material/Settings'; import ArrowBack from '@mui/icons-material/ArrowBack'; import { useHistory } from 'react-router-dom'; @@ -42,36 +47,43 @@ const navbarItems: Array = [ { path: '/library', title: 'Library', - IconComponent: CollectionsBookmarkIcon, + SelectedIconComponent: CollectionsBookmarkIcon, + IconComponent: CollectionsOutlinedBookmarkIcon, show: 'both', }, { path: '/updates', title: 'Updates', - IconComponent: NewReleasesIcon, + SelectedIconComponent: NewReleasesIcon, + IconComponent: NewReleasesOutlinedIcon, show: 'both', }, { path: '/sources', title: 'Sources', - IconComponent: ExploreIcon, + SelectedIconComponent: ExploreIcon, + IconComponent: ExploreOutlinedIcon, show: 'desktop', }, { path: '/extensions', title: 'Extensions', - IconComponent: ExtensionIcon, + SelectedIconComponent: ExtensionIcon, + IconComponent: ExtensionOutlinedIcon, show: 'desktop', }, { path: '/browse', title: 'Browse', - IconComponent: ExploreIcon, + SelectedIconComponent: ExploreIcon, + IconComponent: ExploreOutlinedIcon, show: 'mobile', }, { path: '/downloads', title: 'Downloads', - IconComponent: GetAppIcon, + SelectedIconComponent: GetAppIcon, + IconComponent: GetAppOutlinedIcon, show: 'both', }, { path: '/settings', title: 'Settings', + SelectedIconComponent: SettingsIcon, IconComponent: SettingsIcon, show: 'both', }, diff --git a/src/components/navbar/navigation/DesktopSideBar.tsx b/src/components/navbar/navigation/DesktopSideBar.tsx index f31eeded..4f4dab66 100644 --- a/src/components/navbar/navigation/DesktopSideBar.tsx +++ b/src/components/navbar/navigation/DesktopSideBar.tsx @@ -28,19 +28,25 @@ interface IProps { export default function DesktopSideBar({ navBarItems }: IProps) { const location = useLocation(); + + const iconFor = (path: string, IconComponent: any, SelectedIconComponent: any) => { + if (location.pathname === path) return ; + return ; + }; + return ( { // eslint-disable-next-line react/destructuring-assignment - navBarItems.map(({ path, title, IconComponent }: NavbarItem) => ( + navBarItems.map(({ + path, title, IconComponent, SelectedIconComponent, + }: NavbarItem) => ( - - + {iconFor(path, IconComponent, SelectedIconComponent)} - diff --git a/src/components/navbar/navigation/MobileBottomBar.tsx b/src/components/navbar/navigation/MobileBottomBar.tsx index 9055c460..934e98b8 100644 --- a/src/components/navbar/navigation/MobileBottomBar.tsx +++ b/src/components/navbar/navigation/MobileBottomBar.tsx @@ -39,10 +39,20 @@ interface IProps { export default function MobileBottomBar({ navBarItems }: IProps) { const location = useLocation(); + + const iconFor = (path: string, IconComponent: any, SelectedIconComponent: any) => { + if (location.pathname === path) return ; + return ; + }; + return ( { - navBarItems.map(({ path, title, IconComponent }: NavbarItem) => ( + navBarItems.map(( + { + path, title, IconComponent, SelectedIconComponent, + }: NavbarItem, + ) => ( - + {iconFor(path, IconComponent, SelectedIconComponent)}
{title}
diff --git a/src/typings.d.ts b/src/typings.d.ts index 43f5d91e..77aaeb9d 100644 --- a/src/typings.d.ts +++ b/src/typings.d.ts @@ -193,9 +193,10 @@ interface SourcePreferences { props: any } -interface NavbarItem{ +interface NavbarItem { path: string, title:string, + SelectedIconComponent: OverridableComponent>, IconComponent: OverridableComponent>, show: 'mobile' | 'desktop' | 'both' }