react-gldn-kit 0.1.103 → 0.1.105

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.
@@ -47,7 +47,8 @@ var styles = __importStar(require("./GoogleLoginButton.module.css"));
47
47
  var selectors_2 = require("zustandStore/settings/selectors");
48
48
  var store_2 = require("zustandStore/settings/store");
49
49
  var GoogleLoginButton = function () {
50
- var useGoogleAuth = (0, ModalContext_1.useHookProvider)().useGoogleAuth;
50
+ var googleAuth = (0, ModalContext_1.useHookProvider)().googleAuth;
51
+ var googlePath = googleAuth.googlePath, useGoogleAuth = googleAuth.useGoogleAuth;
51
52
  var activeLanguage = (0, store_1.useZustandLanguagesKitStore)(selectors_1.languageSelectors.getActiveLanguageNameKitSelector);
52
53
  var appType = (0, store_2.useZustandKitSettings)(selectors_2.getKitAppTypeSelector);
53
54
  var _a = (0, useHookFabric_1.useHookFabric)({
@@ -55,14 +56,14 @@ var GoogleLoginButton = function () {
55
56
  customProps: {
56
57
  appType: appType,
57
58
  adapter: utils_1.getAuthorizationData,
58
- // path
59
+ path: googlePath,
59
60
  language: activeLanguage,
60
61
  },
61
62
  }), onSuccess = _a.onSuccess, status = _a.status;
62
- return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.wrapperButton }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: styles.hiddenButton }, { children: (0, jsx_runtime_1.jsx)(google_1.GoogleLogin, { onSuccess: onSuccess,
63
+ return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.wrapperButton }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: styles.hiddenButton }, { children: (0, jsx_runtime_1.jsx)(google_1.GoogleLogin, { ux_mode: "popup", onSuccess: onSuccess,
63
64
  // handleTokenResponse
64
65
  onError: function () {
65
- console.log('❌ Login Failed');
66
+ console.error('❌ Login Failed');
66
67
  } }) })), (0, jsx_runtime_1.jsx)(SocialButton_1.SocialButton, { title: "socialTabs.Google", Icon: (0, jsx_runtime_1.jsx)(GoogleSvg_1.GoogleSvg, { width: "28", height: "29" }), handleClick: console.info })] })));
67
68
  };
68
69
  exports.default = GoogleLoginButton;
@@ -47,7 +47,12 @@ var styles = __importStar(require("./SocialButtons.module.css"));
47
47
  var ModalContext_1 = require("context/logic/ModalContext");
48
48
  var SocialButtons = function (_a) {
49
49
  var social = _a.social, wrapperClasses = _a.wrapperClasses;
50
- var googleClientId = (0, ModalContext_1.useHookProvider)().googleClientId;
51
- return ((0, jsx_runtime_1.jsx)(google_1.GoogleOAuthProvider, __assign({ clientId: googleClientId }, { children: (0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.wrapperSocialButtons }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.socialButtons, wrapperClasses) }, { children: social.includes('Google') && (0, jsx_runtime_1.jsx)(GoogleLoginButon_1.default, {}) })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.row }, { children: [(0, jsx_runtime_1.jsx)("div", { className: styles.line }), (0, jsx_runtime_1.jsx)("div", __assign({ className: styles.or }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: "socialTabs.or" }) })), (0, jsx_runtime_1.jsx)("div", { className: styles.line })] }))] })) })));
50
+ var googleAuth = (0, ModalContext_1.useHookProvider)().googleAuth;
51
+ console.warn('🚀 ~ SocialButtons ~ googleAuth:', googleAuth);
52
+ if (!googleAuth.googleClientId) {
53
+ // Notice: temporary solution
54
+ return null;
55
+ }
56
+ return ((0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.wrapperSocialButtons }, { children: [(0, jsx_runtime_1.jsx)("div", __assign({ className: (0, classnames_1.default)(styles.socialButtons, wrapperClasses) }, { children: social.includes('Google') && googleAuth.googleClientId && ((0, jsx_runtime_1.jsx)(google_1.GoogleOAuthProvider, __assign({ clientId: googleAuth.googleClientId }, { children: (0, jsx_runtime_1.jsx)(GoogleLoginButon_1.default, {}) }))) })), (0, jsx_runtime_1.jsxs)("div", __assign({ className: styles.row }, { children: [(0, jsx_runtime_1.jsx)("div", { className: styles.line }), (0, jsx_runtime_1.jsx)("div", __assign({ className: styles.or }, { children: (0, jsx_runtime_1.jsx)(Text_1.Text, { idT: "socialTabs.or" }) })), (0, jsx_runtime_1.jsx)("div", { className: styles.line })] }))] })));
52
57
  };
53
58
  exports.SocialButtons = SocialButtons;
@@ -4,13 +4,16 @@ type HookContextType = {
4
4
  useTransportControllers: () => any;
5
5
  useCurrencies: () => null | CurrencyInfo[];
6
6
  useCountryInfo: () => any;
7
- useGoogleAuth: () => any;
8
7
  registrationLastStep: (data: {
9
8
  promo: string;
10
9
  currencyId: number;
11
10
  }) => any;
12
11
  sendRegistrationCommand: (key: string, data: any) => any;
13
- googleClientId?: string;
12
+ googleAuth: {
13
+ useGoogleAuth: () => any;
14
+ googleClientId?: string;
15
+ googlePath?: string;
16
+ };
14
17
  };
15
18
  export declare const HookProvider: import("react").Provider<HookContextType>;
16
19
  export declare const useHookProvider: () => HookContextType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-gldn-kit",
3
- "version": "0.1.103",
3
+ "version": "0.1.105",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "keywords": [],
@@ -41,7 +41,7 @@
41
41
  "postcss-loader": "^8.1.1",
42
42
  "postcss-preset-env": "^10.1.2",
43
43
  "prettier": "^2.8.8",
44
- "react-render-hooks": "^0.0.76",
44
+ "react-render-hooks": "^0.0.78",
45
45
  "rimraf": "^6.0.1",
46
46
  "scheduler": "^0.25.0",
47
47
  "style-loader": "^4.0.0",