@tripian/react 5.0.32 → 5.0.33
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.
|
@@ -6,11 +6,12 @@ interface IFormTemplateLogin {
|
|
|
6
6
|
reCaptchaSiteKey: string;
|
|
7
7
|
showCaptcha: boolean;
|
|
8
8
|
forgotPassword: () => void;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
socialLoginConfigs: {
|
|
10
|
+
clientId: string;
|
|
11
|
+
domain: string;
|
|
12
|
+
identityProviders: string[];
|
|
11
13
|
region: string;
|
|
12
14
|
baseDomain: string;
|
|
13
|
-
clientId: string;
|
|
14
15
|
};
|
|
15
16
|
showRegister?: boolean;
|
|
16
17
|
signUpButtonCallBack: () => void;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
declare type Props = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
configs: {
|
|
4
|
+
clientId: string;
|
|
5
|
+
domain: string;
|
|
6
|
+
identityProviders: string[];
|
|
7
|
+
region: string;
|
|
8
|
+
baseDomain: string;
|
|
9
|
+
};
|
|
7
10
|
};
|
|
8
11
|
declare const SocialLogin: React.FC<Props>;
|
|
9
12
|
export default SocialLogin;
|
package/index.js
CHANGED
|
@@ -61397,7 +61397,7 @@ var SocialLogin_1 = __importDefault(__webpack_require__(596));
|
|
|
61397
61397
|
var ButtonTypes_1 = __importDefault(__webpack_require__(28));
|
|
61398
61398
|
var EyeIconButton_1 = __importDefault(__webpack_require__(95));
|
|
61399
61399
|
var FormTemplateLogin = function (_a) {
|
|
61400
|
-
var login = _a.login, successLogin = _a.successLogin, reCaptchaSiteKey = _a.reCaptchaSiteKey, _b = _a.showCaptcha, showCaptcha = _b === void 0 ? true : _b, forgotPassword = _a.forgotPassword,
|
|
61400
|
+
var login = _a.login, successLogin = _a.successLogin, reCaptchaSiteKey = _a.reCaptchaSiteKey, _b = _a.showCaptcha, showCaptcha = _b === void 0 ? true : _b, forgotPassword = _a.forgotPassword, socialLoginConfigs = _a.socialLoginConfigs, showRegister = _a.showRegister, signUpButtonCallBack = _a.signUpButtonCallBack;
|
|
61401
61401
|
var _c = (0, react_1.useState)(undefined), error = _c[0], setError = _c[1];
|
|
61402
61402
|
var _d = (0, react_1.useState)(false), loading = _d[0], setLoading = _d[1];
|
|
61403
61403
|
var _e = (0, react_1.useState)(), recaptchaVerified = _e[0], setRecaptchaVerified = _e[1];
|
|
@@ -61495,10 +61495,11 @@ var FormTemplateLogin = function (_a) {
|
|
|
61495
61495
|
react_1.default.createElement("div", { className: "mx2 mt2 mb5" },
|
|
61496
61496
|
react_1.default.createElement("span", { className: "login-text" }, "Don`t have an account?"),
|
|
61497
61497
|
react_1.default.createElement(Button_1.default, { className: "login-custom-button", text: "Sign Up", color: "primary", type: ButtonTypes_1.default.TEXT, onClick: signUpButtonCallBack })),
|
|
61498
|
-
react_1.default.createElement(
|
|
61499
|
-
react_1.default.createElement("
|
|
61500
|
-
react_1.default.createElement("
|
|
61501
|
-
|
|
61498
|
+
(socialLoginConfigs.identityProviders.includes('Google') || socialLoginConfigs.identityProviders.includes('SignInWithApple')) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
61499
|
+
react_1.default.createElement("div", { className: "center px2 mb8" },
|
|
61500
|
+
react_1.default.createElement("h6", { className: FormTemplateLogin_scss_1.default.horizontalLine },
|
|
61501
|
+
react_1.default.createElement("span", null, "OR"))),
|
|
61502
|
+
react_1.default.createElement(SocialLogin_1.default, { configs: socialLoginConfigs })))))));
|
|
61502
61503
|
};
|
|
61503
61504
|
exports.default = FormTemplateLogin;
|
|
61504
61505
|
|
|
@@ -61526,16 +61527,16 @@ var Apple_1 = __importDefault(__webpack_require__(597));
|
|
|
61526
61527
|
var Google_1 = __importDefault(__webpack_require__(598));
|
|
61527
61528
|
var SocialLogin_scss_1 = __importDefault(__webpack_require__(599));
|
|
61528
61529
|
var SocialLogin = function (_a) {
|
|
61529
|
-
var
|
|
61530
|
+
var configs = _a.configs;
|
|
61530
61531
|
return (react_1.default.createElement("div", { className: SocialLogin_scss_1.default.socialLoginButtons },
|
|
61531
|
-
react_1.default.createElement("a", { className: SocialLogin_scss_1.default.googleButton, href: "https://".concat(
|
|
61532
|
+
configs.identityProviders.includes('Google') && (react_1.default.createElement("a", { className: SocialLogin_scss_1.default.googleButton, href: "https://".concat(configs.domain, ".auth.").concat(configs.region, ".amazoncognito.com/oauth2/authorize?identity_provider=Google&redirect_uri=").concat(configs.baseDomain, "/cognito-redirect&response_type=CODE&client_id=").concat(configs.clientId) },
|
|
61532
61533
|
react_1.default.createElement("div", { className: SocialLogin_scss_1.default.socialLoginLogo },
|
|
61533
61534
|
react_1.default.createElement(Google_1.default, null)),
|
|
61534
|
-
react_1.default.createElement("span", { className: SocialLogin_scss_1.default.socialLoginText }, "Continue with Google")),
|
|
61535
|
-
react_1.default.createElement("a", { className: SocialLogin_scss_1.default.appleButton, href: "https://".concat(
|
|
61535
|
+
react_1.default.createElement("span", { className: SocialLogin_scss_1.default.socialLoginText }, "Continue with Google"))),
|
|
61536
|
+
configs.identityProviders.includes('SignInWithApple') && (react_1.default.createElement("a", { className: SocialLogin_scss_1.default.appleButton, href: "https://".concat(configs.domain, ".auth.").concat(configs.region, ".amazoncognito.com/oauth2/authorize?identity_provider=SignInWithApple&redirect_uri=").concat(configs.baseDomain, "/cognito-redirect&response_type=CODE&client_id=").concat(configs.clientId) },
|
|
61536
61537
|
react_1.default.createElement("div", { className: SocialLogin_scss_1.default.socialLoginLogo },
|
|
61537
61538
|
react_1.default.createElement(Apple_1.default, null)),
|
|
61538
|
-
react_1.default.createElement("span", { className: SocialLogin_scss_1.default.socialLoginText }, "Continue with Apple"))));
|
|
61539
|
+
react_1.default.createElement("span", { className: SocialLogin_scss_1.default.socialLoginText }, "Continue with Apple")))));
|
|
61539
61540
|
};
|
|
61540
61541
|
exports.default = SocialLogin;
|
|
61541
61542
|
|