Skip to content

Commit fc8df10

Browse files
fix(app): subItem, settings container (#1214)
2 parents 96b9b2b + 6931dd3 commit fc8df10

File tree

6 files changed

+23
-14
lines changed

6 files changed

+23
-14
lines changed

src/components/appMenu/SubMenu/SubMenu.module.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
$icon-size: 25px;
1+
$icon-size: 16px;
22

33
.subMenu {
44
// position: absolute;
@@ -24,7 +24,7 @@ $icon-size: 25px;
2424
gap: 7px;
2525
align-items: center;
2626
padding-left: 20px;
27-
font-size: 18px;
27+
font-size: 16px;
2828
// >div {
2929
// align-items: center;
3030
// flex-shrink: 0;

src/containers/application/Header/CurrentApp/ui/AppName/AppName.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import styles from './AppName.module.scss';
1010
function AppName() {
1111
let { pathname } = useLocation();
1212
const isRobot = pathname.includes('@') || pathname.includes('neuron/');
13+
const isOracle = pathname.includes('oracle');
1314

1415
if (isRobot) {
1516
const pathnameArr = pathname.replace(/^\/|\/$/g, '').split('/');
@@ -20,6 +21,10 @@ function AppName() {
2021
: findItem;
2122
}
2223

24+
if (isOracle) {
25+
pathname = routes.oracle.path;
26+
}
27+
2328
const value = findApp(getMenuItems(), pathname);
2429

2530
const content = value[0]?.name || CHAIN_ID;

src/pages/Settings/Layout/Layout.module.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ $size-columns: 200px;
44

55
.wrapper {
66
display: grid;
7-
grid-template-columns: $size-columns minmax($size-columns, calc(62% - $size-columns));
7+
grid-template-columns: $size-columns minmax($size-columns, 1fr);
88
grid-template-rows: 1fr;
99
justify-content: center;
1010

@@ -25,6 +25,7 @@ $size-columns: 200px;
2525

2626
> :nth-child(2) {
2727
left: -2px;
28+
margin-right: -2px;
2829
position: relative;
2930
overflow-x: auto;
3031
}

src/pages/Settings/Layout/Layout.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
import { Outlet } from 'react-router-dom';
22
import { Helmet } from 'react-helmet';
3+
import { MainContainer } from 'src/components';
34
import SettingsMenu from './SettingsMenu/SettingsMenu';
45
import styles from './Layout.module.scss';
56

67
function Layout() {
78
return (
8-
<div className={styles.wrapper}>
9-
<Helmet>
10-
<title>setting | cyb</title>
11-
</Helmet>
9+
<MainContainer>
10+
<div className={styles.wrapper}>
11+
<Helmet>
12+
<title>setting | cyb</title>
13+
</Helmet>
1214

13-
<SettingsMenu />
15+
<SettingsMenu />
1416

15-
<Outlet />
16-
</div>
17+
<Outlet />
18+
</div>
19+
</MainContainer>
1720
);
1821
}
1922

src/utils/appsMenu/appsMenu.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import { CHAIN_ID } from 'src/constants/config';
1616
const getMenuItems = () => {
1717
const listItemMenu = [
1818
{
19-
name: 'My robot',
19+
name: 'robot',
2020
icon: robot,
2121
to: '/robot',
2222
subItems: [
@@ -39,7 +39,7 @@ const getMenuItems = () => {
3939
{
4040
name: 'Particles',
4141
to: '/particles',
42-
icon: require('./images/horizontal-traffic-light.png'),
42+
icon: require('./images/tag@2x.png'),
4343
},
4444
{
4545
name: 'Stats',

src/utils/findApp.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const findApp = (menuItems: MenuItems, url: string) => {
1010
if (item.to === url) {
1111
acc.push(item);
1212
} else if (findSubItemFc(item.subItems, url).length !== 0) {
13-
const findSubItem = findSubItemFc(item.subItems, url);
14-
acc.push({ ...item, name: findSubItem[0].name });
13+
// const findSubItem = findSubItemFc(item.subItems, url);
14+
acc.push(item);
1515
}
1616
return acc;
1717
}, []);

0 commit comments

Comments
 (0)