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 && (
|
{isLoggedIn && (
|
||||||
<Route path="/notifications" element={<Notifications />} />
|
<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="/homev1" element={<HomeV1 />} />}
|
||||||
{isLoggedIn && <Route path="/b" element={<Bookmarks />} />}
|
{isLoggedIn && <Route path="/b" element={<Bookmarks />} />}
|
||||||
{isLoggedIn && <Route path="/f" element={<Favourites />} />}
|
{isLoggedIn && <Route path="/f" element={<Favourites />} />}
|
||||||
|
|
|
@ -10,6 +10,15 @@ import MenuLink from './MenuLink';
|
||||||
function NavMenu(props) {
|
function NavMenu(props) {
|
||||||
const snapStates = useSnapshot(states);
|
const snapStates = useSnapshot(states);
|
||||||
const { instance, authenticated } = api();
|
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 (
|
return (
|
||||||
<Menu
|
<Menu
|
||||||
portal={{
|
portal={{
|
||||||
|
@ -30,6 +39,11 @@ function NavMenu(props) {
|
||||||
</MenuLink>
|
</MenuLink>
|
||||||
{authenticated && (
|
{authenticated && (
|
||||||
<>
|
<>
|
||||||
|
{showFollowing && (
|
||||||
|
<MenuLink to="/following">
|
||||||
|
<Icon icon="following" size="l" /> <span>Following</span>
|
||||||
|
</MenuLink>
|
||||||
|
)}
|
||||||
<MenuLink to="/notifications">
|
<MenuLink to="/notifications">
|
||||||
<Icon icon="notification" size="l" /> <span>Notifications</span>
|
<Icon icon="notification" size="l" /> <span>Notifications</span>
|
||||||
{snapStates.notificationsShowNew && (
|
{snapStates.notificationsShowNew && (
|
||||||
|
|
|
@ -81,7 +81,7 @@ const TYPE_PARAMS = {
|
||||||
export const SHORTCUTS_META = {
|
export const SHORTCUTS_META = {
|
||||||
following: {
|
following: {
|
||||||
title: 'Home / Following',
|
title: 'Home / Following',
|
||||||
path: (_, index) => (index === 0 ? '/' : '/l/f'),
|
path: (_, index) => (index === 0 ? '/' : '/following'),
|
||||||
icon: 'home',
|
icon: 'home',
|
||||||
},
|
},
|
||||||
notifications: {
|
notifications: {
|
||||||
|
|
|
@ -10,7 +10,7 @@ import useTitle from '../utils/useTitle';
|
||||||
const LIMIT = 20;
|
const LIMIT = 20;
|
||||||
|
|
||||||
function Following({ title, path, id, ...props }) {
|
function Following({ title, path, id, ...props }) {
|
||||||
useTitle(title || 'Following', path, '/l/f');
|
useTitle(title || 'Following', path || '/following');
|
||||||
const { masto, instance } = api();
|
const { masto, instance } = api();
|
||||||
const snapStates = useSnapshot(states);
|
const snapStates = useSnapshot(states);
|
||||||
const homeIterator = useRef();
|
const homeIterator = useRef();
|
||||||
|
|
Loading…
Add table
Reference in a new issue