mirror of
https://github.com/fluxerapp/fluxer.git
synced 2026-11-27 04:36:25 -08:00
fix(app): mark home button selected on plutonium and pass pages (#4190)
This commit is contained in:
1 parent
cf7ae111d2
commit
fbcf7ce40b
4 files changed
+8
-3
No files matched your search
@@ -86,6 +86,11 @@ export const Routes = {
|
||||
pathname === Routes.NOTIFICATIONS ||
|
||||
pathname === Routes.YOU,
|
||||
isDMRoute: (pathname: string) => pathname.startsWith('/channels/@me'),
|
||||
isHomeRoute: (pathname: string) =>
|
||||
Routes.isDMRoute(pathname) ||
|
||||
pathname === Routes.PLUTONIUM ||
|
||||
pathname === Routes.OPERATOR_PASS ||
|
||||
Routes.isSpecialPage(pathname),
|
||||
isFavoritesRoute: (pathname: string) => pathname.startsWith('/channels/@favorites'),
|
||||
isDiscoverRoute: (pathname: string) =>
|
||||
pathname.startsWith(Routes.DISCOVER) || pathname.startsWith(Routes.LEGACY_DISCOVER),
|
||||
|
||||
@@ -60,7 +60,7 @@ export const FluxerButton = observer(() => {
|
||||
const mergedButtonRef = useMergeRefs([hoverRef, buttonRef]);
|
||||
const contextMenuOpen = useContextMenuHoverState(buttonRef, !MobileLayout.enabled);
|
||||
const location = useLocation();
|
||||
const isSelected = location.pathname.startsWith(Routes.ME) || Routes.isSpecialPage(location.pathname);
|
||||
const isSelected = Routes.isHomeRoute(location.pathname);
|
||||
const selectedChannel = SelectedChannel.selectedChannelIds.get(ME);
|
||||
const inlineDmsCollapsed = SidebarPreferences.inlineDmsCollapsed;
|
||||
const showCollapsedUnreadDmsBadge = SidebarPreferences.showCollapsedUnreadDmsBadge;
|
||||
|
||||
@@ -117,7 +117,7 @@ interface FrozenChatSkeletonPresentation {
|
||||
export const AppSkeleton = observer(({isExiting = false, onTransitionEnd, effectivePathname}: AppSkeletonProps) => {
|
||||
const location = useLocation();
|
||||
const pathname = effectivePathname ?? location.pathname;
|
||||
const isFluxerSelected = pathname.startsWith(Routes.ME) || Routes.isSpecialPage(pathname);
|
||||
const isFluxerSelected = Routes.isHomeRoute(pathname);
|
||||
const isFavoritesSelected = pathname.startsWith(Routes.FAVORITES);
|
||||
const isDiscoverySelected = Routes.isDiscoverRoute(pathname);
|
||||
const isMobile = MobileLayout.enabled;
|
||||
|
||||
@@ -170,7 +170,7 @@ function encodeRailItem(item: RememberedSkeletonGuildRailItem): Array<number> {
|
||||
|
||||
function resolveSelectedTopRowIndex(pathname: string, rail: SkeletonRailProjection): number {
|
||||
const leadingTopRowCount = flag(rail.fluxerVisible) + flag(rail.favoritesVisible);
|
||||
if ((Routes.isDMRoute(pathname) || Routes.isSpecialPage(pathname)) && rail.fluxerVisible) {
|
||||
if (Routes.isHomeRoute(pathname) && rail.fluxerVisible) {
|
||||
return 0;
|
||||
}
|
||||
if (Routes.isFavoritesRoute(pathname) && rail.favoritesVisible) {
|
||||
|
||||
Reference in new issue
Block a user