Skip to content

Commit c295d29

Browse files
committed
chore: update style
1 parent 1888f80 commit c295d29

File tree

11 files changed

+64
-39
lines changed

11 files changed

+64
-39
lines changed

packages/platform/src/app/routes/layout/Layout.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { useState } from 'react';
2-
import { Outlet } from 'react-router-dom';
1+
import { useEffect, useState } from 'react';
2+
import { Outlet, useLocation } from 'react-router-dom';
33

44
import { useDeviceQuery } from '../../hooks';
55
import styles from './Layout.module.scss';
@@ -21,6 +21,13 @@ export default function Layout(props: AppLayoutProps): JSX.Element | null {
2121

2222
const deviceMatched = useDeviceQuery();
2323
const [menuOpen, setMenuOpen] = useState(deviceMatched === 'desktop');
24+
const location = useLocation();
25+
26+
useEffect(() => {
27+
if (deviceMatched === 'phone') {
28+
setMenuOpen(false);
29+
}
30+
}, [deviceMatched, location]);
2431

2532
return (
2633
<>

packages/platform/src/app/routes/layout/header/Header.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030

3131
@include e(logo-title-wrapper) {
3232
overflow: hidden;
33+
transition: width var(--d-animation-duration-base) linear;
3334
}
3435

3536
@include e(logo-title) {
3637
white-space: nowrap;
37-
transition: width var(--d-animation-duration-base) linear;
3838
transform-origin: left;
3939

4040
@include font-size(1.5rem);

packages/platform/src/app/routes/layout/sidebar/Sidebar.module.scss

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,6 @@
1313

1414
@include e(menu) {
1515
width: 200px;
16-
17-
a {
18-
font: inherit;
19-
color: inherit;
20-
text-decoration: none;
21-
22-
&::after {
23-
position: absolute;
24-
inset: 0;
25-
content: '';
26-
}
27-
}
2816
}
2917

3018
@include e(drawer) {

packages/platform/src/app/routes/test/acl/ACL.module.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
@include b(acl) {
44
@include app-route;
55

6-
:global .d-card {
7-
margin-top: 20px;
8-
}
6+
display: flex;
7+
flex-direction: column;
8+
gap: 20px 0;
99

1010
@include e(button-container) {
1111
display: flex;

packages/platform/src/app/routes/test/acl/ACL.tsx

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import { useTranslation } from 'react-i18next';
33
import { useNavigate } from 'react-router-dom';
44

5-
import { DAlert, DButton, DCard, DTag } from '@react-devui/ui';
5+
import { DAlert, DButton, DCard, DTable, DTag } from '@react-devui/ui';
66

77
import { useACL } from '../../../../core';
88
import { AppRouteHeader } from '../../../components';
@@ -21,16 +21,25 @@ export default function ACL(): JSX.Element | null {
2121
</AppRouteHeader>
2222
<div className={styles['app-acl']}>
2323
<DAlert dTitle={t('routes.test.acl.Switch between different users to compare effects')} dType="info"></DAlert>
24-
<DCard>
25-
<DCard.Header>{t('routes.test.acl.ACL Data')}</DCard.Header>
26-
<DCard.Content>
27-
{JSON.stringify({
28-
full: acl.full,
29-
controls: acl.controls,
30-
controlMode: acl.controlMode,
31-
})}
32-
</DCard.Content>
33-
</DCard>
24+
<DTable dBorder>
25+
<table>
26+
<caption>{t('routes.test.acl.ACL Data')}</caption>
27+
<tbody>
28+
<tr>
29+
<DTable.Th>Full</DTable.Th>
30+
<DTable.Td>{String(acl.full)}</DTable.Td>
31+
</tr>
32+
<tr>
33+
<DTable.Th>Controls</DTable.Th>
34+
<DTable.Td>{acl.controls.join(', ') || '-'}</DTable.Td>
35+
</tr>
36+
<tr>
37+
<DTable.Th>ControlMode</DTable.Th>
38+
<DTable.Td>{acl.controlMode}</DTable.Td>
39+
</tr>
40+
</tbody>
41+
</table>
42+
</DTable>
3443
<DCard>
3544
<DCard.Content>
3645
<div className={styles['app-acl__button-container']}>

packages/platform/src/core/useHttp.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function useHttp() {
6666
switch (error.response.status) {
6767
case 401:
6868
ToastService.open({
69-
dContent: t('Not logged in or logged in has expired'),
69+
dContent: t('User not authorized'),
7070
dType: 'error',
7171
});
7272
navigate(LOGIN_PATH, { state: { [PREV_ROUTE_KEY]: location } });

packages/platform/src/core/useMenu.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function useMenu() {
3737
const title = t(tKey, { ns: 'title' });
3838
const obj: DMenuItem<string> = {
3939
id: item.path,
40-
title: item.type === 'item' ? React.createElement(Link, { tabIndex: -1, to: item.path }, title) : title,
40+
title: item.type === 'item' ? React.createElement(Link, { className: 'app-menu-link', tabIndex: -1, to: item.path }, title) : title,
4141
icon: item.icon ? React.createElement(item.icon) : undefined,
4242
type: item.type,
4343
};

packages/platform/src/i18n/resources.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"translation": {
44
"User has no menu": "User has no menu",
55
"Please contact the administrator": "Please contact the administrator",
6-
"Not logged in or logged in has expired": "Not logged in or logged in has expired",
6+
"User not authorized": "User not authorized",
77
"components": {
88
"language": {
99
"Change language": "Change language"
@@ -80,7 +80,7 @@
8080
"translation": {
8181
"User has no menu": "用户无菜单",
8282
"Please contact the administrator": "请联系管理员",
83-
"Not logged in or logged in has expired": "未登录或登录已过期",
83+
"User not authorized": "用户未授权",
8484
"components": {
8585
"language": {
8686
"Change language": "改变语言"

packages/platform/src/styles/_app.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,15 @@ body {
3434
color: var(--#{$variable-prefix}color-primary-darker);
3535
}
3636
}
37+
38+
.app-menu-link {
39+
font: inherit;
40+
color: inherit;
41+
text-decoration: none;
42+
43+
&::after {
44+
position: absolute;
45+
inset: 0;
46+
content: '';
47+
}
48+
}

packages/ui/src/components/fab/demos/4.Backtop.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { DFab } from '@react-devui/ui';
1717

1818
export default function Demo() {
1919
return (
20-
<DFab style={{ position: 'fixed', right: 100, bottom: 40 }}>
20+
<DFab style={{ position: 'fixed', right: 100, bottom: 40, zIndex: 910 }}>
2121
<DFab.Backtop dVariant="circle" />
2222
</DFab>
2323
);

0 commit comments

Comments
 (0)