Skip to content

Commit 8d00cf9

Browse files
committed
fix: added icons for dashboard
1 parent 6345036 commit 8d00cf9

20 files changed

+110
-54
lines changed

public/ic-save.svg

-1
This file was deleted.

public/ic-user-guide.svg

-1
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

public/icons/ic-edit.svg

+1
Loading
File renamed without changes.

public/icons/ic-menu-dots.svg

+1
Loading
File renamed without changes.
File renamed without changes.
File renamed without changes.

public/icons/ic-save.svg

+1
Loading

public/icons/ic-user-guide.svg

+1
Loading

src/components/shared_ui/dialog/dialog.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import React from 'react';
2-
import classNames from 'classnames';
32
import ReactDOM from 'react-dom';
43
import { CSSTransition } from 'react-transition-group';
4+
import classNames from 'classnames';
5+
56
// import Icon from '../icon/icon';
67
// import Button from '../button/button';
78
import Text from '../text';
@@ -147,7 +148,7 @@ const Dialog = ({
147148
)}
148149
{has_close_icon && (
149150
<div onClick={handleClose} className='dc-dialog__header--close'>
150-
<img src='/ic-cross.svg'/>
151+
<img src='icons/ic-cross.svg' />
151152
{/* <Icon icon='IcCross' /> */}
152153
</div>
153154
)}

src/constants/dashboard.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { localize } from '@/utils/tmp/dummy';
1+
// import { localize } from '@/utils/tmp/dummy';
22

33
export const STRATEGY = {
44
EDIT: 'edit',
@@ -12,37 +12,37 @@ export const STRATEGY = {
1212
export const MENU_DESKTOP = [
1313
{
1414
type: STRATEGY.EDIT,
15-
icon: '/ic-open.svg',
15+
icon: 'icons/ic-open.svg',
1616
},
1717
{
1818
type: STRATEGY.SAVE,
19-
icon: '/ic-save.svg',
19+
icon: 'icons/ic-save.svg',
2020
},
2121
{
2222
type: STRATEGY.DELETE,
23-
icon: '/ic-delete.svg',
23+
icon: 'icons/ic-delete.svg',
2424
},
2525
];
2626

2727
export const CONTEXT_MENU_MOBILE = [
2828
{
2929
type: STRATEGY.PREVIEW_LIST,
3030
icon: 'IcPreview',
31-
label: localize('Preview'),
31+
label: 'Preview',
3232
},
3333
{
3434
type: STRATEGY.EDIT,
3535
icon: 'IcEdit',
36-
label: localize('Edit'),
36+
label: 'Edit',
3737
},
3838
{
3939
type: STRATEGY.SAVE,
4040
icon: 'IcSave',
41-
label: localize('Save'),
41+
label: 'Save',
4242
},
4343
{
4444
type: STRATEGY.DELETE,
4545
icon: 'IcDelete',
46-
label: localize('Delete'),
46+
label: 'Delete',
4747
},
4848
];

src/pages/dashboard/dashboard-bot-list.tsx

+31-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1+
import React from 'react';
2+
import { observer } from 'mobx-react-lite';
3+
14
import { isMobileOs } from '@/components/shared';
25
import { DBOT_TABS } from '@/constants/bot-contents';
3-
import { MENU_DESKTOP, STRATEGY } from '@/constants/dashboard';
6+
import { CONTEXT_MENU_MOBILE, MENU_DESKTOP, STRATEGY } from '@/constants/dashboard';
47
import { getSavedWorkspaces, timeSince } from '@/external/bot-skeleton';
58
import { useStore } from '@/hooks/useStore';
69
import { waitForDomElement } from '@/utils/dom-observer';
7-
import { observer } from 'mobx-react-lite';
8-
import React from 'react';
9-
1010

1111
const DashboardBotList = observer(() => {
1212
const { load_modal, dashboard, save_modal } = useStore();
@@ -96,12 +96,12 @@ const DashboardBotList = observer(() => {
9696
<div className='dashboard__botlist'>
9797
<div className='dashboard__botlist__header'>Your Bots</div>
9898
<table className='dashboard__botlist__table'>
99-
<thead>
100-
<tr>
101-
<th className='dashboard__botlist__table__title'>Bot Name</th>
102-
<th className='dashboard__botlist__table__title'>Last Modified</th>
103-
<th className='dashboard__botlist__table__title'>Status</th>
104-
<th className='dashboard__botlist__table__title'></th>
99+
<thead className='dashboard__botlist__table__header'>
100+
<tr className='dashboard__botlist__table__header__row'>
101+
<td className='dashboard__botlist__table__title'>Bot Name</td>
102+
<td className='dashboard__botlist__table__title'>Last Modified</td>
103+
<td className='dashboard__botlist__table__title'>Status</td>
104+
<td className='dashboard__botlist__table__title' />
105105
</tr>
106106
</thead>
107107
<tbody className='dashboard__botlist__table__body'>
@@ -116,7 +116,7 @@ const DashboardBotList = observer(() => {
116116
{MENU_DESKTOP.map(item => (
117117
<div
118118
key={item.type}
119-
className='dashboard__botlist__table__row__actions--item'
119+
className='desktop dashboard__botlist__table__row__actions--item'
120120
onClick={e => {
121121
e.stopPropagation();
122122
viewRecentStrategy(item.type, workspace);
@@ -125,6 +125,25 @@ const DashboardBotList = observer(() => {
125125
<img src={item.icon} alt={item.type} />
126126
</div>
127127
))}
128+
<button className='mobile dashboard__botlist__mobile'>
129+
<img src='/ic-menu-dots.svg' />
130+
</button>
131+
{CONTEXT_MENU_MOBILE.map(item => (
132+
<div
133+
key={item.type}
134+
className='mobile bot-list__item__responsive__menu'
135+
onClick={e => {
136+
e.stopPropagation();
137+
viewRecentStrategy(item.type, workspace);
138+
}}
139+
>
140+
<div>
141+
{/* <Icon icon={item.icon} /> */}
142+
<img src={item.icon} alt={item.type} />
143+
</div>
144+
{item.label}
145+
</div>
146+
))}
128147
</td>
129148
</tr>
130149
))}
@@ -134,4 +153,4 @@ const DashboardBotList = observer(() => {
134153
);
135154
});
136155

137-
export default DashboardBotList;
156+
export default DashboardBotList;

src/pages/dashboard/dashboard-quick-actions.tsx

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import React from 'react';
22
import { observer } from 'mobx-react-lite';
3-
import { useStore } from '@/hooks/useStore';
4-
import { DBOT_TABS } from '@/constants/bot-contents';
3+
54
import { NOTIFICATION_TYPE } from '@/components/bot-notification/bot-notification-utils';
5+
import { DBOT_TABS } from '@/constants/bot-contents';
6+
import { useStore } from '@/hooks/useStore';
67

78
const DashboardQuickActions = observer(() => {
89
const { dashboard, load_modal } = useStore();
910
const { showVideoDialog, setActiveTab, setFileLoaded, setOpenSettings } = dashboard;
1011
const { handleFileChange, loadFileFromLocal } = load_modal;
1112
const load_file_ref = React.useRef<HTMLInputElement | null>(null);
13+
/* eslint-disable @typescript-eslint/no-unused-vars */
1214
const [is_file_supported, setIsFileSupported] = React.useState(true);
1315
const openFileLoader = () => {
1416
load_file_ref?.current?.click();
@@ -21,27 +23,27 @@ const DashboardQuickActions = observer(() => {
2123
const quick_actions = [
2224
{
2325
type: 'my-computer',
24-
icon: <img src='/ic-my-computer.svg' alt='My computer' />,
26+
icon: <img src='icons/ic-my-computer.svg' alt='My computer' />,
2527
content: 'My Computer',
2628
onClickHandler: () => openFileLoader(),
2729
},
2830
{
2931
type: 'google-drive',
30-
icon: <img src='/ic-google-drive.svg' alt='Google Drive' />,
32+
icon: <img src='icons/ic-google-drive.svg' alt='Google Drive' />,
3133
content: 'Google Drive',
3234
onClickHandler: () => openGoogleDriveDialog(),
3335
},
3436
{
3537
type: 'bot-builder',
36-
icon: <img src='/ic-bot-builder.svg' alt='Bot Builder' />,
38+
icon: <img src='icons/ic-bot-builder.svg' alt='Bot Builder' />,
3739
content: 'Bot Builder',
3840
onClickHandler: () => {
3941
setActiveTab(DBOT_TABS.BOT_BUILDER);
4042
},
4143
},
4244
{
4345
type: 'quick-strategy',
44-
icon: <img src='/ic-quick-strategy.svg' alt='Quick strategy' />,
46+
icon: <img src='icons/ic-quick-strategy.svg' alt='Quick strategy' />,
4547
content: 'Quick strategy',
4648
onClickHandler: () => {
4749
setActiveTab(DBOT_TABS.BOT_BUILDER);
@@ -75,5 +77,4 @@ const DashboardQuickActions = observer(() => {
7577
);
7678
});
7779

78-
79-
export default DashboardQuickActions;
80+
export default DashboardQuickActions;

src/pages/dashboard/dashboard.scss

+51-20
Original file line numberDiff line numberDiff line change
@@ -14,50 +14,56 @@ $spacing-medium: 3rem;
1414
outline: none;
1515
border-radius: 2.4rem;
1616
}
17+
1718
.bot-dashboard {
1819
position: relative;
1920
}
21+
2022
.dashboard {
2123
background: var(--general-main-1);
2224
height: calc(100vh - 16.6rem);
2325
width: 100%;
2426

2527
&__botlist {
2628
width: 70rem;
27-
@media screen and (max-width: 991px) {
29+
30+
@media screen and (width <= 991px) {
2831
width: 90%;
2932
}
33+
3034
margin: 0 auto;
35+
3136
&__table {
3237
width: 100%;
38+
height: 35rem;
39+
overflow: auto;
3340
display: block;
34-
&__title {
35-
// display: block;
36-
// &:nth-child(1) {
37-
// width: 41%;
38-
// }
39-
// &:nth-child(2) {
40-
// width: 21%;
41-
// }
42-
// &:nth-child(3) {
43-
// width: 20%;
44-
// }
45-
// &:nth-child(4) {
46-
// width: 20%;
47-
// }
4841

42+
&__header {
43+
position: relative;
44+
45+
&__row {
46+
position: sticky;
47+
background: #fff;
48+
top: 0;
49+
}
50+
}
51+
52+
&__title {
4953
font-size: 1.4rem;
5054
font-weight: bold;
5155
padding-bottom: 1.6rem;
5256
}
57+
5358
&__body {
54-
display: block;
5559
max-height: 35rem;
5660
overflow: auto;
5761
}
62+
5863
&__row {
5964
border-top: 1px solid var(--border-divider);
6065
border-bottom: 1px solid var(--border-divider);
66+
6167
&__bot_name,
6268
&__last_modified,
6369
&__status,
@@ -69,17 +75,35 @@ $spacing-medium: 3rem;
6975
&__bot_name {
7076
width: 40%;
7177
}
78+
7279
&__last_modified,
7380
&__status {
7481
width: 20%;
7582
}
83+
7684
&__actions {
7785
display: flex;
7886

7987
&--item {
8088
margin-inline-end: 1.6rem;
8189
cursor: pointer;
8290
}
91+
92+
.desktop {
93+
display: block;
94+
95+
@media screen and (width <= 991px) {
96+
display: none;
97+
}
98+
}
99+
100+
.mobile {
101+
display: none;
102+
103+
@media screen and (width <= 991px) {
104+
display: block;
105+
}
106+
}
83107
}
84108
}
85109
}
@@ -92,12 +116,14 @@ $spacing-medium: 3rem;
92116
}
93117

94118
&__description {
95-
font-weight: 300;
96119
font-size: 16px;
97120
font-weight: normal;
121+
98122
@include align-center;
123+
99124
margin-bottom: $spacing-medium;
100-
@media screen and (max-width: 991px) {
125+
126+
@media screen and (width <= 991px) {
101127
width: 90%;
102128
margin: 0 auto;
103129
margin-bottom: $spacing-medium;
@@ -112,27 +138,32 @@ $spacing-medium: 3rem;
112138
&__user-guide-button,
113139
&__quickactions {
114140
@include align-center;
115-
@media screen and (max-width: 991px) {
141+
142+
@media screen and (width <= 991px) {
116143
justify-content: space-around;
117144
}
145+
118146
margin-bottom: $spacing-medium;
119147
}
120148

121149
&__user-guide-button {
122150
@include button-styles;
151+
123152
margin-top: 1.8rem;
124153
margin-right: 2.4rem;
125154
}
126155

127156
&__quickactions {
128157
&__card {
129158
margin-inline-end: 4rem;
130-
@media screen and (max-width: 991px) {
159+
160+
@media screen and (width <= 991px) {
131161
margin-inline-end: unset;
132162
}
133163

134164
&__icon {
135165
@include align-center;
166+
136167
font-size: 3.2rem;
137168
width: 8rem;
138169
height: 8rem;

0 commit comments

Comments
 (0)