@common-stack/frontend-stack-react 4.0.2-alpha.16 → 4.0.2-alpha.17

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.
@@ -1,29 +1,12 @@
1
- import*as React from'react';import {Error500}from'@admin-layout/ant-ui';import {useRouteError,isRouteErrorResponse}from'@remix-run/react';import {Navigate}from'react-router-dom';function ErrorBoundary() {
1
+ import*as React from'react';import {Error500}from'@admin-layout/ant-ui';import {useRouteError,isRouteErrorResponse}from'@remix-run/react';function ErrorBoundary() {
2
2
  const error = useRouteError();
3
- const [hasAccountNotFoundError, setHasAccountNotFoundError] = React.useState(false);
4
- const [isLoading, setIsLoading] = React.useState(true);
5
- React.useEffect(() => {
6
- console.trace(error);
7
- if (isRouteErrorResponse(error)) {
8
- const data = error?.data;
9
- if (data?.graphQLErrors?.length) {
10
- const graphqlError = data?.graphQLErrors[0];
11
- if (graphqlError.type === 'ACCOUNT_NOT_FOUND') {
12
- setHasAccountNotFoundError(true);
13
- }
14
- }
15
- }
16
- setIsLoading(false);
17
- }, [error]);
18
- if (!isLoading) {
19
- if (isRouteErrorResponse(error)) {
20
- return hasAccountNotFoundError ? (React.createElement(Navigate, { to: "/verify-user" })) : (React.createElement(Error500, { title: error.statusText, status: error.status, data: error.data }));
21
- }
22
- else if (error instanceof Error) {
23
- return React.createElement(Error500, { title: error.message, status: "500", data: error.stack });
24
- }
25
- else {
26
- return React.createElement(Error500, { title: "Unknown Error", status: "500", data: error });
27
- }
3
+ if (isRouteErrorResponse(error)) {
4
+ return React.createElement(Error500, { title: `Route Error: ${error.statusText}`, status: error.status, data: error.data });
5
+ }
6
+ else if (error instanceof Error) {
7
+ return React.createElement(Error500, { title: error.message, status: "500", data: error.stack });
8
+ }
9
+ else {
10
+ return React.createElement(Error500, { title: "Unknown Error", status: "500", data: error });
28
11
  }
29
12
  }export{ErrorBoundary};
@@ -1,4 +1,4 @@
1
- import'reflect-metadata';import*as React from'react';import {Outlet,json,useLoaderData,Meta,Links,ScrollRestoration,Scripts}from'@remix-run/react';import publicEnv from'@src/frontend-stack-react/config/public-config';import {PluginArea}from'@common-stack/client-react';import {subscribeReduxRouter}from'@common-stack/remix-router-redux';import {ApplicationErrorHandler}from'@admin-layout/ant-ui';import {ConfigProvider}from'antd';import clientModules,{plugins}from'@app/frontend-stack-react/modules.js';import {useChangeLanguage}from'remix-i18next/react';import {useTranslation}from'react-i18next';import {i18nextInstance}from'@app/frontend-stack-react/i18n-localization/i18next.server.js';export{ErrorBoundary}from'@app/frontend-stack-react/entries/antui/components/ErrorBoundary';const loader = async ({ request }) => {
1
+ import'reflect-metadata';import*as React from'react';import {Outlet,json,useLoaderData,Meta,Links,ScrollRestoration,Scripts}from'@remix-run/react';import publicEnv from'@src/config/public-config';import {PluginArea}from'@common-stack/client-react';import {subscribeReduxRouter}from'@common-stack/remix-router-redux';import {ApplicationErrorHandler}from'@admin-layout/ant-ui';import {ConfigProvider}from'antd';import clientModules,{plugins}from'@app/frontend-stack-react/modules.js';import {useChangeLanguage}from'remix-i18next/react';import {useTranslation}from'react-i18next';import {i18nextInstance}from'@app/frontend-stack-react/i18n-localization/i18next.server.js';export{ErrorBoundary}from'@app/frontend-stack-react/entries/antui/components/ErrorBoundary';const loader = async ({ request }) => {
2
2
  const locale = await i18nextInstance.getLocale(request);
3
3
  return json({
4
4
  __ENV__: publicEnv,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/frontend-stack-react",
3
- "version": "4.0.2-alpha.16",
3
+ "version": "4.0.2-alpha.17",
4
4
  "description": "Client Module for react app",
5
5
  "homepage": "https://github.com/cdmbase/fullstack-pro#readme",
6
6
  "bugs": {
@@ -30,8 +30,8 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@chakra-ui/react": "^2.8.2",
33
- "@common-stack/client-react": "4.0.2-alpha.14",
34
- "@common-stack/core": "4.0.2-alpha.14",
33
+ "@common-stack/client-react": "4.0.2-alpha.17",
34
+ "@common-stack/core": "0.0.1",
35
35
  "i18next-browser-languagedetector": "^8.0.0",
36
36
  "i18next-fs-backend": "^2.3.1",
37
37
  "i18next-http-backend": "^2.5.2",
@@ -56,5 +56,5 @@
56
56
  "typescript": {
57
57
  "definition": "lib/index.d.ts"
58
58
  },
59
- "gitHead": "08f17f17f1c026e44e0ff34656026c4c230c8778"
59
+ "gitHead": "6d511478843a4558f742cf4c4cb1e0e196d38d3a"
60
60
  }