From a8cbc514b0d3107c2831c4af313e536b52f2c370 Mon Sep 17 00:00:00 2001 From: Hamza El Gatia Date: Fri, 2 Feb 2024 16:29:15 +0100 Subject: [PATCH] feat: add LoaderToastNotifier --- .../stock/src/screens/loader/LoaderScreen.js | 6 +- .../core/src/app/ContextedApplication.tsx | 2 + .../templates/Loader/LoaderContext.tsx | 203 ++++++++++++++++-- .../templates/Loader/LoaderPopup.tsx | 5 +- .../templates/Loader/LoaderToastNotifier.tsx | 80 +++++++ .../src/components/templates/Loader/index.ts | 3 +- .../templates/Loader/use-loader-listener.ts | 99 ++++----- 7 files changed, 317 insertions(+), 81 deletions(-) create mode 100644 packages/core/src/components/templates/Loader/LoaderToastNotifier.tsx diff --git a/packages/apps/stock/src/screens/loader/LoaderScreen.js b/packages/apps/stock/src/screens/loader/LoaderScreen.js index f3693e46b7..6c1ef2fbb2 100644 --- a/packages/apps/stock/src/screens/loader/LoaderScreen.js +++ b/packages/apps/stock/src/screens/loader/LoaderScreen.js @@ -37,7 +37,7 @@ import React, {useState} from 'react'; import {View} from 'react-native'; import {Button, Screen} from '@axelor/aos-mobile-ui'; -import {LoaderPopup} from '@axelor/aos-mobile-core'; +import {LoaderPopup, useLoader} from '@axelor/aos-mobile-core'; // Screen for test Loader functionnalities const LoaderScreen = () => { @@ -60,13 +60,15 @@ const LoaderScreen = () => { console.log('Error action executed!'); }; + const {loading} = useLoader(); + return (