@privy-io/react-auth 1.3.0-beta.4 → 1.3.0-beta.6
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.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -342,6 +342,7 @@ interface PrivyProviderProps {
|
|
|
342
342
|
* onSuccess is run when an auth (`login`) or linking (`linkEmail` or `linkWallet`)
|
|
343
343
|
* action is completed successfully.
|
|
344
344
|
*/
|
|
345
|
+
showSocials?: boolean;
|
|
345
346
|
onSuccess?: (user: User) => void;
|
|
346
347
|
children: React.ReactNode;
|
|
347
348
|
}
|
package/dist/index.js
CHANGED
|
@@ -173,6 +173,7 @@ var PRIVY_AUTH_URL = process.env.NEXT_PUBLIC_PRIVY_AUTH_URL || "https://auth.pri
|
|
|
173
173
|
var PRIVY_INFURA_ID = "70f97dc579834350a5baec117b3c5ae3";
|
|
174
174
|
var DEFAULT_TIMEOUT_MS = 1e4;
|
|
175
175
|
var DEFAULT_SUCCESS_SCREEN_DURATION_MS = 1200;
|
|
176
|
+
var DEFAULT_WALLET_TIMEOUT_MS = 2e4;
|
|
176
177
|
|
|
177
178
|
// src/token.ts
|
|
178
179
|
var import_jwt_decode = __toESM(require("jwt-decode"));
|
|
@@ -568,7 +569,6 @@ var SUPPORTED_WALLET_TYPES = ["metamask", "coinbase_wallet", "wallet_connect"];
|
|
|
568
569
|
|
|
569
570
|
// src/connector.ts
|
|
570
571
|
var WALLET_TYPE_STORAGE_KEY = "privy:wallet_type";
|
|
571
|
-
var DEFAULT_WALLET_TIMEOUT_MS = 1e4;
|
|
572
572
|
var walletTimeout = (error = new WalletTimeoutError(), timeoutMs = DEFAULT_WALLET_TIMEOUT_MS) => new Promise(
|
|
573
573
|
(_, reject) => setTimeout(() => {
|
|
574
574
|
reject(error);
|
|
@@ -1043,7 +1043,8 @@ var ModalContext = (0, import_react3.createContext)({
|
|
|
1043
1043
|
currentScreen: "LANDING" /* LANDING */,
|
|
1044
1044
|
lastScreen: "LANDING" /* LANDING */,
|
|
1045
1045
|
navigate: notImplemented,
|
|
1046
|
-
navigateBack: notImplemented
|
|
1046
|
+
navigateBack: notImplemented,
|
|
1047
|
+
showSocials: false
|
|
1047
1048
|
});
|
|
1048
1049
|
var ModalProvider = (props) => {
|
|
1049
1050
|
const client = props.client;
|
|
@@ -1083,7 +1084,8 @@ var ModalProvider = (props) => {
|
|
|
1083
1084
|
},
|
|
1084
1085
|
navigateBack: () => {
|
|
1085
1086
|
setCurrentScreen(lastScreen);
|
|
1086
|
-
}
|
|
1087
|
+
},
|
|
1088
|
+
showSocials: props.showSocials || false
|
|
1087
1089
|
};
|
|
1088
1090
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(ModalContext.Provider, {
|
|
1089
1091
|
value: ctx,
|
|
@@ -2028,7 +2030,7 @@ var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
|
2028
2030
|
var LandingScreen = () => {
|
|
2029
2031
|
const [activeSection, setActiveSection] = (0, import_react5.useState)(0 /* WALLET */);
|
|
2030
2032
|
const { ready, authenticated, user } = usePrivy();
|
|
2031
|
-
const { navigate } = usePrivyModal();
|
|
2033
|
+
const { navigate, showSocials } = usePrivyModal();
|
|
2032
2034
|
(0, import_react5.useEffect)(() => {
|
|
2033
2035
|
var _a, _b, _c, _d, _e;
|
|
2034
2036
|
const atLeastOneSocial = (user == null ? void 0 : user.google) || (user == null ? void 0 : user.twitter) || (user == null ? void 0 : user.discord);
|
|
@@ -2101,7 +2103,7 @@ var LandingScreen = () => {
|
|
|
2101
2103
|
emailSectionActive ? /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ConnectEmailForm, {}) : null
|
|
2102
2104
|
]
|
|
2103
2105
|
}),
|
|
2104
|
-
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(ConnectSection, {
|
|
2106
|
+
showSocials && /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(ConnectSection, {
|
|
2105
2107
|
active: socialSectionActive,
|
|
2106
2108
|
onClick: () => {
|
|
2107
2109
|
if (!socialSectionActive)
|
|
@@ -6629,6 +6631,7 @@ var PrivatePrivyProvider = (props) => {
|
|
|
6629
6631
|
value: internalContext,
|
|
6630
6632
|
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ModalProvider, {
|
|
6631
6633
|
client,
|
|
6634
|
+
showSocials: props.showSocials || false,
|
|
6632
6635
|
children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LoginModal, {})
|
|
6633
6636
|
})
|
|
6634
6637
|
})
|