|
2 | 2 |
|
3 | 3 | import "./css/index.css"; |
4 | 4 |
|
5 | | -import { applyWhiteLabelTheme, LANGUAGES, SafeEventEmitter } from "@web3auth/auth"; |
| 5 | +import { applyWhiteLabelTheme, LANGUAGES, SafeEventEmitter, THEME_MODES } from "@web3auth/auth"; |
6 | 6 | import { |
7 | 7 | type Analytics, |
8 | 8 | ANALYTICS_EVENTS, |
9 | 9 | type BaseConnectorConfig, |
10 | 10 | type ChainNamespaceType, |
11 | 11 | CONNECTOR_EVENTS, |
| 12 | + CONNECTOR_INITIAL_AUTHENTICATION_MODE, |
12 | 13 | getWhitelabelAnalyticsProperties, |
13 | 14 | type IConnectorDataEvent, |
14 | 15 | log, |
@@ -90,15 +91,15 @@ export class LoginModal { |
90 | 91 |
|
91 | 92 | if (!uiConfig.logoDark) this.uiConfig.logoDark = DEFAULT_LOGO_DARK; |
92 | 93 | if (!uiConfig.logoLight) this.uiConfig.logoLight = DEFAULT_LOGO_LIGHT; |
93 | | - if (!uiConfig.mode) this.uiConfig.mode = "light"; |
| 94 | + if (!uiConfig.mode) this.uiConfig.mode = THEME_MODES.light; |
94 | 95 | if (!uiConfig.modalZIndex) this.uiConfig.modalZIndex = "99998"; |
95 | 96 | if (typeof uiConfig.displayErrorsOnModal === "undefined") this.uiConfig.displayErrorsOnModal = true; |
96 | 97 | if (!uiConfig.appName) this.uiConfig.appName = "Web3Auth"; |
97 | 98 | if (!uiConfig.loginGridCol) this.uiConfig.loginGridCol = 3; |
98 | 99 | if (!uiConfig.primaryButton) this.uiConfig.primaryButton = "socialLogin"; |
99 | 100 | if (!uiConfig.defaultLanguage) this.uiConfig.defaultLanguage = getUserLanguage(uiConfig.defaultLanguage); |
100 | 101 | if (!uiConfig.widgetType) this.uiConfig.widgetType = WIDGET_TYPE.MODAL; |
101 | | - if (!uiConfig.initialAuthenticationMode) this.uiConfig.initialAuthenticationMode = "connect-only"; |
| 102 | + if (!uiConfig.initialAuthenticationMode) this.uiConfig.initialAuthenticationMode = CONNECTOR_INITIAL_AUTHENTICATION_MODE.CONNECT_ONLY; |
102 | 103 |
|
103 | 104 | if (uiConfig.widgetType === WIDGET_TYPE.EMBED && !uiConfig.targetId) { |
104 | 105 | log.error("targetId is required for embed widget"); |
|
0 commit comments