1+ import { AiOutlineMenu } from 'react-icons/ai'
2+ import { BsRssFill } from 'react-icons/bs'
13import { SUPPORTED_CARDS } from 'src/config'
2- import { SelectedCard } from 'src/types'
34import { useUserPreferences } from 'src/stores/preferences'
4- import { AiOutlineMenu } from 'react-icons/ai '
5+ import { SelectedCard } from 'src/types '
56
67type BottomNavigationProps = {
78 selectedCard : SelectedCard
@@ -14,31 +15,33 @@ export const BottomNavigation = ({
1415 setSelectedCard,
1516 setShowSettings,
1617} : BottomNavigationProps ) => {
17- const { cards } = useUserPreferences ( )
18+ const { cards, userCustomCards } = useUserPreferences ( )
19+ const AVAILABLE_CARDS = [ ...SUPPORTED_CARDS , ...userCustomCards ]
1820
1921 return (
2022 < div className = "bottomNavigation" >
2123 { cards . map ( ( card ) => {
22- const constantCard = SUPPORTED_CARDS . find ( ( c ) => c . value === card . name )
24+ const constantCard = AVAILABLE_CARDS . find ( ( c ) => c . value === card . name )
25+
2326 return (
24- < a
27+ < button
2528 key = { card . name }
2629 className = {
2730 'navigationItem ' + ( selectedCard && selectedCard . name === card . name ? 'active' : '' )
2831 }
29- href = "/#"
30- onClick = { ( e ) => setSelectedCard ( card ) } >
31- { constantCard ?. icon }
32- </ a >
32+ onClick = { ( ) => setSelectedCard ( card ) } >
33+ { card . type === 'supported'
34+ ? constantCard ?. icon
35+ : < img src = { constantCard ?. icon as string } alt = "" /> || < BsRssFill className = "rss" /> }
36+ </ button >
3337 )
3438 } ) }
3539 {
36- < a
40+ < button
3741 className = { 'navigationItem ' }
38- href = "/#"
39- onClick = { ( e ) => setShowSettings ( ( prev : boolean ) => ! prev ) } >
42+ onClick = { ( ) => setShowSettings ( ( prev : boolean ) => ! prev ) } >
4043 { < AiOutlineMenu /> }
41- </ a >
44+ </ button >
4245 }
4346 </ div >
4447 )
0 commit comments