..
This commit is contained in:
@@ -34,6 +34,7 @@ import { useUserFindAuthMethodMutation } from '@/entities/user/api/use-user-find
|
||||
import { useCodesSelectMutation } from '@/entities/common/api/use-codes-select-mutation';
|
||||
import { MenuItems } from '@/entities/common/model/constant';
|
||||
import { AlarmLinkOptions } from '@/entities/alarm/model/types';
|
||||
import { AlarmRoutes } from '@/entities/alarm/ui/alarm-routes';
|
||||
|
||||
export interface ContextType {
|
||||
setOnBack: (onBack: () => void) => void;
|
||||
@@ -73,6 +74,8 @@ export const SubLayout = () => {
|
||||
const [headerNavigationKey, setHeaderNavigationKey] = useState<number>(1);
|
||||
const [loginSuccess, setLoginSuccess] = useState<boolean>(false);
|
||||
const [mid, setMid] = useState<string>();
|
||||
const [alarmRoutesOn, setAlarmRoutesOn] = useState<boolean>(false);
|
||||
const [alarmOptions, setAlarmOptions] = useState<AlarmLinkOptions>();
|
||||
|
||||
const { isNativeEnvironment } = useAppBridge();
|
||||
const { mutateAsync: homeGroups } = useHomeGroupsMutation();
|
||||
@@ -328,6 +331,10 @@ export const SubLayout = () => {
|
||||
};
|
||||
const alarmLink = (options: AlarmLinkOptions) => {
|
||||
console.log(options);
|
||||
if(options?.linkUrl){
|
||||
setAlarmRoutesOn(true);
|
||||
setAlarmOptions(options);
|
||||
}
|
||||
};
|
||||
|
||||
window.saveToken = saveToken;
|
||||
@@ -380,6 +387,11 @@ export const SubLayout = () => {
|
||||
setFavoriteEdit={ setFavoriteEdit }
|
||||
></FooterNavigation>
|
||||
}
|
||||
{ alarmRoutesOn &&
|
||||
<AlarmRoutes
|
||||
options={ alarmOptions }
|
||||
></AlarmRoutes>
|
||||
}
|
||||
|
||||
</Fragment>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user