@blocklet/ui-react 2.10.34 → 2.10.36

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.
@@ -106,6 +106,10 @@ export type CreatePassportProps = {
106
106
  height?: string;
107
107
  scope?: string;
108
108
  role?: string;
109
+ display?: {
110
+ type: string;
111
+ content: string;
112
+ };
109
113
  };
110
114
  export type BlockletMetaProps = {
111
115
  appLogo?: React.ReactNode;
@@ -31,7 +31,15 @@ export default function Passport({ user, ...rest }) {
31
31
  }
32
32
  return -1;
33
33
  });
34
- return uniqBy(passportList, "role");
34
+ return uniqBy(
35
+ passportList.filter((x) => !x.display),
36
+ "role"
37
+ ).concat(
38
+ uniqBy(
39
+ passportList.filter((x) => x.display),
40
+ "display.content"
41
+ )
42
+ );
35
43
  }, [user?.passports]);
36
44
  const currentRole = useCreation(() => passports?.find((item) => item.name === user.role), [passports, user?.role]);
37
45
  const activeColor = useCreation(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/ui-react",
3
- "version": "2.10.34",
3
+ "version": "2.10.36",
4
4
  "description": "Some useful front-end web components that can be used in Blocklets.",
5
5
  "keywords": [
6
6
  "react",
@@ -32,8 +32,8 @@
32
32
  "url": "https://github.com/ArcBlock/ux/issues"
33
33
  },
34
34
  "dependencies": {
35
- "@arcblock/bridge": "^2.10.34",
36
- "@arcblock/react-hooks": "^2.10.34",
35
+ "@arcblock/bridge": "^2.10.36",
36
+ "@arcblock/react-hooks": "^2.10.36",
37
37
  "@iconify-icons/logos": "^1.2.36",
38
38
  "@iconify-icons/material-symbols": "^1.2.58",
39
39
  "@iconify/react": "^4.1.1",
@@ -76,8 +76,8 @@
76
76
  "@types/ua-parser-js": "^0.7.39",
77
77
  "eslint-plugin-react-hooks": "^4.6.0",
78
78
  "glob": "^10.3.3",
79
- "jest": "^28.1.3",
79
+ "jest": "^29.7.0",
80
80
  "unbuild": "^2.0.0"
81
81
  },
82
- "gitHead": "5de9c1542fd4b69ebe65efef3a7745cef72d6695"
82
+ "gitHead": "828b8514875e49150504e46b250b938f33bf3669"
83
83
  }
@@ -119,6 +119,10 @@ export type CreatePassportProps = {
119
119
  height?: string;
120
120
  scope?: string;
121
121
  role?: string;
122
+ display?: {
123
+ type: string;
124
+ content: string;
125
+ };
122
126
  };
123
127
 
124
128
  export type BlockletMetaProps = {
@@ -35,7 +35,15 @@ export default function Passport({ user, ...rest }: { user: User } & BoxProps) {
35
35
  return -1;
36
36
  });
37
37
 
38
- return uniqBy(passportList, 'role');
38
+ return uniqBy(
39
+ passportList.filter((x) => !x.display),
40
+ 'role'
41
+ ).concat(
42
+ uniqBy(
43
+ passportList.filter((x) => x.display),
44
+ 'display.content'
45
+ )
46
+ );
39
47
  }, [user?.passports]);
40
48
 
41
49
  const currentRole = useCreation(() => passports?.find((item) => item.name === user.role), [passports, user?.role]);