@arcblock/ux 2.11.50 → 2.12.1
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/lib/CloseButton/index.d.ts +5 -0
- package/lib/CloseButton/index.js +29 -0
- package/lib/Colors/index.d.ts +1 -0
- package/lib/Colors/index.js +2 -1
- package/lib/Colors/themes/did-connect.d.ts +55 -0
- package/lib/Colors/themes/did-connect.js +55 -0
- package/lib/Header/demo/images/boards.svg +3 -0
- package/lib/Header/demo/images/chatbot.svg +3 -0
- package/lib/Header/demo/images/gallery.svg +3 -0
- package/lib/NavMenu/images/OCAP.svg +16 -0
- package/lib/NavMenu/images/abt-network.svg +18 -0
- package/lib/NavMenu/images/ai-kit.svg +46 -0
- package/lib/NavMenu/images/aigne.svg +8 -0
- package/lib/NavMenu/images/aistro.svg +14 -0
- package/lib/NavMenu/images/blocklet-framework.svg +25 -0
- package/lib/NavMenu/images/blocklet-launcher.svg +9 -0
- package/lib/NavMenu/images/blocklet-server.svg +19 -0
- package/lib/NavMenu/images/blocklet-store.svg +11 -0
- package/lib/NavMenu/images/creator-studio.svg +42 -0
- package/lib/NavMenu/images/did-connect.svg +26 -0
- package/lib/NavMenu/images/did-name-service.svg +3 -0
- package/lib/NavMenu/images/did-wallet.svg +33 -0
- package/lib/NavMenu/images/did.svg +3 -0
- package/lib/NavMenu/images/nft-studio.svg +19 -0
- package/lib/NavMenu/images/vc.svg +7 -0
- package/lib/NavMenu/images/web3-kit.svg +56 -0
- package/lib/NavMenu/index.d.ts +1 -0
- package/lib/NavMenu/index.js +2 -1
- package/lib/NavMenu/nav-menu-context.d.ts +17 -0
- package/lib/NavMenu/nav-menu-context.js +19 -0
- package/lib/NavMenu/nav-menu.d.ts +10 -5
- package/lib/NavMenu/nav-menu.js +76 -36
- package/lib/NavMenu/products.d.ts +5 -0
- package/lib/NavMenu/products.js +1639 -0
- package/lib/NavMenu/style.d.ts +8 -3
- package/lib/NavMenu/style.js +215 -175
- package/lib/NavMenu/sub-item-group.d.ts +5 -0
- package/lib/NavMenu/sub-item-group.js +44 -0
- package/lib/RelativeTime/index.js +1 -0
- package/lib/SessionUser/components/quick-login-item.d.ts +19 -0
- package/lib/SessionUser/components/quick-login-item.js +122 -0
- package/lib/SessionUser/components/un-login.d.ts +2 -1
- package/lib/SessionUser/components/un-login.js +173 -30
- package/lib/SessionUser/index.js +1 -0
- package/lib/SessionUser/libs/translation.js +4 -2
- package/lib/Typography/index.js +6 -2
- package/lib/Util/style.d.ts +2 -0
- package/lib/Util/style.js +14 -0
- package/package.json +5 -5
- package/src/CloseButton/index.tsx +30 -0
- package/src/Colors/index.ts +1 -0
- package/src/Colors/themes/did-connect.ts +56 -0
- package/src/NavMenu/images/OCAP.svg +16 -0
- package/src/NavMenu/images/abt-network.svg +18 -0
- package/src/NavMenu/images/ai-kit.svg +46 -0
- package/src/NavMenu/images/aigne.svg +8 -0
- package/src/NavMenu/images/aistro.svg +14 -0
- package/src/NavMenu/images/blocklet-framework.svg +25 -0
- package/src/NavMenu/images/blocklet-launcher.svg +9 -0
- package/src/NavMenu/images/blocklet-server.svg +19 -0
- package/src/NavMenu/images/blocklet-store.svg +11 -0
- package/src/NavMenu/images/creator-studio.svg +42 -0
- package/src/NavMenu/images/did-connect.svg +26 -0
- package/src/NavMenu/images/did-name-service.svg +3 -0
- package/src/NavMenu/images/did-wallet.svg +33 -0
- package/src/NavMenu/images/did.svg +3 -0
- package/src/NavMenu/images/nft-studio.svg +19 -0
- package/src/NavMenu/images/vc.svg +7 -0
- package/src/NavMenu/images/web3-kit.svg +56 -0
- package/src/NavMenu/index.ts +1 -0
- package/src/NavMenu/nav-menu-context.tsx +30 -0
- package/src/NavMenu/nav-menu.tsx +98 -61
- package/src/NavMenu/products.tsx +378 -0
- package/src/NavMenu/style.ts +220 -183
- package/src/NavMenu/sub-item-group.tsx +36 -0
- package/src/RelativeTime/index.tsx +1 -0
- package/src/SessionUser/components/quick-login-item.tsx +131 -0
- package/src/SessionUser/components/un-login.tsx +179 -25
- package/src/SessionUser/index.tsx +1 -1
- package/src/SessionUser/libs/translation.ts +2 -0
- package/src/Typography/index.tsx +2 -2
- package/src/Util/style.ts +17 -0
package/src/NavMenu/style.ts
CHANGED
@@ -1,193 +1,230 @@
|
|
1
1
|
import { styled } from '../Theme';
|
2
2
|
|
3
|
-
type
|
3
|
+
type NavMenuProps = {
|
4
4
|
$bgColor: string;
|
5
5
|
$textColor: string;
|
6
|
-
$activeTextColor: string;
|
7
6
|
};
|
8
7
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
ul {
|
16
|
-
list-style: none;
|
17
|
-
margin: 0;
|
18
|
-
padding: 0;
|
19
|
-
}
|
20
|
-
.navmenu-item,
|
21
|
-
.navmenu-sub {
|
22
|
-
display: flex;
|
23
|
-
align-items: center;
|
24
|
-
}
|
25
|
-
a {
|
26
|
-
color: inherit;
|
27
|
-
text-decoration: none;
|
28
|
-
}
|
29
|
-
/* active/hover */
|
30
|
-
.navmenu-item,
|
31
|
-
.navmenu-sub {
|
32
|
-
color: ${(props) => props.$textColor};
|
33
|
-
}
|
34
|
-
.navmenu-item--active,
|
35
|
-
.navmenu-item:hover,
|
36
|
-
.navmenu-sub--opened {
|
37
|
-
color: ${(props) => props.$activeTextColor};
|
38
|
-
}
|
39
|
-
|
40
|
-
.navmenu-item {
|
41
|
-
position: relative;
|
42
|
-
cursor: pointer;
|
43
|
-
transition: color 0.2s ease-in-out;
|
44
|
-
a {
|
45
|
-
white-space: nowrap;
|
46
|
-
}
|
47
|
-
a::before {
|
48
|
-
position: absolute;
|
49
|
-
top: 0;
|
50
|
-
right: 0;
|
51
|
-
bottom: 0;
|
52
|
-
left: 0;
|
53
|
-
background-color: transparent;
|
54
|
-
content: '';
|
55
|
-
}
|
56
|
-
}
|
57
|
-
|
58
|
-
.navmenu-sub {
|
59
|
-
position: relative;
|
60
|
-
cursor: pointer;
|
61
|
-
}
|
62
|
-
/* icon & expand icon */
|
63
|
-
.navmenu-item-icon,
|
64
|
-
.navmenu-sub-icon,
|
65
|
-
.navmenu-sub-expand-icon {
|
66
|
-
display: flex;
|
67
|
-
line-height: 1;
|
68
|
-
}
|
69
|
-
.navmenu-item-icon,
|
70
|
-
.navmenu-sub-icon {
|
71
|
-
margin-right: 4px;
|
72
|
-
}
|
73
|
-
.navmenu-item-icon > *,
|
74
|
-
.navmenu-sub-icon > * {
|
75
|
-
width: auto;
|
76
|
-
height: 22px;
|
77
|
-
max-height: 22px;
|
78
|
-
font-size: 1.5em;
|
79
|
-
}
|
80
|
-
.navmenu-sub-expand-icon {
|
81
|
-
margin-left: 8px;
|
82
|
-
> * {
|
83
|
-
width: 0.8em;
|
84
|
-
height: 0.8em;
|
85
|
-
transition: transform 0.2s ease-in-out;
|
86
|
-
}
|
87
|
-
}
|
88
|
-
`;
|
89
|
-
|
90
|
-
export const HorizontalStyle = styled(NavMenuBase)`
|
91
|
-
padding: 8px 16px;
|
92
|
-
min-width: 50px;
|
8
|
+
// .navmenu-root
|
9
|
+
export const NavMenuRoot = styled('nav', {
|
10
|
+
shouldForwardProp: (prop) => prop !== '$bgColor' && prop !== '$textColor',
|
11
|
+
})<NavMenuProps>(({ $bgColor, $textColor }) => ({
|
12
|
+
padding: '8px 16px',
|
13
|
+
minWidth: '50px',
|
93
14
|
// FIXME: @zhanghan 这个只是临时的解决方案,会导致 header align right 不能真正的右对齐,需要修改 header 才能真正解决这个问题
|
94
|
-
|
15
|
+
flexGrow: 100,
|
16
|
+
backgroundColor: $bgColor,
|
17
|
+
color: $textColor,
|
18
|
+
fontSize: '16px',
|
19
|
+
}));
|
95
20
|
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
21
|
+
// .navmenu-list
|
22
|
+
export const NavMenuList = styled('ul')(() => ({
|
23
|
+
listStyle: 'none',
|
24
|
+
margin: 0,
|
25
|
+
padding: 0,
|
26
|
+
display: 'flex',
|
27
|
+
alignItems: 'center',
|
28
|
+
// inline 布局
|
29
|
+
'&.navmenu-list--inline ': {
|
30
|
+
flexDirection: 'column',
|
31
|
+
alignItems: 'stretch',
|
32
|
+
},
|
33
|
+
}));
|
34
|
+
|
35
|
+
type NavMenuItemProps = {
|
36
|
+
$activeTextColor: string;
|
37
|
+
};
|
38
|
+
// 菜单项 .navmenu-item
|
39
|
+
export const NavMenuItem = styled('li', {
|
40
|
+
shouldForwardProp: (prop) => prop !== '$activeTextColor',
|
41
|
+
})<NavMenuItemProps>(({ $activeTextColor }) => ({
|
42
|
+
display: 'flex',
|
43
|
+
alignItems: 'center',
|
44
|
+
position: 'relative',
|
45
|
+
padding: '0 12px',
|
46
|
+
whiteSpace: 'nowrap',
|
47
|
+
cursor: 'pointer',
|
48
|
+
transition: 'color 0.2s ease-in-out',
|
49
|
+
// 间距调整
|
50
|
+
'&:first-of-type': {
|
51
|
+
paddingLeft: 0,
|
52
|
+
},
|
53
|
+
'&:last-of-type': {
|
54
|
+
paddingRight: 0,
|
55
|
+
},
|
56
|
+
// 内部链接
|
57
|
+
a: {
|
58
|
+
whiteSpace: 'nowrap',
|
59
|
+
color: 'inherit',
|
60
|
+
textDecoration: 'none',
|
61
|
+
// 扩大点击区域
|
62
|
+
'&::before': {
|
63
|
+
position: 'absolute',
|
64
|
+
top: 0,
|
65
|
+
right: 0,
|
66
|
+
bottom: 0,
|
67
|
+
left: 0,
|
68
|
+
backgroundColor: 'transparent',
|
69
|
+
content: '""',
|
70
|
+
},
|
71
|
+
},
|
72
|
+
// 图标
|
73
|
+
'.navmenu-item__icon': {
|
74
|
+
display: 'flex',
|
75
|
+
alignItems: 'center',
|
76
|
+
justifyContent: 'center',
|
77
|
+
marginRight: '4px',
|
78
|
+
'& > *': {
|
79
|
+
width: 'auto',
|
80
|
+
height: '22px',
|
81
|
+
maxHeight: '22px',
|
82
|
+
fontSize: '1.5em',
|
83
|
+
},
|
84
|
+
},
|
85
|
+
// 右侧内容
|
86
|
+
'.navmenu-item__content': {
|
87
|
+
height: '32px',
|
88
|
+
display: 'flex',
|
89
|
+
flexDirection: 'column',
|
90
|
+
justifyContent: 'center',
|
91
|
+
alignItems: 'flex-start',
|
92
|
+
gap: '5px',
|
93
|
+
},
|
94
|
+
'.navmenu-item__label': {
|
95
|
+
display: 'flex',
|
96
|
+
alignItems: 'center',
|
97
|
+
'&-arrow': {
|
98
|
+
marginLeft: '6px',
|
99
|
+
fontSize: '14px',
|
100
|
+
opacity: 0,
|
101
|
+
transition: 'opacity 0.2s ease-in-out',
|
102
|
+
},
|
103
|
+
},
|
104
|
+
'.navmenu-item__desc': {
|
105
|
+
fontSize: '14px',
|
106
|
+
},
|
107
|
+
// 悬停状态下
|
108
|
+
'&:hover': {
|
109
|
+
color: $activeTextColor,
|
110
|
+
},
|
111
|
+
// 选中状态下
|
112
|
+
'&.navmenu-item--active': {
|
113
|
+
color: $activeTextColor,
|
114
|
+
},
|
115
|
+
// Panel 形态下
|
116
|
+
'&.navmenu-item--panel': {
|
117
|
+
padding: '8px 16px',
|
118
|
+
borderRadius: '8px',
|
119
|
+
'.navmenu-item__icon': {
|
120
|
+
width: '32px',
|
121
|
+
height: '32px',
|
122
|
+
marginRight: '16px',
|
123
|
+
border: '1px solid #eff1f5',
|
124
|
+
borderRadius: '4px',
|
125
|
+
color: '#9497a0',
|
126
|
+
},
|
127
|
+
'.navmenu-item__label': {
|
128
|
+
fontSize: '14px',
|
129
|
+
lineHeight: 1,
|
130
|
+
color: '#26292e',
|
131
|
+
},
|
132
|
+
'.navmenu-item__desc': {
|
133
|
+
fontSize: '12px',
|
134
|
+
lineHeight: 1,
|
135
|
+
color: '#9497a0',
|
136
|
+
},
|
137
|
+
'&:hover': {
|
138
|
+
background: '#f9f9fb',
|
139
|
+
transition: 'background 0.2s ease-in-out',
|
140
|
+
'.navmenu-item__label-arrow': {
|
141
|
+
opacity: 1,
|
142
|
+
},
|
143
|
+
'.navmenu-item__desc': {
|
144
|
+
color: '#26292e',
|
145
|
+
transition: 'color 0.2s ease-in-out',
|
146
|
+
},
|
147
|
+
},
|
148
|
+
'&.navmenu-item--active': {
|
149
|
+
background: '#f9f9fb',
|
150
|
+
},
|
151
|
+
},
|
152
|
+
// inline 布局中
|
153
|
+
'&.navmenu-item--inline': {
|
154
|
+
margin: 0,
|
155
|
+
padding: '0 16px',
|
156
|
+
minHeight: '48px',
|
157
|
+
lineHeight: '48px',
|
158
|
+
flexWrap: 'wrap',
|
159
|
+
},
|
160
|
+
}));
|
110
161
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
162
|
+
// 包含子菜单的导航项 .navmenu-item .navmenu-sub
|
163
|
+
export const NavMenuSub = styled(NavMenuItem)(() => ({
|
164
|
+
'.navmenu-item': {
|
165
|
+
marginLeft: 0,
|
166
|
+
},
|
167
|
+
'& .navmenu-sub__container': {
|
168
|
+
visibility: 'hidden',
|
169
|
+
opacity: 0,
|
170
|
+
position: 'absolute',
|
171
|
+
top: '100%',
|
172
|
+
left: '50%',
|
173
|
+
zIndex: 1,
|
174
|
+
transform: 'translateX(-50%)',
|
175
|
+
paddingTop: '16px',
|
176
|
+
transition: 'opacity 0.2s ease-in-out, visibility 0.2s ease-in-out',
|
177
|
+
},
|
178
|
+
'&.navmenu-sub--opened > .navmenu-sub__container': {
|
179
|
+
visibility: 'visible',
|
180
|
+
opacity: 1,
|
181
|
+
},
|
182
|
+
// 扩展图标
|
183
|
+
'.navmenu-sub__expand-icon': {
|
184
|
+
display: 'flex',
|
185
|
+
alignItems: 'center',
|
186
|
+
justifyContent: 'center',
|
187
|
+
marginLeft: '8px',
|
188
|
+
'& > *': {
|
189
|
+
width: '0.8em',
|
190
|
+
height: '0.8em',
|
191
|
+
transition: 'transform 0.2s ease-in-out',
|
192
|
+
},
|
193
|
+
'.navmenu-item--inline &': {
|
194
|
+
marginLeft: 'auto',
|
195
|
+
},
|
196
|
+
},
|
197
|
+
// inline 布局
|
198
|
+
'&.navmenu-item--inline': {
|
199
|
+
'.navmenu-sub__container': {
|
200
|
+
position: 'static',
|
201
|
+
transform: 'none',
|
202
|
+
flex: '1 0 100%',
|
203
|
+
margin: '0 -16px',
|
204
|
+
padding: 0,
|
205
|
+
height: 0,
|
206
|
+
overflow: 'hidden',
|
207
|
+
transition: 'height 0.2s ease-in-out',
|
208
|
+
},
|
209
|
+
'&.navmenu-sub--opened > .navmenu-sub__container': {
|
210
|
+
height: 'auto',
|
211
|
+
},
|
212
|
+
'.navmenu-sub__list': {
|
213
|
+
padding: 0,
|
214
|
+
paddingLeft: '16px',
|
215
|
+
boxShadow: 'none',
|
216
|
+
},
|
217
|
+
},
|
218
|
+
}));
|
139
219
|
|
140
|
-
|
141
|
-
export const
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
}
|
152
|
-
& .navmenu-sub {
|
153
|
-
flex-wrap: wrap;
|
154
|
-
}
|
155
|
-
/* 顶级 */
|
156
|
-
.navmenu-root > .navmenu-item,
|
157
|
-
.navmenu-root > .navmenu-sub {
|
158
|
-
line-height: 48px;
|
159
|
-
border-bottom: 1px solid #eee;
|
160
|
-
}
|
161
|
-
/* icon */
|
162
|
-
.navmenu-item-icon,
|
163
|
-
.navmenu-sub-icon {
|
164
|
-
width: 30px;
|
165
|
-
margin: 0;
|
166
|
-
}
|
167
|
-
.navmenu-sub-expand-icon {
|
168
|
-
margin-left: auto;
|
169
|
-
}
|
170
|
-
/* 子级列表 */
|
171
|
-
.navmenu-sub-container {
|
172
|
-
display: none;
|
173
|
-
flex: 1 0 100%;
|
174
|
-
margin: 0 -16px;
|
175
|
-
padding-bottom: 8px;
|
176
|
-
.navmenu-item,
|
177
|
-
.navmenu-sub {
|
178
|
-
line-height: 32px;
|
179
|
-
}
|
180
|
-
}
|
181
|
-
.navmenu-sub-list {
|
182
|
-
padding-left: 16px;
|
183
|
-
.navmenu-item,
|
184
|
-
.navmenu-sub {
|
185
|
-
padding-left: 30px;
|
186
|
-
font-size: 13px;
|
187
|
-
}
|
188
|
-
}
|
189
|
-
/* 二级 menu */
|
190
|
-
.navmenu-sub--opened > .navmenu-sub-container {
|
191
|
-
display: block;
|
192
|
-
}
|
193
|
-
`;
|
220
|
+
// 下拉子菜单 .navmenu-sub-list
|
221
|
+
export const NavMenuSubList = styled('ul')(() => ({
|
222
|
+
margin: 0,
|
223
|
+
padding: '16px',
|
224
|
+
borderRadius: '4px',
|
225
|
+
background: '#fff',
|
226
|
+
boxShadow: '0 2px 8px rgba(0, 0, 0, 0.15)',
|
227
|
+
'& .navmenu-item + .navmenu-item': {
|
228
|
+
marginTop: '8px',
|
229
|
+
},
|
230
|
+
}));
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { Box, BoxProps } from '@mui/material';
|
2
|
+
import { styled } from '../Theme';
|
3
|
+
|
4
|
+
const Group = styled(Box)`
|
5
|
+
padding: 16px 24px;
|
6
|
+
border-radius: 8px;
|
7
|
+
background-color: white;
|
8
|
+
cursor: auto;
|
9
|
+
|
10
|
+
.group-label {
|
11
|
+
margin-bottom: 8px;
|
12
|
+
color: #71717b;
|
13
|
+
font-size: 12px;
|
14
|
+
}
|
15
|
+
|
16
|
+
.nav {
|
17
|
+
list-style: none;
|
18
|
+
margin: 0;
|
19
|
+
padding: 0;
|
20
|
+
}
|
21
|
+
`;
|
22
|
+
|
23
|
+
export interface NavMenuSubItemGroupProps extends BoxProps {
|
24
|
+
label: React.ReactNode;
|
25
|
+
}
|
26
|
+
|
27
|
+
export default function NavMenuSubItemGroup({ label, children, className, sx, ...rest }: NavMenuSubItemGroupProps) {
|
28
|
+
return (
|
29
|
+
<Group className={`nav-menu-sub-item-group ${className}`} sx={{ ...sx }} {...rest}>
|
30
|
+
<Box className="group-label">{label}</Box>
|
31
|
+
<Box component="ul" className="nav">
|
32
|
+
{children}
|
33
|
+
</Box>
|
34
|
+
</Group>
|
35
|
+
);
|
36
|
+
}
|
@@ -0,0 +1,131 @@
|
|
1
|
+
import PropTypes from 'prop-types';
|
2
|
+
import DID from '@arcblock/ux/lib/DID';
|
3
|
+
import RelativeTime from '@arcblock/ux/lib/RelativeTime';
|
4
|
+
import WalletOSIcon from '@arcblock/ux/lib/WalletOSIcon';
|
5
|
+
import { Box, Chip, Typography } from '@mui/material';
|
6
|
+
import { temp as colors } from '@arcblock/ux/lib/Colors';
|
7
|
+
import noop from 'lodash/noop';
|
8
|
+
|
9
|
+
import Avatar from '../../Avatar';
|
10
|
+
import { getSourceProvider } from '../libs/utils';
|
11
|
+
|
12
|
+
export default function QuickLoginItem({
|
13
|
+
userSession,
|
14
|
+
locale = 'en',
|
15
|
+
onClick = noop,
|
16
|
+
}: {
|
17
|
+
onClick?: () => void;
|
18
|
+
locale?: string;
|
19
|
+
userSession: {
|
20
|
+
user: {
|
21
|
+
avatar: string;
|
22
|
+
did: string;
|
23
|
+
fullName: string;
|
24
|
+
role: string;
|
25
|
+
roleTitle: string;
|
26
|
+
email: string;
|
27
|
+
};
|
28
|
+
extra: {
|
29
|
+
walletOS: string;
|
30
|
+
provider: string;
|
31
|
+
};
|
32
|
+
updatedAt: string;
|
33
|
+
};
|
34
|
+
}) {
|
35
|
+
const isRawWalletAccount = getSourceProvider(userSession?.user) === 'wallet';
|
36
|
+
|
37
|
+
return (
|
38
|
+
<Box
|
39
|
+
sx={{
|
40
|
+
borderRadius: 2,
|
41
|
+
p: 2,
|
42
|
+
transition: 'background-color 0.5s',
|
43
|
+
'&:hover, &:active': {
|
44
|
+
backgroundColor: colors.backgroundsBgSubtileHover,
|
45
|
+
},
|
46
|
+
display: 'flex',
|
47
|
+
justifyContent: 'space-between',
|
48
|
+
alignItems: 'center',
|
49
|
+
cursor: 'pointer',
|
50
|
+
'&:hover': {
|
51
|
+
backgroundColor: colors.surfacePrimarySubtitle,
|
52
|
+
},
|
53
|
+
width: '100%',
|
54
|
+
backgroundColor: 'white',
|
55
|
+
}}
|
56
|
+
onClick={onClick}>
|
57
|
+
<Box
|
58
|
+
sx={{
|
59
|
+
display: 'flex',
|
60
|
+
alignItems: 'center',
|
61
|
+
gap: 1.5,
|
62
|
+
flex: 1,
|
63
|
+
overflow: 'hidden',
|
64
|
+
}}>
|
65
|
+
<Avatar src={userSession.user.avatar} did={userSession.user.did} size={44} variant="circle" shape="circle" />
|
66
|
+
<Box sx={{ flex: 1, overflow: 'hidden' }}>
|
67
|
+
<Typography
|
68
|
+
sx={{
|
69
|
+
fontSize: '16px',
|
70
|
+
fontWeight: 500,
|
71
|
+
display: 'flex',
|
72
|
+
alignItems: 'center',
|
73
|
+
gap: 1,
|
74
|
+
color: colors.textBase,
|
75
|
+
}}>
|
76
|
+
{userSession.user.fullName}
|
77
|
+
<Chip
|
78
|
+
label={userSession.user?.roleTitle || userSession.user?.role}
|
79
|
+
size="small"
|
80
|
+
variant="outlined"
|
81
|
+
sx={() => ({
|
82
|
+
height: 'auto',
|
83
|
+
fontWeight: 'bold',
|
84
|
+
fontSize: '12px',
|
85
|
+
borderColor: colors.lineBorderStrong,
|
86
|
+
color: colors.textSubtitle,
|
87
|
+
})}
|
88
|
+
/>
|
89
|
+
</Typography>
|
90
|
+
{isRawWalletAccount ? (
|
91
|
+
<Box
|
92
|
+
sx={{
|
93
|
+
display: 'flex',
|
94
|
+
alignItems: 'center',
|
95
|
+
gap: 0.5,
|
96
|
+
}}>
|
97
|
+
<WalletOSIcon
|
98
|
+
provider={userSession?.extra?.provider}
|
99
|
+
walletOS={userSession?.extra?.walletOS}
|
100
|
+
color={colors.textSubtitle}
|
101
|
+
/>
|
102
|
+
<DID
|
103
|
+
// @ts-ignore
|
104
|
+
locale={locale}
|
105
|
+
did={userSession.user.did}
|
106
|
+
size={12}
|
107
|
+
sx={{
|
108
|
+
lineHeight: 1,
|
109
|
+
fontSize: '12px',
|
110
|
+
mt: 0.5,
|
111
|
+
'& span.arc-avatar-did-motif': {
|
112
|
+
display: 'none !important',
|
113
|
+
},
|
114
|
+
}}
|
115
|
+
compact
|
116
|
+
/>
|
117
|
+
</Box>
|
118
|
+
) : (
|
119
|
+
<Typography sx={{ fontSize: '12px', color: colors.textSubtitle }}>{userSession.user.email}</Typography>
|
120
|
+
)}
|
121
|
+
</Box>
|
122
|
+
</Box>
|
123
|
+
{userSession.updatedAt && (
|
124
|
+
<Box component="span" sx={{ color: colors.textMuted, fontSize: '12px', flexShrink: 0 }}>
|
125
|
+
{/* @ts-ignore */}
|
126
|
+
<RelativeTime value={userSession.updatedAt} locale={locale} />
|
127
|
+
</Box>
|
128
|
+
)}
|
129
|
+
</Box>
|
130
|
+
);
|
131
|
+
}
|