mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-08 21:18:14 -05:00
20 lines
620 B
TypeScript
20 lines
620 B
TypeScript
import { useSelector } from '@xstate/react';
|
|
import { useContext } from 'react';
|
|
import {
|
|
selectAuthorized,
|
|
selectLanguagesetup,
|
|
selectUnauthorized,
|
|
} from '../machines/auth';
|
|
import { GlobalContext } from '../shared/GlobalContext';
|
|
|
|
export function useAppLayout() {
|
|
const { appService } = useContext(GlobalContext);
|
|
const authService = appService.children.get('auth');
|
|
const isLanguagesetup = useSelector(authService, selectLanguagesetup);
|
|
return {
|
|
isAuthorized: useSelector(authService, selectAuthorized),
|
|
isUnAuthorized: useSelector(authService, selectUnauthorized),
|
|
isLanguagesetup,
|
|
};
|
|
}
|