@blocklet/ui-react 3.4.14 → 3.5.0
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/common/org-switch/use-org.d.ts +4 -4
- package/lib/common/ws.d.ts +22 -1
- package/package.json +10 -7
- package/.aigne/doc-smith/.local/afs-storage.sqlite3 +0 -0
- package/.aigne/doc-smith/config.yaml +0 -78
- package/.aigne/doc-smith/history.yaml +0 -14
- package/.aigne/doc-smith/media-description.yaml +0 -11
- package/.aigne/doc-smith/output/structure-plan.json +0 -255
- package/.aigne/doc-smith/translation-cache.yaml +0 -11
- package/.aigne/doc-smith/upload-cache.yaml +0 -528
- package/build.config.ts +0 -24
- package/docs/_sidebar.md +0 -19
- package/docs/assets/diagram/component-installer-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/component-installer-diagram-0.jpg +0 -0
- package/docs/assets/diagram/component-installer-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/component-installer-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/component-management-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/component-management-diagram-0.jpg +0 -0
- package/docs/assets/diagram/component-management-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/component-management-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/core-concepts-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/core-concepts-diagram-0.jpg +0 -0
- package/docs/assets/diagram/core-concepts-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/core-concepts-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/dashboard-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/dashboard-diagram-0.jpg +0 -0
- package/docs/assets/diagram/dashboard-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/dashboard-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/header-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/header-diagram-0.jpg +0 -0
- package/docs/assets/diagram/header-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/header-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/layout-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/layout-diagram-0.jpg +0 -0
- package/docs/assets/diagram/layout-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/layout-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/notifications-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/notifications-diagram-0.jpg +0 -0
- package/docs/assets/diagram/notifications-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/notifications-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/overview-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/overview-diagram-0.jpg +0 -0
- package/docs/assets/diagram/overview-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/overview-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/user-center-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/user-center-diagram-0.jpg +0 -0
- package/docs/assets/diagram/user-center-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/user-center-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/user-management-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/user-management-diagram-0.jpg +0 -0
- package/docs/assets/diagram/user-management-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/user-management-diagram-0.zh.jpg +0 -0
- package/docs/assets/diagram/user-sessions-diagram-0.ja.jpg +0 -0
- package/docs/assets/diagram/user-sessions-diagram-0.jpg +0 -0
- package/docs/assets/diagram/user-sessions-diagram-0.zh-TW.jpg +0 -0
- package/docs/assets/diagram/user-sessions-diagram-0.zh.jpg +0 -0
- package/docs/components-component-management-blocklet-studio.ja.md +0 -194
- package/docs/components-component-management-blocklet-studio.md +0 -194
- package/docs/components-component-management-blocklet-studio.zh-TW.md +0 -194
- package/docs/components-component-management-blocklet-studio.zh.md +0 -194
- package/docs/components-component-management-component-installer.ja.md +0 -182
- package/docs/components-component-management-component-installer.md +0 -182
- package/docs/components-component-management-component-installer.zh-TW.md +0 -182
- package/docs/components-component-management-component-installer.zh.md +0 -182
- package/docs/components-component-management.ja.md +0 -30
- package/docs/components-component-management.md +0 -30
- package/docs/components-component-management.zh-TW.md +0 -30
- package/docs/components-component-management.zh.md +0 -30
- package/docs/components-layout-dashboard.ja.md +0 -185
- package/docs/components-layout-dashboard.md +0 -187
- package/docs/components-layout-dashboard.zh-TW.md +0 -185
- package/docs/components-layout-dashboard.zh.md +0 -185
- package/docs/components-layout-footer.ja.md +0 -165
- package/docs/components-layout-footer.md +0 -165
- package/docs/components-layout-footer.zh-TW.md +0 -165
- package/docs/components-layout-footer.zh.md +0 -165
- package/docs/components-layout-header.ja.md +0 -183
- package/docs/components-layout-header.md +0 -183
- package/docs/components-layout-header.zh-TW.md +0 -183
- package/docs/components-layout-header.zh.md +0 -183
- package/docs/components-layout.ja.md +0 -31
- package/docs/components-layout.md +0 -31
- package/docs/components-layout.zh-TW.md +0 -31
- package/docs/components-layout.zh.md +0 -31
- package/docs/components-notifications.ja.md +0 -125
- package/docs/components-notifications.md +0 -125
- package/docs/components-notifications.zh-TW.md +0 -125
- package/docs/components-notifications.zh.md +0 -125
- package/docs/components-user-management-user-center.ja.md +0 -148
- package/docs/components-user-management-user-center.md +0 -147
- package/docs/components-user-management-user-center.zh-TW.md +0 -148
- package/docs/components-user-management-user-center.zh.md +0 -148
- package/docs/components-user-management-user-sessions.ja.md +0 -121
- package/docs/components-user-management-user-sessions.md +0 -123
- package/docs/components-user-management-user-sessions.zh-TW.md +0 -121
- package/docs/components-user-management-user-sessions.zh.md +0 -121
- package/docs/components-user-management.ja.md +0 -49
- package/docs/components-user-management.md +0 -51
- package/docs/components-user-management.zh-TW.md +0 -49
- package/docs/components-user-management.zh.md +0 -49
- package/docs/components-utilities-icon.ja.md +0 -106
- package/docs/components-utilities-icon.md +0 -106
- package/docs/components-utilities-icon.zh-TW.md +0 -106
- package/docs/components-utilities-icon.zh.md +0 -106
- package/docs/components-utilities.ja.md +0 -136
- package/docs/components-utilities.md +0 -136
- package/docs/components-utilities.zh-TW.md +0 -136
- package/docs/components-utilities.zh.md +0 -136
- package/docs/components.ja.md +0 -27
- package/docs/components.md +0 -27
- package/docs/components.zh-TW.md +0 -27
- package/docs/components.zh.md +0 -27
- package/docs/core-concepts.ja.md +0 -134
- package/docs/core-concepts.md +0 -135
- package/docs/core-concepts.zh-TW.md +0 -134
- package/docs/core-concepts.zh.md +0 -134
- package/docs/getting-started.ja.md +0 -132
- package/docs/getting-started.md +0 -132
- package/docs/getting-started.zh-TW.md +0 -132
- package/docs/getting-started.zh.md +0 -132
- package/docs/hooks-api.ja.md +0 -214
- package/docs/hooks-api.md +0 -214
- package/docs/hooks-api.zh-TW.md +0 -214
- package/docs/hooks-api.zh.md +0 -214
- package/docs/how-to-guides.ja.md +0 -413
- package/docs/how-to-guides.md +0 -413
- package/docs/how-to-guides.zh-TW.md +0 -413
- package/docs/how-to-guides.zh.md +0 -413
- package/docs/overview.ja.md +0 -51
- package/docs/overview.md +0 -51
- package/docs/overview.zh-TW.md +0 -51
- package/docs/overview.zh.md +0 -51
- package/glossary.md +0 -12
- package/src/@types/index.ts +0 -230
- package/src/@types/shims.d.ts +0 -18
- package/src/BlockletStudio/README.md +0 -116
- package/src/BlockletStudio/index.tsx +0 -145
- package/src/ComponentInstaller/ComponentInstaller.stories.jsx +0 -16
- package/src/ComponentInstaller/index.jsx +0 -207
- package/src/ComponentInstaller/installer-item.jsx +0 -129
- package/src/ComponentInstaller/locales.js +0 -22
- package/src/ComponentInstaller/use-component-installed.js +0 -88
- package/src/ComponentManager/components/add-component.tsx +0 -136
- package/src/ComponentManager/components/check-component.tsx +0 -3
- package/src/ComponentManager/components/publish-component.tsx +0 -90
- package/src/ComponentManager/components/resource-dialog.tsx +0 -91
- package/src/ComponentManager/index.tsx +0 -3
- package/src/ComponentManager/libs/locales.ts +0 -15
- package/src/Dashboard/Dashboard.stories.jsx +0 -20
- package/src/Dashboard/app-shell/app-badge.stories.tsx +0 -64
- package/src/Dashboard/app-shell/app-badge.tsx +0 -94
- package/src/Dashboard/app-shell/app-header.tsx +0 -104
- package/src/Dashboard/app-shell/app-info-context.tsx +0 -182
- package/src/Dashboard/app-shell/badges/app-badge-default.tsx +0 -130
- package/src/Dashboard/app-shell/badges/app-badge-did.tsx +0 -28
- package/src/Dashboard/app-shell/badges/app-badge-state.tsx +0 -40
- package/src/Dashboard/app-shell/badges/app-badge-switch.tsx +0 -72
- package/src/Dashboard/app-shell/badges/app-badge-version.tsx +0 -60
- package/src/Dashboard/app-shell/index.ts +0 -5
- package/src/Dashboard/index.jsx +0 -184
- package/src/Footer/Footer.stories.jsx +0 -33
- package/src/Footer/brand.jsx +0 -81
- package/src/Footer/copyright.jsx +0 -22
- package/src/Footer/index.jsx +0 -111
- package/src/Footer/internal-footer.jsx +0 -139
- package/src/Footer/layout/plain.jsx +0 -55
- package/src/Footer/layout/row.jsx +0 -43
- package/src/Footer/layout/standard.jsx +0 -114
- package/src/Footer/links.jsx +0 -321
- package/src/Footer/social-media.jsx +0 -55
- package/src/Header/Header.stories.jsx +0 -30
- package/src/Header/index.tsx +0 -259
- package/src/Icon/Icon.stories.jsx +0 -12
- package/src/Icon/index.tsx +0 -87
- package/src/Notifications/Snackbar.tsx +0 -261
- package/src/Notifications/hooks/use-title.tsx +0 -254
- package/src/Notifications/hooks/use-width.tsx +0 -16
- package/src/Notifications/utils.ts +0 -246
- package/src/UserCenter/assets/banner.png +0 -0
- package/src/UserCenter/components/config-inviter.tsx +0 -48
- package/src/UserCenter/components/config-profile.tsx +0 -99
- package/src/UserCenter/components/danger-zone.tsx +0 -82
- package/src/UserCenter/components/editable-field.tsx +0 -273
- package/src/UserCenter/components/fallback.tsx +0 -57
- package/src/UserCenter/components/nft-preview.tsx +0 -84
- package/src/UserCenter/components/nft.tsx +0 -279
- package/src/UserCenter/components/notification.tsx +0 -319
- package/src/UserCenter/components/passport.tsx +0 -107
- package/src/UserCenter/components/privacy.tsx +0 -120
- package/src/UserCenter/components/settings.tsx +0 -170
- package/src/UserCenter/components/status-dialog/date-picker.tsx +0 -77
- package/src/UserCenter/components/status-dialog/index.tsx +0 -293
- package/src/UserCenter/components/status-selector/duration-menu.tsx +0 -90
- package/src/UserCenter/components/status-selector/index.tsx +0 -58
- package/src/UserCenter/components/status-selector/menu-item.tsx +0 -56
- package/src/UserCenter/components/storage/action.tsx +0 -49
- package/src/UserCenter/components/storage/connected.tsx +0 -61
- package/src/UserCenter/components/storage/delete.tsx +0 -72
- package/src/UserCenter/components/storage/disconnect.tsx +0 -40
- package/src/UserCenter/components/storage/icons/empty-spaces-nft.svg +0 -1
- package/src/UserCenter/components/storage/icons/long-arrow.svg +0 -5
- package/src/UserCenter/components/storage/icons/space-connected.svg +0 -3
- package/src/UserCenter/components/storage/icons/space-disconnect.svg +0 -3
- package/src/UserCenter/components/storage/index.tsx +0 -41
- package/src/UserCenter/components/storage/preview-nft.tsx +0 -72
- package/src/UserCenter/components/third-party-login/index.tsx +0 -199
- package/src/UserCenter/components/third-party-login/third-party-item.tsx +0 -296
- package/src/UserCenter/components/user-center.tsx +0 -787
- package/src/UserCenter/components/user-info/address.tsx +0 -143
- package/src/UserCenter/components/user-info/index.tsx +0 -4
- package/src/UserCenter/components/user-info/link-preview-input.tsx +0 -274
- package/src/UserCenter/components/user-info/metadata.tsx +0 -658
- package/src/UserCenter/components/user-info/social-actions/chat.tsx +0 -43
- package/src/UserCenter/components/user-info/social-actions/follow.tsx +0 -23
- package/src/UserCenter/components/user-info/social-actions/index.tsx +0 -17
- package/src/UserCenter/components/user-info/switch-role.tsx +0 -42
- package/src/UserCenter/components/user-info/timezone-select.tsx +0 -119
- package/src/UserCenter/components/user-info/user-basic-info.tsx +0 -292
- package/src/UserCenter/components/user-info/user-info-item.tsx +0 -54
- package/src/UserCenter/components/user-info/user-info.tsx +0 -91
- package/src/UserCenter/components/user-info/user-status.tsx +0 -234
- package/src/UserCenter/components/user-info/utils.ts +0 -320
- package/src/UserCenter/components/webhook-item.tsx +0 -248
- package/src/UserCenter/index.tsx +0 -1
- package/src/UserCenter/libs/locales.ts +0 -378
- package/src/UserCenter/libs/utils.ts +0 -30
- package/src/UserSessions/components/user-session-info.tsx +0 -78
- package/src/UserSessions/components/user-sessions.tsx +0 -545
- package/src/UserSessions/index.tsx +0 -1
- package/src/UserSessions/libs/locales.ts +0 -60
- package/src/UserSessions/libs/utils.ts +0 -82
- package/src/blocklets.js +0 -195
- package/src/common/domain-warning.jsx +0 -178
- package/src/common/header-addons.jsx +0 -119
- package/src/common/link-blocker.jsx +0 -20
- package/src/common/notification-addon.jsx +0 -135
- package/src/common/org-switch/avatar-uploader.jsx +0 -271
- package/src/common/org-switch/create.jsx +0 -267
- package/src/common/org-switch/index.jsx +0 -407
- package/src/common/org-switch/locales.js +0 -52
- package/src/common/org-switch/use-org.jsx +0 -79
- package/src/common/overridable-theme-provider.jsx +0 -17
- package/src/common/wallet-hidden-topbar.js +0 -14
- package/src/common/wizard-modal.jsx +0 -200
- package/src/common/ws.js +0 -68
- package/src/contexts/config-user-space.tsx +0 -88
- package/src/contexts/user-followers.tsx +0 -54
- package/src/hooks/use-follow.tsx +0 -75
- package/src/hooks/use-mobile.tsx +0 -6
- package/src/index.ts +0 -16
- package/src/libs/constant.ts +0 -1
- package/src/libs/spaces.tsx +0 -18
- package/src/libs/with-hide-when-embed.tsx +0 -24
- package/src/types.js +0 -45
- package/src/utils.js +0 -161
- package/vite.config.mjs +0 -34
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { Box, BoxProps, Skeleton, styled, Typography } from '@mui/material';
|
|
2
|
-
import { Icon } from '@iconify/react';
|
|
3
|
-
import { TBox } from '@arcblock/ux/lib/MuiWrap';
|
|
4
|
-
import { Link } from 'react-router-dom';
|
|
5
|
-
|
|
6
|
-
export const isExternal = (to: string = ''): boolean => {
|
|
7
|
-
return to.startsWith('http:') || to.startsWith('https:');
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const isSameOrigin = (to: string): boolean => {
|
|
11
|
-
try {
|
|
12
|
-
const url = new URL(to);
|
|
13
|
-
return url.origin === window.location.origin;
|
|
14
|
-
} catch {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const StateIcon = styled('span')<{ color: string }>(({ theme, color }) => {
|
|
20
|
-
return {
|
|
21
|
-
position: 'relative',
|
|
22
|
-
display: 'inline-block',
|
|
23
|
-
width: theme.spacing(1),
|
|
24
|
-
height: theme.spacing(1),
|
|
25
|
-
borderRadius: '50%',
|
|
26
|
-
backgroundColor: color,
|
|
27
|
-
marginRight: theme.spacing(1),
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
export const StyledBadge = styled(Box)(({ theme }) => ({
|
|
31
|
-
position: 'relative',
|
|
32
|
-
display: 'inline-flex',
|
|
33
|
-
alignItems: 'center',
|
|
34
|
-
height: theme.spacing(3),
|
|
35
|
-
paddingLeft: theme.spacing(1.5),
|
|
36
|
-
paddingRight: theme.spacing(1.5),
|
|
37
|
-
border: '1px solid',
|
|
38
|
-
borderColor: theme.palette.divider,
|
|
39
|
-
borderRadius: (theme.shape.borderRadius as number) * 0.5,
|
|
40
|
-
fontSize: 12,
|
|
41
|
-
overflow: 'hidden',
|
|
42
|
-
'& .app-badge-label': {
|
|
43
|
-
display: 'inline-flex',
|
|
44
|
-
gap: theme.spacing(1),
|
|
45
|
-
alignItems: 'center',
|
|
46
|
-
lineHeight: theme.spacing(3),
|
|
47
|
-
marginLeft: theme.spacing(-1.5),
|
|
48
|
-
paddingLeft: theme.spacing(1.5),
|
|
49
|
-
marginRight: theme.spacing(1),
|
|
50
|
-
fontSize: 12,
|
|
51
|
-
backgroundColor: theme.palette.grey[100],
|
|
52
|
-
color: theme.palette.text.secondary,
|
|
53
|
-
'&::after': {
|
|
54
|
-
content: '""',
|
|
55
|
-
height: theme.spacing(3),
|
|
56
|
-
borderRight: '1px solid',
|
|
57
|
-
borderColor: theme.palette.divider,
|
|
58
|
-
backgroundColor: theme.palette.grey[100],
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
'& .app-badge-value': {
|
|
62
|
-
color: theme.palette.text.primary,
|
|
63
|
-
fontSize: 12,
|
|
64
|
-
},
|
|
65
|
-
})) as typeof TBox;
|
|
66
|
-
|
|
67
|
-
export interface BadgeContainerProps extends Omit<BoxProps, 'to'> {
|
|
68
|
-
loading?: boolean;
|
|
69
|
-
to?: string;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
export function BadgeContainer({ loading = false, children = null, to = '', ...rest }: BadgeContainerProps) {
|
|
73
|
-
const container = (
|
|
74
|
-
<StyledBadge className="app-badge" component={to ? 'a' : 'div'} href={to} {...rest}>
|
|
75
|
-
{children}
|
|
76
|
-
</StyledBadge>
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
if (loading) {
|
|
80
|
-
return <Skeleton variant="rounded">{container}</Skeleton>;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
if (to) {
|
|
84
|
-
if (isExternal(to)) {
|
|
85
|
-
const target = isSameOrigin(to) ? '_self' : '_blank';
|
|
86
|
-
|
|
87
|
-
// 外部链接跳转
|
|
88
|
-
return (
|
|
89
|
-
<StyledBadge className="app-badge" component="a" href={to} target={target} rel="noreferrer noopener" {...rest}>
|
|
90
|
-
{children}
|
|
91
|
-
</StyledBadge>
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
// 内部路由跳转
|
|
96
|
-
return (
|
|
97
|
-
<StyledBadge className="app-badge" component={Link} to={to} {...rest}>
|
|
98
|
-
{children}
|
|
99
|
-
</StyledBadge>
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// 无跳转
|
|
104
|
-
return (
|
|
105
|
-
<StyledBadge className="app-badge" component="div" {...rest}>
|
|
106
|
-
{children}
|
|
107
|
-
</StyledBadge>
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface AppBadgeDefaultProps extends BadgeContainerProps {
|
|
112
|
-
icon?: string;
|
|
113
|
-
label?: string;
|
|
114
|
-
value?: string | number;
|
|
115
|
-
round?: number;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export function AppBadgeDefault({ icon = '', label = '', value = '', loading = false, ...rest }: AppBadgeDefaultProps) {
|
|
119
|
-
return (
|
|
120
|
-
<BadgeContainer loading={loading} {...rest}>
|
|
121
|
-
{label && (
|
|
122
|
-
<Typography className="app-badge-label">
|
|
123
|
-
{icon && <Icon icon={icon} />}
|
|
124
|
-
{label}
|
|
125
|
-
</Typography>
|
|
126
|
-
)}
|
|
127
|
-
<Typography className="app-badge-value">{value}</Typography>
|
|
128
|
-
</BadgeContainer>
|
|
129
|
-
);
|
|
130
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { useCreation } from 'ahooks';
|
|
2
|
-
import { Typography } from '@mui/material';
|
|
3
|
-
import { isEthereumDid } from '@arcblock/ux/lib/Util';
|
|
4
|
-
import DidAddress from '@arcblock/ux/lib/Address';
|
|
5
|
-
import { AppBadgeDefaultProps, BadgeContainer } from './app-badge-default';
|
|
6
|
-
|
|
7
|
-
export interface AppBadgeDIDProps extends Omit<AppBadgeDefaultProps, 'value'> {
|
|
8
|
-
value?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export function AppBadgeDID({ value = '', loading = false, ...rest }: AppBadgeDIDProps) {
|
|
12
|
-
const label = useCreation(() => {
|
|
13
|
-
const isEthDid = isEthereumDid(value);
|
|
14
|
-
|
|
15
|
-
return `DID:${isEthDid ? 'ETH' : 'ABT'}`;
|
|
16
|
-
}, [value]);
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<BadgeContainer loading={loading} {...rest}>
|
|
20
|
-
<Typography className="app-badge-label">{label}</Typography>
|
|
21
|
-
<Typography className="app-badge-value">
|
|
22
|
-
<DidAddress inline size={14} compact responsive={false}>
|
|
23
|
-
{value}
|
|
24
|
-
</DidAddress>
|
|
25
|
-
</Typography>
|
|
26
|
-
</BadgeContainer>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { useTheme, alpha, Typography, styled } from '@mui/material';
|
|
2
|
-
import { AppBadgeDefaultProps, BadgeContainer } from './app-badge-default';
|
|
3
|
-
import { BadgeColor, getBgColor, getTextColor } from './app-badge-version';
|
|
4
|
-
|
|
5
|
-
const StateIcon = styled('span')<{ color: string }>(({ theme, color }) => {
|
|
6
|
-
return {
|
|
7
|
-
position: 'relative',
|
|
8
|
-
display: 'inline-block',
|
|
9
|
-
width: theme.spacing(1),
|
|
10
|
-
height: theme.spacing(1),
|
|
11
|
-
borderRadius: '50%',
|
|
12
|
-
backgroundColor: color,
|
|
13
|
-
marginRight: theme.spacing(1),
|
|
14
|
-
};
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export interface AppBadgeStateProps extends AppBadgeDefaultProps {
|
|
18
|
-
color?: BadgeColor;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export function AppBadgeState({ value = '', color = 'primary', loading = false, ...rest }: AppBadgeStateProps) {
|
|
22
|
-
const theme = useTheme();
|
|
23
|
-
const txtcolor = getTextColor(theme, color);
|
|
24
|
-
const bgcolor = getBgColor(theme, color);
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<BadgeContainer
|
|
28
|
-
loading={loading}
|
|
29
|
-
sx={{
|
|
30
|
-
borderColor: alpha(txtcolor, 0.2),
|
|
31
|
-
bgcolor,
|
|
32
|
-
}}
|
|
33
|
-
{...rest}>
|
|
34
|
-
<StateIcon color={getTextColor(theme, color)} />
|
|
35
|
-
<Typography className="app-badge-value" style={{ color: txtcolor }}>
|
|
36
|
-
{value}
|
|
37
|
-
</Typography>
|
|
38
|
-
</BadgeContainer>
|
|
39
|
-
);
|
|
40
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { Box, Typography, useTheme } from '@mui/material';
|
|
2
|
-
import { useMemoizedFn } from 'ahooks';
|
|
3
|
-
import { AppBadgeDefaultProps, BadgeContainer } from './app-badge-default';
|
|
4
|
-
|
|
5
|
-
export interface AppBadgeSwitchProps extends Omit<AppBadgeDefaultProps, 'value' | 'onChange'> {
|
|
6
|
-
value?: unknown;
|
|
7
|
-
trueValue?: unknown;
|
|
8
|
-
falseValue?: unknown;
|
|
9
|
-
onChange?: (checked: boolean) => void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function AppBadgeSwitch({
|
|
13
|
-
label = '',
|
|
14
|
-
value = undefined,
|
|
15
|
-
trueValue = true,
|
|
16
|
-
falseValue = false,
|
|
17
|
-
loading = false,
|
|
18
|
-
onChange = undefined,
|
|
19
|
-
...rest
|
|
20
|
-
}: AppBadgeSwitchProps) {
|
|
21
|
-
const theme = useTheme();
|
|
22
|
-
let checked = false;
|
|
23
|
-
const handleClick = useMemoizedFn(() => onChange?.(!checked));
|
|
24
|
-
|
|
25
|
-
if (value === trueValue) {
|
|
26
|
-
checked = true;
|
|
27
|
-
} else if (value === falseValue) {
|
|
28
|
-
checked = false;
|
|
29
|
-
} else {
|
|
30
|
-
checked = Boolean(value);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<BadgeContainer
|
|
35
|
-
loading={loading}
|
|
36
|
-
sx={{
|
|
37
|
-
cursor: 'pointer',
|
|
38
|
-
backgroundColor: checked ? 'primary.main' : 'grey.100',
|
|
39
|
-
borderColor: checked ? 'primary.main' : 'divider',
|
|
40
|
-
transition: 'background-color 0.3s ease',
|
|
41
|
-
}}
|
|
42
|
-
onClick={handleClick}
|
|
43
|
-
{...rest}>
|
|
44
|
-
{/* 内容 */}
|
|
45
|
-
<Typography
|
|
46
|
-
sx={{
|
|
47
|
-
fontWeight: 400,
|
|
48
|
-
paddingLeft: checked ? 0 : theme.spacing(2.5),
|
|
49
|
-
paddingRight: checked ? theme.spacing(2.5) : 0,
|
|
50
|
-
color: checked ? 'common.white' : 'text.secondary',
|
|
51
|
-
transition: 'color 0.3s ease',
|
|
52
|
-
}}>
|
|
53
|
-
{label}
|
|
54
|
-
</Typography>
|
|
55
|
-
{/* 滑块 */}
|
|
56
|
-
<Box
|
|
57
|
-
sx={{
|
|
58
|
-
width: theme.spacing(2.5),
|
|
59
|
-
height: theme.spacing(2.5),
|
|
60
|
-
borderRadius: `${(theme.shape.borderRadius as number) * 0.5}px`,
|
|
61
|
-
backgroundColor: 'common.white',
|
|
62
|
-
position: 'absolute',
|
|
63
|
-
top: '50%',
|
|
64
|
-
left: checked ? `calc(100% - ${theme.spacing(3)})` : theme.spacing(0.5),
|
|
65
|
-
transform: 'translateY(-50%)',
|
|
66
|
-
transition: 'left 0.3s ease',
|
|
67
|
-
boxShadow: 1,
|
|
68
|
-
}}
|
|
69
|
-
/>
|
|
70
|
-
</BadgeContainer>
|
|
71
|
-
);
|
|
72
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { LiteralUnion } from 'type-fest';
|
|
2
|
-
import { alpha, Theme, Typography, useTheme } from '@mui/material';
|
|
3
|
-
import { Icon } from '@iconify/react';
|
|
4
|
-
import { AppBadgeDefaultProps, BadgeContainer } from './app-badge-default';
|
|
5
|
-
|
|
6
|
-
export type ColorKey = 'primary' | 'info' | 'success' | 'error' | 'warning';
|
|
7
|
-
export type BadgeColor = LiteralUnion<ColorKey, string>;
|
|
8
|
-
export const colorMap: Record<ColorKey, (theme: Theme) => { main: string }> = {
|
|
9
|
-
primary: (theme) => theme.palette.primary,
|
|
10
|
-
info: (theme) => theme.palette.info,
|
|
11
|
-
success: (theme) => theme.palette.success,
|
|
12
|
-
error: (theme) => theme.palette.error,
|
|
13
|
-
warning: (theme) => theme.palette.warning,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const getBgColor = (theme: Theme, color: BadgeColor): string => {
|
|
17
|
-
if (colorMap[color as ColorKey]) {
|
|
18
|
-
const c = colorMap[color as ColorKey](theme).main;
|
|
19
|
-
return alpha(c, 0.1);
|
|
20
|
-
}
|
|
21
|
-
return alpha(color, 0.1);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export const getTextColor = (theme: Theme, color: BadgeColor): string => {
|
|
25
|
-
if (colorMap[color as ColorKey]) {
|
|
26
|
-
return colorMap[color as ColorKey](theme).main;
|
|
27
|
-
}
|
|
28
|
-
return color;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export interface AppBadgeVersionProps extends AppBadgeDefaultProps {
|
|
32
|
-
color?: string | ColorKey;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function AppBadgeVersion({
|
|
36
|
-
icon = '',
|
|
37
|
-
value = '',
|
|
38
|
-
color = 'info',
|
|
39
|
-
loading = false,
|
|
40
|
-
...rest
|
|
41
|
-
}: AppBadgeVersionProps) {
|
|
42
|
-
const theme = useTheme();
|
|
43
|
-
const txtcolor = getTextColor(theme, color);
|
|
44
|
-
const bgcolor = getBgColor(theme, color);
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<BadgeContainer
|
|
48
|
-
loading={loading}
|
|
49
|
-
sx={{
|
|
50
|
-
borderColor: alpha(txtcolor, 0.2),
|
|
51
|
-
bgcolor,
|
|
52
|
-
}}
|
|
53
|
-
{...rest}>
|
|
54
|
-
<Icon icon={icon || 'lucide:orbit'} style={{ marginRight: 6 }} />
|
|
55
|
-
<Typography className="app-badge-value" style={{ color: txtcolor }}>
|
|
56
|
-
v {value}
|
|
57
|
-
</Typography>
|
|
58
|
-
</BadgeContainer>
|
|
59
|
-
);
|
|
60
|
-
}
|
package/src/Dashboard/index.jsx
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
import 'iconify-icon';
|
|
2
|
-
|
|
3
|
-
/* eslint-disable no-shadow */
|
|
4
|
-
import { useMemo, useLayoutEffect, use } from 'react';
|
|
5
|
-
import PropTypes from 'prop-types';
|
|
6
|
-
import { SessionContext } from '@arcblock/did-connect-react/lib/Session';
|
|
7
|
-
import { useLocaleContext } from '@arcblock/ux/lib/Locale/context';
|
|
8
|
-
import UxImg from '@arcblock/ux/lib/Img';
|
|
9
|
-
import UxDashboard from '@arcblock/ux/lib/Layout/dashboard';
|
|
10
|
-
import useBlockletLogo from '@arcblock/ux/lib/hooks/use-blocklet-logo';
|
|
11
|
-
import { BlockletMetaProps, SessionManagerProps } from '../types';
|
|
12
|
-
import { mapRecursive, flatRecursive, matchPaths } from '../utils';
|
|
13
|
-
import { publicPath, formatBlockletInfo, getLocalizedNavigation, filterNavByRole } from '../blocklets';
|
|
14
|
-
import HeaderAddons from '../common/header-addons';
|
|
15
|
-
import { useWalletHiddenTopbar } from '../common/wallet-hidden-topbar';
|
|
16
|
-
import { AppHeader, AppBadge, AppInfoProvider, useAppInfo } from './app-shell';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* 专门用于 (composable) blocklet 的 Dashboard 组件, 解析 blocklet meta 中 section 为 dashboard 的 navigation 数据, 渲染一个 UX Dashboard
|
|
20
|
-
*/
|
|
21
|
-
function Dashboard({
|
|
22
|
-
meta = undefined,
|
|
23
|
-
fallbackUrl = publicPath,
|
|
24
|
-
invalidPathFallback = null,
|
|
25
|
-
headerAddons = undefined,
|
|
26
|
-
sessionManagerProps = {
|
|
27
|
-
showRole: true,
|
|
28
|
-
// dashboard 默认退出登录行为: 跳转到 (root) blocklet 首页
|
|
29
|
-
onLogout: () => {
|
|
30
|
-
// 这里是安全的
|
|
31
|
-
window.location.href = publicPath;
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
links = [],
|
|
35
|
-
showDomainWarningDialog = true,
|
|
36
|
-
appPath = undefined,
|
|
37
|
-
appTab = undefined,
|
|
38
|
-
onAppTabChange = undefined,
|
|
39
|
-
children = undefined,
|
|
40
|
-
...rest
|
|
41
|
-
}) {
|
|
42
|
-
useWalletHiddenTopbar();
|
|
43
|
-
const sessionCtx = use(SessionContext);
|
|
44
|
-
const user = sessionCtx?.session?.user;
|
|
45
|
-
const userRole = user?.role;
|
|
46
|
-
const { locale, defaultLocale } = useLocaleContext() || {};
|
|
47
|
-
const formattedBlocklet = useMemo(() => {
|
|
48
|
-
const blocklet = Object.assign({}, window.blocklet, meta);
|
|
49
|
-
try {
|
|
50
|
-
return formatBlockletInfo(blocklet);
|
|
51
|
-
} catch (e) {
|
|
52
|
-
console.error('Failed to format blocklet info', e, blocklet);
|
|
53
|
-
return blocklet;
|
|
54
|
-
}
|
|
55
|
-
}, [meta]);
|
|
56
|
-
const { localizedNav, flattened, matchedIndex } = useMemo(() => {
|
|
57
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
58
|
-
let localizedNav =
|
|
59
|
-
getLocalizedNavigation({
|
|
60
|
-
navigation: formattedBlocklet?.navigation?.dashboard,
|
|
61
|
-
locale,
|
|
62
|
-
defaultLocale,
|
|
63
|
-
}) || [];
|
|
64
|
-
// 根据 role 筛选 nav 数据
|
|
65
|
-
localizedNav = filterNavByRole(localizedNav, userRole);
|
|
66
|
-
// 将 nav 数据处理成 ux dashboard 需要的格式
|
|
67
|
-
localizedNav = mapRecursive(
|
|
68
|
-
localizedNav,
|
|
69
|
-
(item) => {
|
|
70
|
-
let icon = null;
|
|
71
|
-
|
|
72
|
-
if (item.icon) {
|
|
73
|
-
if (item.icon.startsWith('http') || item.icon.startsWith('data:')) {
|
|
74
|
-
icon = <UxImg src={item.icon} />;
|
|
75
|
-
} else {
|
|
76
|
-
icon = <iconify-icon height="100%" width="100%" icon={item.icon} />;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
return {
|
|
81
|
-
id: item.id,
|
|
82
|
-
title: item.title,
|
|
83
|
-
url: item.link,
|
|
84
|
-
icon,
|
|
85
|
-
// https://github.com/ArcBlock/ux/issues/755#issuecomment-1208692620
|
|
86
|
-
external: true,
|
|
87
|
-
children: item.items,
|
|
88
|
-
};
|
|
89
|
-
},
|
|
90
|
-
'items'
|
|
91
|
-
);
|
|
92
|
-
// 展平后使用 matchPaths 检测 link#active 状态
|
|
93
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
94
|
-
const flattened = flatRecursive(localizedNav).filter((item) => !!item.url);
|
|
95
|
-
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
96
|
-
const matchedIndex = matchPaths(flattened.map((item) => item.url));
|
|
97
|
-
if (matchedIndex !== -1) {
|
|
98
|
-
flattened[matchedIndex].active = true;
|
|
99
|
-
}
|
|
100
|
-
return { localizedNav, flattened, matchedIndex };
|
|
101
|
-
}, [formattedBlocklet, locale, defaultLocale, userRole]);
|
|
102
|
-
|
|
103
|
-
const allLinks = typeof links === 'function' ? links(localizedNav) : [...localizedNav, ...links];
|
|
104
|
-
const appLogo = useBlockletLogo({
|
|
105
|
-
meta,
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
// 页面初始化时, 如果当前用户没有权限访问任何导航菜单 (比如登录时未提供 VC 导致无权限), 则跳转到 fallbackUrl
|
|
109
|
-
// 未认证 (user 为空) 时不做处理, 这种情况的页面跳转逻辑一般由应用自行处理
|
|
110
|
-
useLayoutEffect(() => {
|
|
111
|
-
if (!!user && !flattened?.length && fallbackUrl) {
|
|
112
|
-
// 这里是安全的
|
|
113
|
-
window.location.href = fallbackUrl;
|
|
114
|
-
}
|
|
115
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
116
|
-
}, [fallbackUrl]);
|
|
117
|
-
|
|
118
|
-
// 导航菜单变动且存在可用菜单但无匹配项时 (如切换 passport), 跳转到首个菜单项
|
|
119
|
-
useLayoutEffect(() => {
|
|
120
|
-
if (!!user && !!flattened?.length && matchedIndex === -1) {
|
|
121
|
-
if (invalidPathFallback) {
|
|
122
|
-
invalidPathFallback();
|
|
123
|
-
} else {
|
|
124
|
-
// FIXME: @zhanghan 暂时取消跳转首个 url 的行为
|
|
125
|
-
// window.location.href = flattened[0]?.url || publicPath;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
129
|
-
}, [invalidPathFallback, flattened, matchedIndex]);
|
|
130
|
-
|
|
131
|
-
if (!formattedBlocklet.appName) {
|
|
132
|
-
return null;
|
|
133
|
-
}
|
|
134
|
-
const { appName } = formattedBlocklet;
|
|
135
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
136
|
-
const _headerAddons = (
|
|
137
|
-
<HeaderAddons
|
|
138
|
-
formattedBlocklet={formattedBlocklet}
|
|
139
|
-
addons={headerAddons}
|
|
140
|
-
sessionManagerProps={sessionManagerProps}
|
|
141
|
-
showDomainWarningDialog={showDomainWarningDialog}
|
|
142
|
-
/>
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
return (
|
|
146
|
-
<UxDashboard
|
|
147
|
-
title={appName}
|
|
148
|
-
fullWidth
|
|
149
|
-
sidebarWidth={128}
|
|
150
|
-
legacy={false}
|
|
151
|
-
links={allLinks}
|
|
152
|
-
{...rest}
|
|
153
|
-
headerProps={{
|
|
154
|
-
homeLink: publicPath,
|
|
155
|
-
logo: <img src={appLogo} alt="logo" />,
|
|
156
|
-
addons: _headerAddons,
|
|
157
|
-
...rest.headerProps,
|
|
158
|
-
}}>
|
|
159
|
-
<AppInfoProvider path={appPath} currentTab={appTab} meta={meta}>
|
|
160
|
-
<AppHeader onTabChange={onAppTabChange} />
|
|
161
|
-
{children}
|
|
162
|
-
</AppInfoProvider>
|
|
163
|
-
</UxDashboard>
|
|
164
|
-
);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
Dashboard.propTypes = {
|
|
168
|
-
meta: BlockletMetaProps,
|
|
169
|
-
// 如果当前用户没有权限访问任何导航菜单, 则自动跳转到 fallbackUrl, 默认值为 publicPath, 设置为 null 表示禁用自动跳转
|
|
170
|
-
fallbackUrl: PropTypes.string,
|
|
171
|
-
// 当前路径未匹配任何 nav links 时的 fallback, 默认行为跳转到首个可用的 nav link
|
|
172
|
-
invalidPathFallback: PropTypes.func,
|
|
173
|
-
headerAddons: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
|
|
174
|
-
sessionManagerProps: SessionManagerProps,
|
|
175
|
-
links: PropTypes.oneOfType([PropTypes.array, PropTypes.func]),
|
|
176
|
-
showDomainWarningDialog: PropTypes.bool,
|
|
177
|
-
appPath: PropTypes.string,
|
|
178
|
-
appTab: PropTypes.string,
|
|
179
|
-
onAppTabChange: PropTypes.func,
|
|
180
|
-
children: PropTypes.node,
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
export { AppHeader, AppBadge, AppInfoProvider, useAppInfo };
|
|
184
|
-
export default Dashboard;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import Brand from './demo/brand';
|
|
2
|
-
import Links from './demo/links';
|
|
3
|
-
import SocialMediaIcons from './demo/social-media-icons';
|
|
4
|
-
import Copyright from './demo/copyright';
|
|
5
|
-
import Footer from './demo/footer';
|
|
6
|
-
import ArcblockSite from './demo/arcblock-site';
|
|
7
|
-
import AigneSite from './demo/aigne-site';
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: 'Blocklet-UI-React/Footer',
|
|
11
|
-
|
|
12
|
-
parameters: {
|
|
13
|
-
layout: 'fullscreen',
|
|
14
|
-
docs: {
|
|
15
|
-
description: {
|
|
16
|
-
component:
|
|
17
|
-
'Used to render a page footer for Blocklet based on Blocklet runtime information. It requires a blocklet environment to work properly.',
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
Footer.argTypes = {
|
|
24
|
-
layout: { control: 'select', options: ['auto', 'standard', 'plain'] },
|
|
25
|
-
emptyNavData: { control: 'boolean', defaultValue: false },
|
|
26
|
-
overrideTheme: { control: 'boolean', defaultValue: false },
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
ArcblockSite.argTypes = {
|
|
30
|
-
locale: { control: 'select', options: ['en', 'zh'] },
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export { Brand, Links, SocialMediaIcons, Copyright, Footer, ArcblockSite, AigneSite };
|
package/src/Footer/brand.jsx
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { isValidElement } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import { styled } from '@arcblock/ux/lib/Theme';
|
|
4
|
-
import { Box } from '@mui/material';
|
|
5
|
-
|
|
6
|
-
export default function Brand({ name = '', logo = '', description = '', ...rest }) {
|
|
7
|
-
if (!name && !logo && !description) {
|
|
8
|
-
return null;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const logoElement = isValidElement(logo) ? logo : <img src={logo} alt={name} />;
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<Root {...rest}>
|
|
15
|
-
<div>
|
|
16
|
-
{logo && (
|
|
17
|
-
<Box component="a" href="/" className="footer-brand-logo">
|
|
18
|
-
{logoElement}
|
|
19
|
-
</Box>
|
|
20
|
-
)}
|
|
21
|
-
{name && <div className="footer-brand-name">{name}</div>}
|
|
22
|
-
</div>
|
|
23
|
-
{description && <div className="footer-brand-desc">{description}</div>}
|
|
24
|
-
</Root>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
Brand.propTypes = {
|
|
29
|
-
name: PropTypes.node,
|
|
30
|
-
logo: PropTypes.node,
|
|
31
|
-
description: PropTypes.string,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const Root = styled('div')`
|
|
35
|
-
display: flex;
|
|
36
|
-
flex-direction: column;
|
|
37
|
-
font-size: 14px;
|
|
38
|
-
a {
|
|
39
|
-
text-decoration: none;
|
|
40
|
-
color: inherit;
|
|
41
|
-
}
|
|
42
|
-
> div:first-of-type {
|
|
43
|
-
display: flex;
|
|
44
|
-
align-items: center;
|
|
45
|
-
}
|
|
46
|
-
.footer-brand-logo {
|
|
47
|
-
display: flex;
|
|
48
|
-
align-items: center;
|
|
49
|
-
margin-right: 12px;
|
|
50
|
-
line-height: 1;
|
|
51
|
-
img,
|
|
52
|
-
svg {
|
|
53
|
-
width: auto;
|
|
54
|
-
height: 40px;
|
|
55
|
-
max-height: 40px;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
.footer-brand-name {
|
|
59
|
-
font-size: 18px;
|
|
60
|
-
color: ${(props) => props.theme.palette.grey[900]};
|
|
61
|
-
}
|
|
62
|
-
.footer-brand-desc {
|
|
63
|
-
white-space: pre-line;
|
|
64
|
-
margin-top: 16px;
|
|
65
|
-
color: ${(props) => props.theme.palette.text.secondary};
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
${(props) => props.theme.breakpoints.down('sm')} {
|
|
69
|
-
width: auto;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
${(props) => props.theme.breakpoints.down('md')} {
|
|
73
|
-
.footer-brand-logo {
|
|
74
|
-
img,
|
|
75
|
-
svg {
|
|
76
|
-
height: 32px;
|
|
77
|
-
max-height: 32px;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
`;
|
package/src/Footer/copyright.jsx
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { styled } from '@arcblock/ux/lib/Theme';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
export default function Copyright({ owner = 'ArcBlock', year = `${new Date().getFullYear()}`, ...rest }) {
|
|
5
|
-
return (
|
|
6
|
-
<Root {...rest}>
|
|
7
|
-
Copyright © {year} {owner}
|
|
8
|
-
</Root>
|
|
9
|
-
);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
Copyright.propTypes = {
|
|
13
|
-
owner: PropTypes.string,
|
|
14
|
-
year: PropTypes.string,
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const Root = styled('p')`
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
margin: 0;
|
|
21
|
-
font-size: 13px;
|
|
22
|
-
`;
|