@stokr/components-library 3.0.21 → 3.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +467 -261
- package/dist/analytics/index.js +5 -1
- package/dist/api/authenticationApi.js +13 -0
- package/dist/auth/index.js +4 -2
- package/dist/components/2FA/login-with-otp-flow.js +9 -4
- package/dist/components/Footer/FooterLayout.js +98 -95
- package/dist/components/Footer/FooterMenu.js +1 -1
- package/dist/components/Header/Header.js +102 -54
- package/dist/components/MainMenu/MainMenu.js +14 -4
- package/dist/components/Modal/NewVentureModal/NewVentureModal.js +6 -2
- package/dist/components/Payment/PaymentDetailsCard.js +1 -1
- package/dist/components/VerifyEmailModal/VerifyEmailModal.js +2 -1
- package/dist/components/headerHo/HeaderHo.js +8 -5
- package/dist/components/icons/LinkIcon.js +2 -2
- package/dist/config.js +5 -21
- package/dist/constants/globalVariables.js +6 -4
- package/dist/context/Auth.js +5 -2
- package/dist/context/AuthContext.js +22 -8
- package/dist/firebase-config.js +4 -18
- package/dist/index.js +36 -5
- package/dist/model/axios.js +3 -1
- package/dist/model/axiosPublic.js +2 -2
- package/dist/routing/RouterWrapper.js +17 -0
- package/dist/routing/app-routes.js +22 -0
- package/dist/routing/navigate-app.js +36 -0
- package/dist/routing/resolve-app-href.js +149 -0
- package/dist/runtime-config.js +94 -0
- package/dist/static/country-list.json +251 -251
- package/dist/static/fonts/Ionicons/ionicons.min.css +2810 -2810
- package/dist/static/fonts/Ionicons/ionicons.min.css.js +1 -1
- package/dist/static/fonts/icomoon/selection.json +910 -910
- package/dist/static/fonts/icomoon/style.css +139 -139
- package/dist/static/images/copy_icon.svg +4 -4
- package/dist/static/images/download_icon.svg +3 -3
- package/dist/static/images/numbers/number_eight.svg +3 -3
- package/dist/static/images/numbers/number_five.svg +4 -4
- package/dist/static/images/numbers/number_four.svg +3 -3
- package/dist/static/images/numbers/number_nine.svg +4 -4
- package/dist/static/images/numbers/number_one.svg +4 -4
- package/dist/static/images/numbers/number_seven.svg +4 -4
- package/dist/static/images/numbers/number_six.svg +4 -4
- package/dist/static/images/numbers/number_three.svg +3 -3
- package/dist/static/images/numbers/number_two.svg +4 -4
- package/dist/static/images/numbers/number_zero.svg +3 -3
- package/dist/static/images/plus-icon.svg +4 -4
- package/dist/static/images/search-icon.svg +3 -3
- package/dist/static/images/transfer-icon.svg +10 -10
- package/dist/static/images/warning-filled.svg +3 -3
- package/dist/utils/app-urls-analytics-backoffice.js +30 -0
- package/dist/utils/app-urls.js +28 -0
- package/dist/utils/checklistGenerator.js +6 -5
- package/dist/utils/customHooks.js +1 -1
- package/dist/utils/formatCurrencyValue.js +2 -1
- package/dist/utils/get-cookie-domain.js +4 -1
- package/dist/utils/set-redirect-cookie.js +4 -1
- package/dist/utils/withRouter.js +5 -3
- package/package.json +1 -1
- package/dist/api/auth.js +0 -15
package/dist/utils/withRouter.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
3
|
import { useInRouterContext, useNavigate, useLocation } from "react-router-dom";
|
|
4
|
-
const noopNavigate = () => {
|
|
5
|
-
};
|
|
6
4
|
const fallbackLocation = { pathname: "/", search: "", hash: "", state: null, key: "default" };
|
|
5
|
+
const NAVIGATE_OUTSIDE_ROUTER_MSG = "[@stokr/components-library] Navigation requires a React Router context. Wrap the app root with BrowserRouter, or with RouterWrapper from this package (it adds BrowserRouter only when useInRouterContext() is false so you avoid duplicate routers in a host app).";
|
|
6
|
+
function navigateOutsideRouter() {
|
|
7
|
+
throw new Error(NAVIGATE_OUTSIDE_ROUTER_MSG);
|
|
8
|
+
}
|
|
7
9
|
const withRouter = (Component) => {
|
|
8
10
|
const InnerWithRouter = (props) => {
|
|
9
11
|
const navigate = useNavigate();
|
|
@@ -15,7 +17,7 @@ const withRouter = (Component) => {
|
|
|
15
17
|
if (inRouter) {
|
|
16
18
|
return /* @__PURE__ */ jsx(InnerWithRouter, { ...props });
|
|
17
19
|
}
|
|
18
|
-
return /* @__PURE__ */ jsx(Component, { navigate:
|
|
20
|
+
return /* @__PURE__ */ jsx(Component, { navigate: navigateOutsideRouter, location: fallbackLocation, ...props });
|
|
19
21
|
};
|
|
20
22
|
return Wrapper;
|
|
21
23
|
};
|
package/package.json
CHANGED
package/dist/api/auth.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import axiosInstance from "../model/axios.js";
|
|
2
|
-
const authAPI = async (url, data) => {
|
|
3
|
-
try {
|
|
4
|
-
const result = await axiosInstance.post(`auth/${url}`, data);
|
|
5
|
-
console.log("Success!");
|
|
6
|
-
return result;
|
|
7
|
-
} catch (error) {
|
|
8
|
-
console.log(`Error: ${error}`);
|
|
9
|
-
throw error;
|
|
10
|
-
}
|
|
11
|
-
};
|
|
12
|
-
export {
|
|
13
|
-
authAPI,
|
|
14
|
-
authAPI as default
|
|
15
|
-
};
|