/
githubmirror
/
ydb-embedded-ui
Обзор
Документация
Войти
/
githubmirror
/
ydb-embedded-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/utils/hooks/useMetaAuth.ts
24 строки
772 B
Артём Муфазалов
feat: use uiFactory for new meta features availability (#3519)
26 фев 2026, 10:10
Не верифицирован
26 фев 2026, 10:10
d9e4980
Код
Авторство
О чём код?
import {useLocation} from 'react-router-dom'; import {checkIsHomePage} from '../../routes'; import {useEmMetaAvailable} from '../../store/reducers/capabilities/hooks'; function useMetaAuthState(path?: string) { const location = useLocation(); const isHomePage = path ? checkIsHomePage(path) : checkIsHomePage(location.pathname); const metaAuthAvailable = useEmMetaAvailable(); return {isHomePage, metaAuthAvailable}; } export function useMetaAuth(path?: string) { const {isHomePage, metaAuthAvailable} = useMetaAuthState(path); return isHomePage && metaAuthAvailable; } export function useMetaAuthUnavailable(path?: string) { const {isHomePage, metaAuthAvailable} = useMetaAuthState(path); return isHomePage && !metaAuthAvailable; }