Skip to content

Commit 93c7854

Browse files
authored
Merge pull request #1021 from layer5io/update-toolbar
feat: update workspace table toolbar
2 parents e88e670 + fb59a25 commit 93c7854

File tree

2 files changed

+25
-27
lines changed

2 files changed

+25
-27
lines changed

src/custom/Workspaces/DesignTable.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* eslint-disable @typescript-eslint/no-explicit-any */
22
import _ from 'lodash';
33
import React, { useEffect, useRef, useState } from 'react';
4-
import { Box, Typography } from '../../base';
4+
import { Box } from '../../base';
55
import { DesignIcon } from '../../icons';
66
import { publishCatalogItemSchema } from '../../schemas';
77
import { useTheme } from '../../theme';
@@ -19,7 +19,7 @@ import SearchBar from '../SearchBar';
1919
import { VIEW_VISIBILITY } from '../VisibilityChipMenu/VisibilityChipMenu';
2020
import AssignmentModal from './AssignmentModal';
2121
import useDesignAssignment from './hooks/useDesignAssignment';
22-
import { L5EditIcon, TableHeader, TableRightActionHeader } from './styles';
22+
import { L5EditIcon, TableHeader } from './styles';
2323
export interface DesignTableProps {
2424
workspaceId: string;
2525
isKanvasEnabled: boolean;
@@ -195,13 +195,15 @@ const DesignTable: React.FC<DesignTableProps> = ({
195195

196196
const tableHeaderContent = (
197197
<TableHeader style={{ padding: '1rem' }}>
198-
<Box display={'flex'} alignItems="center" gap={1} width="100%">
199-
<DesignIcon height="1.5rem" width="1.5rem" />
200-
<Typography variant="body1" fontWeight={'bold'}>
201-
Assigned Designs
202-
</Typography>
203-
</Box>
204-
<TableRightActionHeader style={{ marginRight: '0rem' }}>
198+
<Box
199+
style={{
200+
marginRight: '0rem',
201+
width: '100%',
202+
justifyContent: 'end',
203+
display: 'flex',
204+
alignItems: 'center'
205+
}}
206+
>
205207
<SearchBar
206208
onSearch={(value) => {
207209
setDesignSearch(value);
@@ -226,7 +228,7 @@ const DesignTable: React.FC<DesignTableProps> = ({
226228
disabled={!isAssignAllowed}
227229
title="Assign Designs"
228230
/>
229-
</TableRightActionHeader>
231+
</Box>
230232
</TableHeader>
231233
);
232234

src/custom/Workspaces/WorkspaceViewsTable.tsx

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Lock, Public } from '@mui/icons-material';
33
import RemoveCircleIcon from '@mui/icons-material/RemoveCircle';
44
import { MUIDataTableColumn, MUIDataTableMeta } from 'mui-datatables';
55
import React, { useState } from 'react';
6-
import { Box, Typography } from '../../base';
7-
import { EnvironmentIcon, ViewIcon } from '../../icons';
6+
import { Box } from '../../base';
7+
import { EnvironmentIcon } from '../../icons';
88
import { useTheme } from '../../theme';
99
import { NameDiv } from '../CatalogDesignTable/style';
1010
import { RESOURCE_TYPES } from '../CatalogDetail/types';
@@ -23,13 +23,7 @@ import { UserTableAvatarInfo } from '../UsersTable';
2323
import VisibilityChipMenu, { VIEW_VISIBILITY } from '../VisibilityChipMenu/VisibilityChipMenu';
2424
import AssignmentModal from './AssignmentModal';
2525
import useViewAssignment from './hooks/useViewsAssignment';
26-
import {
27-
CellStyle,
28-
CustomBodyRenderStyle,
29-
L5EditIcon,
30-
TableHeader,
31-
TableRightActionHeader
32-
} from './styles';
26+
import { CellStyle, CustomBodyRenderStyle, L5EditIcon, TableHeader } from './styles';
3327

3428
interface ViewsTableProps {
3529
workspaceId: string;
@@ -337,13 +331,15 @@ const WorkspaceViewsTable: React.FC<ViewsTableProps> = ({
337331
return (
338332
<>
339333
<TableHeader style={{ padding: '1rem' }}>
340-
<Box display={'flex'} alignItems="center" gap={1} width="100%">
341-
<ViewIcon height="1.5rem" width="1.5rem" fill={theme.palette.icon.brand} />
342-
<Typography variant="body1" fontWeight={'bold'}>
343-
Assigned Views
344-
</Typography>
345-
</Box>
346-
<TableRightActionHeader style={{ marginRight: '0rem' }}>
334+
<Box
335+
style={{
336+
marginRight: '0rem',
337+
width: '100%',
338+
justifyContent: 'end',
339+
display: 'flex',
340+
alignItems: 'center'
341+
}}
342+
>
347343
<SearchBar
348344
onSearch={(value) => {
349345
setSearch(value);
@@ -368,7 +364,7 @@ const WorkspaceViewsTable: React.FC<ViewsTableProps> = ({
368364
disabled={!isAssignAllowed}
369365
title="Assign Views"
370366
/>
371-
</TableRightActionHeader>
367+
</Box>
372368
</TableHeader>
373369

374370
<ResponsiveDataTable

0 commit comments

Comments
 (0)