Skip to content

Commit

Permalink
Explore page for mods
Browse files Browse the repository at this point in the history
  • Loading branch information
tzarebczan committed Nov 1, 2024
1 parent 64b4300 commit a03d844
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ui/component/router/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { connect } from 'react-redux';
import * as SETTINGS from 'constants/settings';
import * as PAGES from 'constants/pages';
import { selectUserVerifiedEmail } from 'redux/selectors/user';
import { selectUserVerifiedEmail, selectUser } from 'redux/selectors/user';
import { selectHasNavigated, selectScrollStartingPosition } from 'redux/selectors/app';
import { selectClientSetting, selectHomepageData, selectWildWestDisabled } from 'redux/selectors/settings';
import Router from './view';
Expand Down Expand Up @@ -32,6 +32,7 @@ const select = (state, props) => {
title: selectTitleForUri(state, uri),
currentScroll: selectScrollStartingPosition(state),
isAuthenticated: selectUserVerifiedEmail(state),
isGlobalMod: Boolean(selectUser(state)?.global_mod),
hasNavigated: selectHasNavigated(state),
hasUnclaimedRefereeReward: selectHasUnclaimedRefereeReward(state),
homepageData: selectHomepageData(state),
Expand Down
4 changes: 3 additions & 1 deletion ui/component/router/view.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ type Props = {
hideTitleNotificationCount: boolean,
hasDefaultChannel: boolean,
doSetActiveChannel: (claimId: ?string, override?: boolean) => void,
isGlobalMod: boolean,
};

type PrivateRouteProps = Props & {
Expand Down Expand Up @@ -222,6 +223,7 @@ function AppRouter(props: Props) {
hideTitleNotificationCount,
hasDefaultChannel,
doSetActiveChannel,
isGlobalMod,
} = props;

const defaultChannelRef = React.useRef(hasDefaultChannel);
Expand Down Expand Up @@ -369,7 +371,7 @@ function AppRouter(props: Props) {

<Route path={`/`} exact component={HomePage} />

{tagParams && <Route path={`/$/${PAGES.DISCOVER}`} exact component={DiscoverPage} />}
{(tagParams || isGlobalMod) && <Route path={`/$/${PAGES.DISCOVER}`} exact component={DiscoverPage} />}
{categoryPages}

<Route path={`/$/${PAGES.AUTH_SIGNIN}`} exact component={SignInPage} />
Expand Down

0 comments on commit a03d844

Please sign in to comment.