mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-05 06:50:28 +03:00
28 lines
619 B
TypeScript
28 lines
619 B
TypeScript
import { useMatch, useParams } from 'react-router-dom';
|
|
import { getExploreFeaturedPath, getExplorePath } from '../../pages/pathUtils';
|
|
|
|
export const useExploreSelected = (): boolean => {
|
|
const match = useMatch({
|
|
path: getExplorePath(),
|
|
caseSensitive: true,
|
|
end: false,
|
|
});
|
|
|
|
return !!match;
|
|
};
|
|
|
|
export const useExploringFeaturedRooms = (): boolean => {
|
|
const match = useMatch({
|
|
path: getExploreFeaturedPath(),
|
|
caseSensitive: true,
|
|
end: false,
|
|
});
|
|
|
|
return !!match;
|
|
};
|
|
|
|
export const useExploreServer = (): string | undefined => {
|
|
const { server } = useParams();
|
|
|
|
return server;
|
|
};
|