Skip to content

Commit c75cbfe

Browse files
feat: export icons (#100)
1 parent 7ba36dc commit c75cbfe

File tree

16 files changed

+134
-39
lines changed

16 files changed

+134
-39
lines changed

src/components/NavigationTree/NavigationTreeNode.tsx

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
import React from 'react';
22

33
import {TreeView} from '../TreeView/TreeView';
4-
import {AsyncReplicationIcon} from '../icons/AsyncReplication';
5-
import {ColumnTableIcon} from '../icons/ColumnTable';
6-
import {DatabaseIcon} from '../icons/Database';
7-
import {ExternalDataSourceIcon} from '../icons/ExternalDataSource';
8-
import {ExternalTableIcon} from '../icons/ExternalTable';
9-
import {FolderIcon} from '../icons/Folder';
10-
import {FolderOpenIcon} from '../icons/FolderOpen';
11-
import {IndexIcon} from '../icons/Index';
12-
import {ResourcePoolIcon} from '../icons/ResourcePool';
13-
import {TableIcon} from '../icons/Table';
14-
import {TopicIcon} from '../icons/Topic';
15-
import {TransferIcon} from '../icons/Transfer';
16-
import {ViewIcon} from '../icons/View';
4+
import {
5+
AsyncReplicationIcon,
6+
ColumnTableIcon,
7+
DatabaseIcon,
8+
ExternalDataSourceIcon,
9+
ExternalTableIcon,
10+
FolderIcon,
11+
FolderOpenIcon,
12+
ResourcePoolIcon,
13+
TableIcon,
14+
TableIndexIcon,
15+
TopicIcon,
16+
TransferIcon,
17+
ViewIcon,
18+
} from '../icons';
1719

1820
import {NavigationTreeActionType} from './state';
1921
import type {NavigationTreeAction} from './state';
@@ -37,33 +39,32 @@ export interface NavigationTreeNodeProps {
3739
function renderIcon(type: NavigationTreeNodeType, collapsed: boolean) {
3840
switch (type) {
3941
case 'async_replication':
40-
return <AsyncReplicationIcon height={16} />;
42+
return <AsyncReplicationIcon />;
4143
case 'transfer':
42-
return <TransferIcon height={16} />;
44+
return <TransferIcon />;
4345
case 'database':
44-
// this icon is larger than the others, therefore 14 for a better fit
45-
return <DatabaseIcon height={14} />;
46+
return <DatabaseIcon />;
4647
case 'directory':
47-
return collapsed ? <FolderIcon height={16} /> : <FolderOpenIcon height={16} />;
48+
return collapsed ? <FolderIcon /> : <FolderOpenIcon />;
4849
case 'index':
49-
return <IndexIcon height={16} />;
50+
return <TableIndexIcon />;
5051
case 'table':
5152
case 'index_table':
5253
case 'system_table':
53-
return <TableIcon height={16} />;
54+
return <TableIcon />;
5455
case 'column_table':
55-
return <ColumnTableIcon height={16} />;
56+
return <ColumnTableIcon />;
5657
case 'stream':
5758
case 'topic':
58-
return <TopicIcon height={16} />;
59+
return <TopicIcon />;
5960
case 'external_table':
60-
return <ExternalTableIcon height={16} />;
61+
return <ExternalTableIcon />;
6162
case 'external_data_source':
62-
return <ExternalDataSourceIcon height={16} />;
63+
return <ExternalDataSourceIcon />;
6364
case 'view':
64-
return <ViewIcon height={16} />;
65+
return <ViewIcon />;
6566
case 'resource_pool':
66-
return <ResourcePoolIcon height={16} />;
67+
return <ResourcePoolIcon />;
6768
default:
6869
return null;
6970
}

src/components/icons/AsyncReplication.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ import React from 'react';
22

33
export function AsyncReplicationIcon(props: React.SVGProps<SVGSVGElement>) {
44
return (
5-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" {...props}>
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
height={16}
8+
width={16}
9+
viewBox="0 0 16 16"
10+
fill="currentColor"
11+
{...props}
12+
>
613
<path
714
fillRule="evenodd"
815
clipRule="evenodd"

src/components/icons/ColumnTable.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ import React from 'react';
22

33
export function ColumnTableIcon(props: React.SVGProps<SVGSVGElement>) {
44
return (
5-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" {...props}>
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
height={16}
8+
width={16}
9+
viewBox="0 0 16 16"
10+
fill="currentColor"
11+
{...props}
12+
>
613
<path
714
fillRule="evenodd"
815
clipRule="evenodd"

src/components/icons/Database.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ export function DatabaseIcon(props: React.SVGProps<SVGSVGElement>) {
44
return (
55
<svg
66
xmlns="http://www.w3.org/2000/svg"
7+
// This icon is larger than the others, therefore 14 for a better fit (other have 16)
8+
height={14}
9+
width={14}
710
viewBox="0 0 448 512"
811
fill="currentColor"
912
{...props}

src/components/icons/ExternalDataSource.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ import React from 'react';
22

33
export function ExternalDataSourceIcon(props: React.SVGProps<SVGSVGElement>) {
44
return (
5-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" {...props}>
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
height={16}
8+
width={16}
9+
viewBox="0 0 16 16"
10+
fill="currentColor"
11+
{...props}
12+
>
613
<path
714
fillRule="evenodd"
815
clipRule="evenodd"

src/components/icons/ExternalTable.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ import React from 'react';
22

33
export function ExternalTableIcon(props: React.SVGProps<SVGSVGElement>) {
44
return (
5-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" {...props}>
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
height={16}
8+
width={16}
9+
viewBox="0 0 16 16"
10+
fill="currentColor"
11+
{...props}
12+
>
613
<path
714
fillRule="evenodd"
815
clipRule="evenodd"

src/components/icons/Folder.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ import React from 'react';
22

33
export function FolderIcon(props: React.SVGProps<SVGSVGElement>) {
44
return (
5-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" {...props}>
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
height={16}
8+
width={16}
9+
viewBox="0 0 16 16"
10+
fill="currentColor"
11+
{...props}
12+
>
613
<path d="M13.2812 4.875H8.40625L6.78125 3.25H2.71875C2.0332 3.25 1.5 3.80859 1.5 4.46875V11.7812C1.5 12.4668 2.0332 13 2.71875 13H13.2812C13.9414 13 14.5 12.4668 14.5 11.7812V6.09375C14.5 5.43359 13.9414 4.875 13.2812 4.875Z" />
714
</svg>
815
);

src/components/icons/FolderOpen.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ import React from 'react';
22

33
export function FolderOpenIcon(props: React.SVGProps<SVGSVGElement>) {
44
return (
5-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" {...props}>
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
height={16}
8+
width={16}
9+
viewBox="0 0 16 16"
10+
fill="currentColor"
11+
{...props}
12+
>
613
<path d="M15.2109 9.06445C15.4648 8.6582 15.1602 8.125 14.6777 8.125H4.54688C4.01367 8.125 3.37891 8.50586 3.125 8.9375L1.29688 12.0859C1.04297 12.4922 1.34766 13 1.83008 13H11.9609C12.4941 13 13.1289 12.6445 13.3828 12.2129L15.2109 9.06445ZM4.54688 7.3125H12.875V6.09375C12.875 5.43359 12.3164 4.875 11.6562 4.875H7.59375L5.96875 3.25H1.90625C1.2207 3.25 0.6875 3.80859 0.6875 4.46875V11.5527L2.43945 8.53125C2.87109 7.79492 3.6582 7.3125 4.54688 7.3125Z" />
714
</svg>
815
);

src/components/icons/ResourcePool.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ import React from 'react';
22

33
export function ResourcePoolIcon(props: React.SVGProps<SVGSVGElement>) {
44
return (
5-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" {...props}>
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
height={16}
8+
width={16}
9+
viewBox="0 0 16 16"
10+
fill="currentColor"
11+
{...props}
12+
>
613
<path
714
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"
815
fill="currentColor"

src/components/icons/Table.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,14 @@ import React from 'react';
22

33
export function TableIcon(props: React.SVGProps<SVGSVGElement>) {
44
return (
5-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" {...props}>
5+
<svg
6+
xmlns="http://www.w3.org/2000/svg"
7+
height={16}
8+
width={16}
9+
viewBox="0 0 16 16"
10+
fill="currentColor"
11+
{...props}
12+
>
613
<path
714
fillRule="evenodd"
815
clipRule="evenodd"

0 commit comments

Comments
 (0)