Skip to content

Commit 28cb9d2

Browse files
authored
fix: workspace kind icon proportions and position (#762)
Signed-off-by: Jenny <32821331+jenny-s51@users.noreply.github.com>
1 parent 6fd915a commit 28cb9d2

File tree

2 files changed

+11
-9
lines changed

2 files changed

+11
-9
lines changed

workspaces/frontend/src/app/pages/WorkspaceKinds/WorkspaceKinds.tsx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ export const WorkspaceKinds: React.FunctionComponent = () => {
5757
// Table columns
5858
const columns: WorkspaceKindsColumns = useMemo(
5959
() => ({
60-
icon: { name: '', label: 'Icon', id: 'icon' },
6160
name: { name: 'Name', label: 'Name', id: 'name' },
6261
description: { name: 'Description', label: 'Description', id: 'description' },
6362
deprecated: { name: 'Status', label: 'Status', id: 'status' },
@@ -87,20 +86,18 @@ export const WorkspaceKinds: React.FunctionComponent = () => {
8786
const getSortableRowValues = useCallback(
8887
(workspaceKind: WorkspacekindsWorkspaceKind): (string | boolean | number)[] => {
8988
const {
90-
icon,
9189
name,
9290
description,
9391
deprecated,
9492
numOfWorkspaces: numberOfWorkspaces,
9593
} = {
96-
icon: '',
9794
name: workspaceKind.name,
9895
description: workspaceKind.description,
9996
deprecated: workspaceKind.deprecated,
10097
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
10198
numOfWorkspaces: workspaceCountPerKind[workspaceKind.name]?.count ?? 0,
10299
};
103-
return [icon, name, description, deprecated, numberOfWorkspaces];
100+
return [name, description, deprecated, numberOfWorkspaces];
104101
},
105102
[workspaceCountPerKind],
106103
);
@@ -424,22 +421,28 @@ export const WorkspaceKinds: React.FunctionComponent = () => {
424421
filteredWorkspaceKinds.map((workspaceKind, rowIndex) => (
425422
<Tbody id="workspace-kind-table-content" key={rowIndex} data-testid="table-body">
426423
<Tr id={`workspace-kind-table-row-${rowIndex + 1}`}>
427-
<Td dataLabel={columns.icon.name} style={{ width: '50px' }}>
424+
<Td dataLabel={columns.name.name}>
428425
<WithValidImage
429426
imageSrc={workspaceKind.icon.url}
430427
skeletonWidth="20px"
431428
fallback={<ImageFallback imageSrc={workspaceKind.icon.url} />}
432429
>
433430
{(validSrc) => (
434431
<img
432+
className="pf-v6-u-mr-sm"
435433
src={validSrc}
436-
alt={workspaceKind.name}
437-
style={{ width: '20px', height: '20px', cursor: 'pointer' }}
434+
alt={`${workspaceKind.name} icon`}
435+
style={{
436+
width: '20px',
437+
height: '20px',
438+
objectFit: 'contain',
439+
verticalAlign: 'middle',
440+
}}
438441
/>
439442
)}
440443
</WithValidImage>
444+
{workspaceKind.name}
441445
</Td>
442-
<Td dataLabel={columns.name.name}>{workspaceKind.name}</Td>
443446
<Td
444447
dataLabel={columns.description.name}
445448
style={{ maxWidth: '200px', overflow: 'hidden' }}

workspaces/frontend/src/app/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export interface WorkspaceColumnDefinition {
1616
id: string;
1717
}
1818
export interface WorkspaceKindsColumns {
19-
icon: WorkspaceColumnDefinition;
2019
name: WorkspaceColumnDefinition;
2120
description: WorkspaceColumnDefinition;
2221
deprecated: WorkspaceColumnDefinition;

0 commit comments

Comments
 (0)