@ludo.ninja/components 2.1.1 → 2.1.3

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.
@@ -69,7 +69,7 @@ const useFetchMyExperienceWithLevel = () => {
69
69
  router.push(`/rewards/${userId}`);
70
70
  }
71
71
  else {
72
- window.open(`${domain}/rewards/${userId}`);
72
+ window.open(`${domain}/rewards/${userId}`, '_self');
73
73
  }
74
74
  },
75
75
  }));
@@ -33,7 +33,7 @@ const Subscription = () => {
33
33
  router.push(`/invite-codes`);
34
34
  }
35
35
  else {
36
- window.open(`${domain}/invite-codes`);
36
+ window.open(`${domain}/invite-codes`, '_self');
37
37
  }
38
38
  },
39
39
  }));
@@ -0,0 +1,2 @@
1
+ declare const Page404: () => import("react/jsx-runtime").JSX.Element;
2
+ export default Page404;
@@ -0,0 +1,75 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const router_1 = require("next/router");
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const _404_svg_1 = __importDefault(require("../../public/404/404"));
10
+ const colors_1 = require("@ludo.ninja/ui/build/styles/colors");
11
+ const ScreenWidth_1 = require("../../styles/ScreenWidth");
12
+ const mainLayout_1 = __importDefault(require("../../layouts/custom/mainLayout"));
13
+ const MainButton_1 = __importDefault(require("../../system/Buttons/MainButton"));
14
+ const index_1 = require("../../system/index");
15
+ const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
16
+ const env_1 = require("../../store/env");
17
+ // Styles
18
+ const StyledNotFoundPage = styled_components_1.default.div `
19
+ .notFoundContent {
20
+ .notFoundCaption {
21
+ font-weight: 700;
22
+ font-size: 3.8em;
23
+ line-height: 1.37em;
24
+ color: ${colors_1.TextGrayColor};
25
+ margin-bottom: 0;
26
+ }
27
+
28
+ .notFoundIcon {
29
+ width: 337px;
30
+ height: 329px;
31
+ }
32
+
33
+ ${ScreenWidth_1.mediaQuery.tablet} {
34
+ flex-direction: column-reverse;
35
+
36
+ .notFoundText {
37
+ margin: 40px 0 0 0;
38
+ text-align: center;
39
+ }
40
+
41
+ .notFoundIcon {
42
+ width: 286px;
43
+ height: 280px;
44
+ }
45
+
46
+ .notFoundCaption {
47
+ font-size: 3em;
48
+ line-height: 1.6em;
49
+ }
50
+ }
51
+
52
+ ${ScreenWidth_1.mediaQuery.phone} {
53
+ .notFoundIcon {
54
+ width: 218px;
55
+ height: 212px;
56
+ }
57
+ }
58
+ }
59
+ `;
60
+ // Component
61
+ const Page404 = () => {
62
+ const router = (0, router_1.useRouter)();
63
+ const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
64
+ const redirectToHomePage = () => {
65
+ const appDomain = ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"];
66
+ if (window.origin === appDomain) {
67
+ router.push("/");
68
+ }
69
+ else {
70
+ window.open(appDomain, '_self');
71
+ }
72
+ };
73
+ return ((0, jsx_runtime_1.jsx)(mainLayout_1.default, { children: (0, jsx_runtime_1.jsx)(StyledNotFoundPage, { children: (0, jsx_runtime_1.jsxs)(index_1.Flex, { className: "notFoundContent", justifyContent: "center", alignItems: "center", children: [(0, jsx_runtime_1.jsxs)(index_1.Box, { mr: 140, className: "notFoundText", children: [(0, jsx_runtime_1.jsxs)("h1", { className: "notFoundCaption", children: ["Whoops! ", (0, jsx_runtime_1.jsx)("br", {}), " No results found"] }), (0, jsx_runtime_1.jsx)(index_1.Box, { mt: "36px", children: (0, jsx_runtime_1.jsx)(MainButton_1.default, { onClick: redirectToHomePage, variant: "primaryL", text: "Go to Main page" }) })] }), (0, jsx_runtime_1.jsx)(index_1.Box, { children: (0, jsx_runtime_1.jsx)("div", { className: "notFoundIcon", children: (0, jsx_runtime_1.jsx)(_404_svg_1.default, {}) }) })] }) }) }));
74
+ };
75
+ exports.default = Page404;
@@ -0,0 +1,2 @@
1
+ declare const InternalErrorPage: () => import("react/jsx-runtime").JSX.Element;
2
+ export default InternalErrorPage;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const router_1 = require("next/router");
8
+ const styled_components_1 = __importDefault(require("styled-components"));
9
+ const index_1 = require("../../system/index");
10
+ const _500_svg_1 = __importDefault(require("../../public/500/500"));
11
+ const colors_1 = require("@ludo.ninja/ui/build/styles/colors");
12
+ const ScreenWidth_1 = require("../../styles/ScreenWidth");
13
+ const mainLayout_1 = __importDefault(require("../../layouts/custom/mainLayout"));
14
+ const MainButton_1 = __importDefault(require("../../system/Buttons/MainButton"));
15
+ const env_1 = require("../../store/env");
16
+ const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
17
+ // Styles
18
+ const StyledInternalErrorPage = styled_components_1.default.div `
19
+ .internalErrorContent {
20
+ .internalErrorButton {
21
+ max-width: 230px;
22
+ }
23
+
24
+ .internalErrorCaption {
25
+ font-weight: 700;
26
+ font-size: 3.8em;
27
+ line-height: 1.37em;
28
+ color: ${colors_1.TextGrayColor};
29
+ margin-bottom: 0;
30
+ }
31
+
32
+ .internalErrorIcon {
33
+ width: 337px;
34
+ height: 329px;
35
+ }
36
+
37
+ ${ScreenWidth_1.mediaQuery.tablet} {
38
+ flex-direction: column-reverse;
39
+
40
+ .internalErrorText {
41
+ margin: 40px 0 0 0;
42
+ text-align: center;
43
+ }
44
+
45
+ .internalErrorIcon {
46
+ width: 286px;
47
+ height: 280px;
48
+ }
49
+
50
+ .internalErrorCaption {
51
+ font-size: 3em;
52
+ line-height: 1.6em;
53
+ }
54
+
55
+ .internalErrorButton {
56
+ margin: 30px auto 0 auto;
57
+ }
58
+ }
59
+
60
+ ${ScreenWidth_1.mediaQuery.phone} {
61
+ .internalErrorIcon {
62
+ width: 218px;
63
+ height: 212px;
64
+ }
65
+ }
66
+ }
67
+ `;
68
+ // Component
69
+ const InternalErrorPage = () => {
70
+ const router = (0, router_1.useRouter)();
71
+ const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
72
+ const redirectToHomePage = () => {
73
+ const appDomain = ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"];
74
+ if (window.origin === appDomain) {
75
+ router.push("/");
76
+ }
77
+ else {
78
+ window.open(appDomain, '_self');
79
+ }
80
+ };
81
+ return ((0, jsx_runtime_1.jsx)(mainLayout_1.default, { children: (0, jsx_runtime_1.jsx)(StyledInternalErrorPage, { children: (0, jsx_runtime_1.jsxs)(index_1.Flex, { className: "internalErrorContent", justifyContent: "center", alignItems: "center", children: [(0, jsx_runtime_1.jsxs)(index_1.Box, { mr: [97], className: "internalErrorText", children: [(0, jsx_runtime_1.jsx)("h1", { className: "internalErrorCaption", children: "Sorry, unexpected error." }), (0, jsx_runtime_1.jsxs)(index_1.H1, { color: colors_1.TextGrayColor, mt: [14], children: ["We are working on fixing the problem.", (0, jsx_runtime_1.jsx)("br", {}), " Please try again later"] }), (0, jsx_runtime_1.jsx)(index_1.Box, { className: "internalErrorButton", mt: [36], children: (0, jsx_runtime_1.jsx)(MainButton_1.default, { onClick: redirectToHomePage, variant: "primaryL", text: "Go to Main page" }) })] }), (0, jsx_runtime_1.jsx)(index_1.Box, { children: (0, jsx_runtime_1.jsx)("div", { className: "internalErrorIcon", children: (0, jsx_runtime_1.jsx)(_500_svg_1.default, {}) }) })] }) }) }));
82
+ };
83
+ exports.default = InternalErrorPage;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from "react";
2
+ import { AppProps } from "next/app";
3
+ export declare const AppLayout: ({ children, pageProps }: {
4
+ children: ReactNode;
5
+ pageProps: AppProps["pageProps"];
6
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.AppLayout = void 0;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const styled_components_1 = require("styled-components");
9
+ const browser_1 = __importDefault(require("@marker.io/browser"));
10
+ const utils_1 = require("@ludo.ninja/utils");
11
+ const react_1 = require("react");
12
+ const ui_1 = require("../store/ui");
13
+ const client_1 = require("@apollo/client");
14
+ const apollo_1 = require("../hooks/apollo");
15
+ const GlobalLayout_1 = require("./GlobalLayout");
16
+ const store_1 = require("../modules/user/store");
17
+ const index_1 = require("../store/index");
18
+ const env_1 = require("../store/env");
19
+ const AppLayout = ({ children, pageProps }) => {
20
+ const apolloClient = (0, apollo_1.useApollo)(pageProps);
21
+ const theme = (0, ui_1.useUiStore)((state) => state.theme);
22
+ const NODE_ENV = (0, env_1.useEnvStore)(state => state.NODE_ENV);
23
+ (0, react_1.useEffect)(() => {
24
+ if (!utils_1.isServer && NODE_ENV === "production") {
25
+ browser_1.default.loadWidget({ project: "65f2e310e9298c9dca4d4ca9" });
26
+ }
27
+ }, []);
28
+ return ((0, jsx_runtime_1.jsx)(index_1.SSRProvider, { initialState: {
29
+ isMobile: pageProps.isMobile,
30
+ }, children: (0, jsx_runtime_1.jsx)(client_1.ApolloProvider, { client: apolloClient, children: (0, jsx_runtime_1.jsx)(styled_components_1.ThemeProvider, { theme: theme, children: (0, jsx_runtime_1.jsx)(store_1.UserProvider, { initialState: {
31
+ user: pageProps.userData,
32
+ isSignedIn: !!pageProps.userData,
33
+ }, children: (0, jsx_runtime_1.jsx)(GlobalLayout_1.GlobalLayout, { children: children }) }) }) }) }));
34
+ };
35
+ exports.AppLayout = AppLayout;
@@ -129,7 +129,7 @@ const CreationCard = ({ creationName, creation, isNeedHeight, likesDynamicInfo,
129
129
  // if (domain === window.origin) {
130
130
  // router.push(`/rewards/${userId}`);
131
131
  // } else {
132
- // window.open(`${domain}/rewards/${userId}`);
132
+ // window.open(`${domain}/rewards/${userId}`,'_self');
133
133
  // }
134
134
  return ((0, jsx_runtime_1.jsxs)(StyledRegularCard, { isNeedHeight: isNeedHeight, isNeedTransform: isNeedShowMoreButton, isShowCheckbox: isShowCheckbox, children: [isShowCheckbox && ((0, jsx_runtime_1.jsx)(CardCheckbox_1.default, { isActiveCheckbox: !!isActiveCheckbox, onChange: () => {
135
135
  toggleCreationToGallery?.(creation);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.1.1",
3
+ "version": "2.1.3",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",