Skip to content

Commit e7ed4ae

Browse files
authored
feat: add resource pool icon (#86)
1 parent 81c5344 commit e7ed4ae

File tree

4 files changed

+23
-1
lines changed

4 files changed

+23
-1
lines changed

src/components/NavigationTree/NavigationTreeNode.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {ExternalTableIcon} from '../icons/ExternalTable';
99
import {FolderIcon} from '../icons/Folder';
1010
import {FolderOpenIcon} from '../icons/FolderOpen';
1111
import {IndexIcon} from '../icons/Index';
12+
import {ResourcePoolIcon} from '../icons/ResourcePool';
1213
import {TableIcon} from '../icons/Table';
1314
import {TopicIcon} from '../icons/Topic';
1415
import {ViewIcon} from '../icons/View';
@@ -32,7 +33,7 @@ export interface NavigationTreeNodeProps {
3233
cache?: boolean;
3334
}
3435

35-
function renderIcon(type: NavigationTreeNodeType | string, collapsed: boolean) {
36+
function renderIcon(type: NavigationTreeNodeType, collapsed: boolean) {
3637
switch (type) {
3738
case 'async_replication':
3839
return <AsyncReplicationIcon height={16} />;
@@ -57,6 +58,8 @@ function renderIcon(type: NavigationTreeNodeType | string, collapsed: boolean) {
5758
return <ExternalDataSourceIcon height={16} />;
5859
case 'view':
5960
return <ViewIcon height={16} />;
61+
case 'resource_pool':
62+
return <ResourcePoolIcon height={16} />;
6063
default:
6164
return null;
6265
}

src/components/NavigationTree/__stories__/NavigationTree.stories.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,10 @@ async function fetchPath(path: string) {
129129
name: 'view',
130130
type: 'view',
131131
},
132+
{
133+
name: 'resource_pool',
134+
type: 'resource_pool',
135+
},
132136
];
133137
}
134138

src/components/NavigationTree/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {DropdownMenuItemMixed} from '@gravity-ui/uikit';
33
export type NavigationTreeNodeType =
44
| 'async_replication'
55
| 'column_table'
6+
| 'resource_pool'
67
| 'database'
78
| 'directory'
89
| 'external_data_source'

src/components/icons/ResourcePool.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import React from 'react';
2+
3+
export function ResourcePoolIcon(props: React.SVGProps<SVGSVGElement>) {
4+
return (
5+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" {...props}>
6+
<path
7+
d="m1.5 3.25c0-0.41421 0.33579-0.75 0.75-0.75h1.0109c0.41421 0 0.75-0.33579 0.75-0.75s-0.33579-0.75-0.75-0.75h-1.0109c-1.2426 0-2.25 1.0074-2.25 2.25v9.5c0 1.2426 1.0074 2.25 2.25 2.25h1.0109c0.41421 0 0.75-0.3358 0.75-0.75s-0.33579-0.75-0.75-0.75h-1.0109c-0.41421 0-0.75-0.3358-0.75-0.75v-9.5zm11.239-2.25c-0.4142 0-0.75 0.33579-0.75 0.75s0.3358 0.75 0.75 0.75h1.0109c0.4142 0 0.75 0.33579 0.75 0.75v9.5c0 0.4142-0.3358 0.75-0.75 0.75h-1.0109c-0.4142 0-0.75 0.3358-0.75 0.75s0.3358 0.75 0.75 0.75h1.0109c1.2426 0 2.25-1.0074 2.25-2.25v-9.5c0-1.2426-1.0074-2.25-2.25-2.25h-1.0109zm-1.4316 6.9054c-0.9374 0.45226-2.1226 0.63619-3.3102 0.63619-1.1876 0-2.3728-0.18393-3.3103-0.63619-0.21174-0.10215-0.42044-0.22399-0.61701-0.36633v0.46091c0 1.3714 1.7583 2.0571 3.9273 2.0571 2.169 0 3.9273-0.68571 3.9273-2.0571v-0.46091c-0.1966 0.14234-0.4053 0.26418-0.6171 0.36633zm-3.3102-0.59108c2.169 0 3.9273-0.68572 3.9273-2.0571 0-1.3714-1.7583-2.0572-3.9273-2.0572-2.169 0-3.9273 0.68572-3.9273 2.0572 0 1.3714 1.7583 2.0571 3.9273 2.0571zm3.9273 3.4286c0 1.3714-1.7583 2.0571-3.9273 2.0571-2.169 0-3.9273-0.6857-3.9273-2.0571v-0.461c0.19657 0.1423 0.40527 0.2641 0.61701 0.3663 0.93748 0.4522 2.1227 0.6362 3.3103 0.6362 1.1876 0 2.3728-0.184 3.3102-0.6362 0.2118-0.1022 0.4205-0.224 0.6171-0.3663v0.461z"
8+
fill="currentColor"
9+
clipRule="evenodd"
10+
fillRule="evenodd"
11+
/>
12+
</svg>
13+
);
14+
}

0 commit comments

Comments
 (0)