4 changed files with 38 additions and 14 deletions
@ -1,24 +1,27 @@ |
|||||||
import { usePrimaryPage, usePrimaryNoteView } from '@/PageManager' |
import { usePrimaryPage, usePrimaryNoteView } from '@/PageManager' |
||||||
import { Compass } from 'lucide-react' |
import storage from '@/services/local-storage.service' |
||||||
|
import { Rss } from 'lucide-react' |
||||||
import BottomNavigationBarItem from './BottomNavigationBarItem' |
import BottomNavigationBarItem from './BottomNavigationBarItem' |
||||||
|
|
||||||
/** Relay explore / discovery (primary Explore page). */ |
export default function RssButton() { |
||||||
export default function FeedButton() { |
|
||||||
const { navigate, current, display } = usePrimaryPage() |
const { navigate, current, display } = usePrimaryPage() |
||||||
const { primaryViewType, setPrimaryNoteView } = usePrimaryNoteView() |
const { primaryViewType, setPrimaryNoteView } = usePrimaryNoteView() |
||||||
|
const showRssFeed = storage.getShowRssFeed() |
||||||
|
|
||||||
|
if (!showRssFeed) return null |
||||||
|
|
||||||
return ( |
return ( |
||||||
<BottomNavigationBarItem |
<BottomNavigationBarItem |
||||||
active={current === 'explore' && display && primaryViewType === null} |
active={current === 'rss' && display && primaryViewType === null} |
||||||
onClick={() => { |
onClick={() => { |
||||||
if (primaryViewType !== null) { |
if (primaryViewType !== null) { |
||||||
setPrimaryNoteView(null) |
setPrimaryNoteView(null) |
||||||
} else { |
} else { |
||||||
navigate('explore') |
navigate('rss') |
||||||
} |
} |
||||||
}} |
}} |
||||||
> |
> |
||||||
<Compass /> |
<Rss /> |
||||||
</BottomNavigationBarItem> |
</BottomNavigationBarItem> |
||||||
) |
) |
||||||
} |
} |
||||||
Loading…
Reference in new issue