@bytexbyte/berifyme-react-sdk 1.0.7 → 1.0.8

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,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  };
48
48
  import React from "react";
49
49
  import AuthIDComponent from "@authid/react-component";
50
- import { Box, CircularProgress, Stack, Typography } from "@mui/material";
50
+ import { Box, CircularProgress, IconButton, Stack, Typography } from "@mui/material";
51
51
  import { useEffect, useRef, useState } from "react";
52
52
  import berifymeApi, { ActionType } from "../../../api/api";
53
53
  import { useSpeedTest } from "../../speedTest/SpeedProvider";
@@ -55,6 +55,7 @@ import { createAuthenticationLog, updateAuthenticationLog } from "../../Authenti
55
55
  import { createDeveloperLog } from "../../createDeveloperLog";
56
56
  import AuthIdSelectType from "./authIdSelectType";
57
57
  import theme from "../../../theme";
58
+ import CloseIcon from "@mui/icons-material/Close";
58
59
  var AuthID = function (_a) {
59
60
  var goToAllSet = _a.goToAllSet, setError = _a.setError, userId = _a.userId, setUser = _a.setUser, selectedIdType = _a.selectedIdType, setSelectedIdType = _a.setSelectedIdType, token = _a.token, setPageStatus = _a.setPageStatus;
60
61
  var _b = useState(''), operationId = _b[0], setOperationId = _b[1];
@@ -326,6 +327,10 @@ var AuthID = function (_a) {
326
327
  useEffect(function () {
327
328
  console.log('error count: ', docErrorCount.current);
328
329
  }, [docErrorCount.current]);
330
+ var handleClose = function () {
331
+ docErrorCount.current = 0;
332
+ setShowIdOrPassport(false);
333
+ };
329
334
  return (React.createElement(React.Fragment, null,
330
335
  url ?
331
336
  React.createElement(AuthIDComponent, { url: url, webauth: true })
@@ -345,8 +350,19 @@ var AuthID = function (_a) {
345
350
  background: '#fff', textAlign: 'center',
346
351
  padding: '16px', zIndex: 1000, // 确保覆盖其他内容
347
352
  } },
348
- React.createElement(Stack, { spacing: 3, height: 1, justifyContent: 'center' },
349
- React.createElement(Typography, { variant: "body1", sx: { fontWeight: 'bold' }, color: theme.palette.text.secondary }, "Having trouble?"),
353
+ React.createElement(Stack, { spacing: 3, height: 1, justifyContent: "center" },
354
+ React.createElement(Box, { sx: {
355
+ display: 'flex',
356
+ justifyContent: 'center', // 讓內容(包括文字和按鈕)水平居中
357
+ alignItems: 'center', // 讓文字垂直居中
358
+ position: 'relative', // 讓右側的 X 按鈕能絕對定位
359
+ } },
360
+ React.createElement(Typography, { variant: "body1", sx: { fontWeight: 'bold' }, color: theme.palette.text.secondary }, "Having trouble?"),
361
+ React.createElement(IconButton, { sx: {
362
+ position: 'absolute', // 將 X 按鈕放在右側
363
+ right: 0,
364
+ }, onClick: handleClose },
365
+ React.createElement(CloseIcon, null))),
350
366
  React.createElement(AuthIdSelectType, { setSelectedIdType: setSelectedIdType, setError: setError, setPageStatus: setPageStatus })))));
351
367
  };
352
368
  export default AuthID;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytexbyte/berifyme-react-sdk",
3
- "version": "1.0.7",
3
+ "version": "1.0.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/types/index.d.ts",