2026-08-02 19:33:13 -04:00
|
|
|
import { useMatch } from 'react-router';
|
2024-05-31 19:49:46 +05:30
|
|
|
import {
|
|
|
|
|
getHomeCreatePath,
|
|
|
|
|
getHomeJoinPath,
|
|
|
|
|
getHomePath,
|
|
|
|
|
getHomeSearchPath,
|
|
|
|
|
} from '../../pages/pathUtils';
|
|
|
|
|
|
|
|
|
|
export const useHomeSelected = (): boolean => {
|
|
|
|
|
const homeMatch = useMatch({
|
|
|
|
|
path: getHomePath(),
|
|
|
|
|
caseSensitive: true,
|
|
|
|
|
end: false,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return !!homeMatch;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const useHomeCreateSelected = (): boolean => {
|
|
|
|
|
const match = useMatch({
|
|
|
|
|
path: getHomeCreatePath(),
|
|
|
|
|
caseSensitive: true,
|
|
|
|
|
end: false,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return !!match;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const useHomeJoinSelected = (): boolean => {
|
|
|
|
|
const match = useMatch({
|
|
|
|
|
path: getHomeJoinPath(),
|
|
|
|
|
caseSensitive: true,
|
|
|
|
|
end: false,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return !!match;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const useHomeSearchSelected = (): boolean => {
|
|
|
|
|
const match = useMatch({
|
|
|
|
|
path: getHomeSearchPath(),
|
|
|
|
|
caseSensitive: true,
|
|
|
|
|
end: false,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return !!match;
|
|
|
|
|
};
|