mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-24 00:38:49 +01:00
Handle use-case when Following is not in Home, in multi-column mode
This commit is contained in:
parent
02eb2ff470
commit
ab2328f364
4 changed files with 17 additions and 3 deletions
|
@ -258,7 +258,7 @@ function App() {
|
|||
{isLoggedIn && (
|
||||
<Route path="/notifications" element={<Notifications />} />
|
||||
)}
|
||||
{isLoggedIn && <Route path="/l/f" element={<Following />} />}
|
||||
{isLoggedIn && <Route path="/following" element={<Following />} />}
|
||||
{isLoggedIn && <Route path="/homev1" element={<HomeV1 />} />}
|
||||
{isLoggedIn && <Route path="/b" element={<Bookmarks />} />}
|
||||
{isLoggedIn && <Route path="/f" element={<Favourites />} />}
|
||||
|
|
|
@ -10,6 +10,15 @@ import MenuLink from './MenuLink';
|
|||
function NavMenu(props) {
|
||||
const snapStates = useSnapshot(states);
|
||||
const { instance, authenticated } = api();
|
||||
|
||||
// Home = Following
|
||||
// But when in multi-column mode, Home becomes columns of anything
|
||||
// User may choose pin or not to pin Following
|
||||
// If user doesn't pin Following, we show it in the menu
|
||||
const showFollowing =
|
||||
snapStates.settings.shortcutsColumnsMode &&
|
||||
!snapStates.shortcuts.find((pin) => pin.type === 'following');
|
||||
|
||||
return (
|
||||
<Menu
|
||||
portal={{
|
||||
|
@ -30,6 +39,11 @@ function NavMenu(props) {
|
|||
</MenuLink>
|
||||
{authenticated && (
|
||||
<>
|
||||
{showFollowing && (
|
||||
<MenuLink to="/following">
|
||||
<Icon icon="following" size="l" /> <span>Following</span>
|
||||
</MenuLink>
|
||||
)}
|
||||
<MenuLink to="/notifications">
|
||||
<Icon icon="notification" size="l" /> <span>Notifications</span>
|
||||
{snapStates.notificationsShowNew && (
|
||||
|
|
|
@ -81,7 +81,7 @@ const TYPE_PARAMS = {
|
|||
export const SHORTCUTS_META = {
|
||||
following: {
|
||||
title: 'Home / Following',
|
||||
path: (_, index) => (index === 0 ? '/' : '/l/f'),
|
||||
path: (_, index) => (index === 0 ? '/' : '/following'),
|
||||
icon: 'home',
|
||||
},
|
||||
notifications: {
|
||||
|
|
|
@ -10,7 +10,7 @@ import useTitle from '../utils/useTitle';
|
|||
const LIMIT = 20;
|
||||
|
||||
function Following({ title, path, id, ...props }) {
|
||||
useTitle(title || 'Following', path, '/l/f');
|
||||
useTitle(title || 'Following', path || '/following');
|
||||
const { masto, instance } = api();
|
||||
const snapStates = useSnapshot(states);
|
||||
const homeIterator = useRef();
|
||||
|
|
Loading…
Reference in a new issue