@blocklet/ui-react 2.13.13 → 2.13.14
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.
|
@@ -7,11 +7,13 @@ import { getConnectedAccounts, getSourceProvider } from "@arcblock/ux/lib/Sessio
|
|
|
7
7
|
import { LOGIN_PROVIDER } from "@arcblock/ux/lib/Util/constant";
|
|
8
8
|
import { SessionContext } from "@arcblock/did-connect/lib/Session";
|
|
9
9
|
import { PasskeyActions } from "@arcblock/did-connect/lib/Passkey";
|
|
10
|
+
import { useBrowser } from "@arcblock/react-hooks";
|
|
10
11
|
import ThirdPartyItem from "./third-party-item.js";
|
|
11
12
|
export default function ThirdPartyLogin({ user }) {
|
|
12
13
|
const { session } = useContext(SessionContext);
|
|
13
14
|
const [oauthConfigs, setOauthConfigs] = useState({});
|
|
14
15
|
const { getOAuthConfigs } = session.useOAuth();
|
|
16
|
+
const browser = useBrowser();
|
|
15
17
|
useAsyncEffect(async () => {
|
|
16
18
|
const data = await getOAuthConfigs({
|
|
17
19
|
sourceAppPid: user?.sourceAppPid
|
|
@@ -149,7 +151,7 @@ export default function ThirdPartyLogin({ user }) {
|
|
|
149
151
|
walletAccounts.map((account) => {
|
|
150
152
|
return /* @__PURE__ */ jsx(ThirdPartyItem, { item: account }, account.id);
|
|
151
153
|
}),
|
|
152
|
-
/* @__PURE__ */ jsx(
|
|
154
|
+
browser.wallet || browser.arcSphere ? null : /* @__PURE__ */ jsx(
|
|
153
155
|
PasskeyActions,
|
|
154
156
|
{
|
|
155
157
|
behavior: "only-new",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/ui-react",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.14",
|
|
4
4
|
"description": "Some useful front-end web components that can be used in Blocklets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@abtnode/constant": "^1.16.42",
|
|
36
36
|
"@abtnode/util": "^1.16.42",
|
|
37
|
-
"@arcblock/bridge": "^2.13.
|
|
38
|
-
"@arcblock/react-hooks": "^2.13.
|
|
39
|
-
"@arcblock/ws": "^1.20.
|
|
37
|
+
"@arcblock/bridge": "^2.13.14",
|
|
38
|
+
"@arcblock/react-hooks": "^2.13.14",
|
|
39
|
+
"@arcblock/ws": "^1.20.2",
|
|
40
40
|
"@blocklet/constant": "^1.16.42",
|
|
41
41
|
"@blocklet/did-space-react": "^1.0.48",
|
|
42
42
|
"@iconify-icons/logos": "^1.2.36",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"jest": "^29.7.0",
|
|
95
95
|
"unbuild": "^2.0.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "b9f48199169b641a2d3277806501471a56dd496d"
|
|
98
98
|
}
|
|
@@ -6,6 +6,7 @@ import { getConnectedAccounts, getSourceProvider } from '@arcblock/ux/lib/Sessio
|
|
|
6
6
|
import { LOGIN_PROVIDER } from '@arcblock/ux/lib/Util/constant';
|
|
7
7
|
import { SessionContext } from '@arcblock/did-connect/lib/Session';
|
|
8
8
|
import { PasskeyActions } from '@arcblock/did-connect/lib/Passkey';
|
|
9
|
+
import { useBrowser } from '@arcblock/react-hooks';
|
|
9
10
|
|
|
10
11
|
import type { ConnectedAccount, OAuthAccount, User, SessionContext as TSessionContext } from '../../../@types';
|
|
11
12
|
import ThirdPartyItem from './third-party-item';
|
|
@@ -18,6 +19,7 @@ export default function ThirdPartyLogin({ user }: { user: User }) {
|
|
|
18
19
|
const { session } = useContext<TSessionContext>(SessionContext);
|
|
19
20
|
const [oauthConfigs, setOauthConfigs] = useState<Record<string, ConnectedAccountProps>>({});
|
|
20
21
|
const { getOAuthConfigs } = session.useOAuth();
|
|
22
|
+
const browser = useBrowser();
|
|
21
23
|
|
|
22
24
|
useAsyncEffect(async () => {
|
|
23
25
|
const data = await getOAuthConfigs({
|
|
@@ -174,20 +176,22 @@ export default function ThirdPartyLogin({ user }: { user: User }) {
|
|
|
174
176
|
{walletAccounts.map((account) => {
|
|
175
177
|
return <ThirdPartyItem key={account.id} item={account as OAuthAccount} />;
|
|
176
178
|
})}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
179
|
+
{browser.wallet || browser.arcSphere ? null : (
|
|
180
|
+
<PasskeyActions
|
|
181
|
+
behavior="only-new"
|
|
182
|
+
action="connect"
|
|
183
|
+
createMode="connect"
|
|
184
|
+
createButtonText="Add New Passkey"
|
|
185
|
+
onSuccess={noop}
|
|
186
|
+
onError={noop}
|
|
187
|
+
dense
|
|
188
|
+
sx={{
|
|
189
|
+
px: 1.5,
|
|
190
|
+
py: 1,
|
|
191
|
+
gap: 0.75,
|
|
192
|
+
}}
|
|
193
|
+
/>
|
|
194
|
+
)}
|
|
191
195
|
</>
|
|
192
196
|
)}
|
|
193
197
|
</Box>
|