Files
cinny/src/app/hooks/router/useInbox.ts
T
nathan 17322cc955
CI / Build & Quality Checks (pull_request) Canceled after 5m40s
CI / Trigger Desktop Build (pull_request) Canceled after 0s
removed deprecated react-router-dom, as all falls within react-router now
2026-08-02 19:33:13 -04:00

37 lines
706 B
TypeScript

import { useMatch } from 'react-router';
import {
getInboxInvitesPath,
getInboxNotificationsPath,
getInboxPath,
} from '../../pages/pathUtils';
export const useInboxSelected = (): boolean => {
const match = useMatch({
path: getInboxPath(),
caseSensitive: true,
end: false,
});
return !!match;
};
export const useInboxNotificationsSelected = (): boolean => {
const match = useMatch({
path: getInboxNotificationsPath(),
caseSensitive: true,
end: false,
});
return !!match;
};
export const useInboxInvitesSelected = (): boolean => {
const match = useMatch({
path: getInboxInvitesPath(),
caseSensitive: true,
end: false,
});
return !!match;
};