From e2578e8e8fa6415d7eeb35ebb8f71b9e551f61b4 Mon Sep 17 00:00:00 2001 From: mufazalov Date: Thu, 25 Sep 2025 16:43:06 +0300 Subject: [PATCH] feat: export icons --- .../NavigationTree/NavigationTreeNode.tsx | 53 ++++++++++--------- src/components/icons/AsyncReplication.tsx | 9 +++- src/components/icons/ColumnTable.tsx | 9 +++- src/components/icons/Database.tsx | 3 ++ src/components/icons/ExternalDataSource.tsx | 9 +++- src/components/icons/ExternalTable.tsx | 9 +++- src/components/icons/Folder.tsx | 9 +++- src/components/icons/FolderOpen.tsx | 9 +++- src/components/icons/ResourcePool.tsx | 9 +++- src/components/icons/Table.tsx | 9 +++- .../icons/{Index.tsx => TableIndex.tsx} | 11 +++- src/components/icons/Topic.tsx | 9 +++- src/components/icons/Transfer.tsx | 2 +- src/components/icons/View.tsx | 9 +++- src/components/icons/index.ts | 13 +++++ src/index.ts | 1 + 16 files changed, 134 insertions(+), 39 deletions(-) rename src/components/icons/{Index.tsx => TableIndex.tsx} (72%) create mode 100644 src/components/icons/index.ts diff --git a/src/components/NavigationTree/NavigationTreeNode.tsx b/src/components/NavigationTree/NavigationTreeNode.tsx index 625ebb9..fba707b 100644 --- a/src/components/NavigationTree/NavigationTreeNode.tsx +++ b/src/components/NavigationTree/NavigationTreeNode.tsx @@ -1,19 +1,21 @@ import React from 'react'; import {TreeView} from '../TreeView/TreeView'; -import {AsyncReplicationIcon} from '../icons/AsyncReplication'; -import {ColumnTableIcon} from '../icons/ColumnTable'; -import {DatabaseIcon} from '../icons/Database'; -import {ExternalDataSourceIcon} from '../icons/ExternalDataSource'; -import {ExternalTableIcon} from '../icons/ExternalTable'; -import {FolderIcon} from '../icons/Folder'; -import {FolderOpenIcon} from '../icons/FolderOpen'; -import {IndexIcon} from '../icons/Index'; -import {ResourcePoolIcon} from '../icons/ResourcePool'; -import {TableIcon} from '../icons/Table'; -import {TopicIcon} from '../icons/Topic'; -import {TransferIcon} from '../icons/Transfer'; -import {ViewIcon} from '../icons/View'; +import { + AsyncReplicationIcon, + ColumnTableIcon, + DatabaseIcon, + ExternalDataSourceIcon, + ExternalTableIcon, + FolderIcon, + FolderOpenIcon, + ResourcePoolIcon, + TableIcon, + TableIndexIcon, + TopicIcon, + TransferIcon, + ViewIcon, +} from '../icons'; import {NavigationTreeActionType} from './state'; import type {NavigationTreeAction} from './state'; @@ -37,33 +39,32 @@ export interface NavigationTreeNodeProps { function renderIcon(type: NavigationTreeNodeType, collapsed: boolean) { switch (type) { case 'async_replication': - return ; + return ; case 'transfer': - return ; + return ; case 'database': - // this icon is larger than the others, therefore 14 for a better fit - return ; + return ; case 'directory': - return collapsed ? : ; + return collapsed ? : ; case 'index': - return ; + return ; case 'table': case 'index_table': case 'system_table': - return ; + return ; case 'column_table': - return ; + return ; case 'stream': case 'topic': - return ; + return ; case 'external_table': - return ; + return ; case 'external_data_source': - return ; + return ; case 'view': - return ; + return ; case 'resource_pool': - return ; + return ; default: return null; } diff --git a/src/components/icons/AsyncReplication.tsx b/src/components/icons/AsyncReplication.tsx index 97f7b18..f6beb39 100644 --- a/src/components/icons/AsyncReplication.tsx +++ b/src/components/icons/AsyncReplication.tsx @@ -2,7 +2,14 @@ import React from 'react'; export function AsyncReplicationIcon(props: React.SVGProps) { return ( - + ) { return ( - + ) { return ( ) { return ( - + ) { return ( - + ) { return ( - + ); diff --git a/src/components/icons/FolderOpen.tsx b/src/components/icons/FolderOpen.tsx index 33d3b5b..67b44a3 100644 --- a/src/components/icons/FolderOpen.tsx +++ b/src/components/icons/FolderOpen.tsx @@ -2,7 +2,14 @@ import React from 'react'; export function FolderOpenIcon(props: React.SVGProps) { return ( - + ); diff --git a/src/components/icons/ResourcePool.tsx b/src/components/icons/ResourcePool.tsx index 7c9c99c..9ccc7c2 100644 --- a/src/components/icons/ResourcePool.tsx +++ b/src/components/icons/ResourcePool.tsx @@ -2,7 +2,14 @@ import React from 'react'; export function ResourcePoolIcon(props: React.SVGProps) { return ( - + ) { return ( - + ) { +export function TableIndexIcon(props: React.SVGProps) { return ( - + ) { return ( - + diff --git a/src/components/icons/Transfer.tsx b/src/components/icons/Transfer.tsx index 0b81503..430fee2 100644 --- a/src/components/icons/Transfer.tsx +++ b/src/components/icons/Transfer.tsx @@ -3,5 +3,5 @@ import React from 'react'; import {FileArrowRightOut} from '@gravity-ui/icons'; export function TransferIcon(props: React.SVGProps) { - return ; + return ; } diff --git a/src/components/icons/View.tsx b/src/components/icons/View.tsx index 4c15e9c..e77282a 100644 --- a/src/components/icons/View.tsx +++ b/src/components/icons/View.tsx @@ -2,7 +2,14 @@ import React from 'react'; export function ViewIcon(props: React.SVGProps) { return ( - +