Skip to content

Commit 1c2a89d

Browse files
author
captain-Akshay
committed
chore: addition of transferlist kind based org
Signed-off-by: captain-Akshay <[email protected]>
1 parent cf98ff7 commit 1c2a89d

File tree

3 files changed

+99
-1
lines changed

3 files changed

+99
-1
lines changed

src/custom/TransferModal/TransferList/TransferList.tsx

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React from 'react';
22
import { Checkbox, Grid, List, ListItem, Typography } from '../../../base';
33
import { KubernetesIcon, LeftArrowIcon, RightArrowIcon, SMPIcon } from '../../../icons';
4+
import { MesheryIcon } from '../../../icons/Meshery';
45
import Tooltip from '../../../patches/Tooltip';
56
import {
67
ButtonGrid,
@@ -15,6 +16,17 @@ export const TRANSFER_COMPONET = {
1516
CHIP: 'chip',
1617
OTHER: 'other'
1718
};
19+
export function getFallbackImageBasedOnKind(kind: string | undefined): JSX.Element {
20+
if (!kind) {
21+
return <KubernetesIcon />;
22+
}
23+
const fallbackComponents: { [key: string]: JSX.Element } = {
24+
meshery: <MesheryIcon />,
25+
kubernetes: <KubernetesIcon />
26+
};
27+
28+
return fallbackComponents[kind] || null;
29+
}
1830

1931
export interface TransferListProps {
2032
name: string;
@@ -37,6 +49,7 @@ export interface TransferListProps {
3749
interface ListItemType {
3850
id: number;
3951
name: string;
52+
kind: string | undefined;
4053
}
4154

4255
function not<T>(a: T[], b: T[]): T[] {
@@ -227,7 +240,7 @@ function TransferList({
227240
label={item.name}
228241
onDelete={() => {}}
229242
deleteIcon={<SMPIcon />}
230-
icon={<KubernetesIcon />}
243+
icon={getFallbackImageBasedOnKind(item?.kind) || <KubernetesIcon />}
231244
/>
232245
</Tooltip>
233246
) : (

src/icons/Meshery/MesheryIcon.tsx

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
import { FC } from 'react';
2+
import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants';
3+
import { CustomIconProps } from '../types';
4+
5+
const MesheryIcon: FC<CustomIconProps> = ({
6+
width = DEFAULT_WIDTH,
7+
height = DEFAULT_HEIGHT,
8+
primaryFill = '#00B39F',
9+
secondaryFill = '#00D3A9',
10+
...props
11+
}) => {
12+
return (
13+
<svg
14+
width={width}
15+
height={height}
16+
viewBox="0 0 135 135"
17+
{...props}
18+
xmlns="http://www.w3.org/2000/svg"
19+
>
20+
<path d="M69.5 31.82V64.07L97.45 47.89L69.5 31.82Z" fill={secondaryFill} />
21+
<path d="M69.5 70.81V103.22L97.7 87.09L69.5 70.81Z" fill={secondaryFill} />
22+
<path d="M65.47 63.85V32.09L37.87 47.92L65.47 63.85Z" fill={primaryFill} />
23+
<path
24+
d="M10.1 103.1C15.5182 111.811 22.842 119.179 31.52 124.65V90.71L10.1 103.1Z"
25+
fill={primaryFill}
26+
/>
27+
<path d="M65.47 103.06V71.05L37.8 87.07L65.47 103.06Z" fill={primaryFill} />
28+
<path d="M35.54 122.63L63.56 106.61L35.54 90.41V122.63Z" fill={secondaryFill} />
29+
<path d="M99.62 122.8V90.63L71.64 106.63L99.62 122.8Z" fill={primaryFill} />
30+
<path
31+
d="M127.03 99.37C131.817 90.4433 134.524 80.5502 134.95 70.43L105.78 87.11L127.03 99.37Z"
32+
fill={primaryFill}
33+
/>
34+
<path d="M103.64 83.69L131.76 67.61L103.64 51.45V83.69Z" fill={secondaryFill} />
35+
<path d="M99.62 44.5V12.52L71.77 28.49L99.62 44.5Z" fill={primaryFill} />
36+
<path d="M99.62 83.55V51.28L71.7 67.44L99.62 83.55Z" fill={primaryFill} />
37+
<path d="M35.54 51.22V83.73L63.66 67.45L35.54 51.22Z" fill={secondaryFill} />
38+
<path
39+
d="M65.47 0C55.1388 0.298791 45.016 2.97835 35.89 7.83L65.52 24.83L65.47 0Z"
40+
fill={primaryFill}
41+
/>
42+
<path d="M35.54 12.3V44.62L63.69 28.48L35.54 12.3Z" fill={secondaryFill} />
43+
<path
44+
d="M31.52 10.34C22.8442 15.8136 15.521 23.1813 10.1 31.89L31.52 44.25V10.34Z"
45+
fill={primaryFill}
46+
/>
47+
<path
48+
d="M99.43 8C90.2123 3.0393 79.9635 0.299881 69.5 0V25.15L99.43 8Z"
49+
fill={secondaryFill}
50+
/>
51+
<path
52+
d="M0 69.87C0.348236 80.2825 3.1145 90.4711 8.08 99.63L29.77 87.07L0 69.87Z"
53+
fill={secondaryFill}
54+
/>
55+
<path
56+
d="M8.07001 35.37C3.13121 44.4917 0.372439 54.6334 0.0100098 65L29.8 47.91L8.07001 35.37Z"
57+
fill={secondaryFill}
58+
/>
59+
<path
60+
d="M35.78 127.13C44.9355 132.013 55.0981 134.706 65.47 135V110.15L35.78 127.13Z"
61+
fill={primaryFill}
62+
/>
63+
<path
64+
d="M124.89 32C119.512 23.3126 112.237 15.9553 103.61 10.48V44.3L124.89 32Z"
65+
fill={secondaryFill}
66+
/>
67+
<path
68+
d="M103.64 124.54C112.314 119.022 119.624 111.61 125.02 102.86L103.64 90.52V124.54Z"
69+
fill={secondaryFill}
70+
/>
71+
<path
72+
d="M134.96 64.81C134.572 54.5437 131.835 44.5032 126.96 35.46L105.5 47.88L134.96 64.81Z"
73+
fill={primaryFill}
74+
/>
75+
<path
76+
d="M69.5 135C79.845 134.709 89.9825 132.029 99.12 127.17L69.5 110V135Z"
77+
fill={secondaryFill}
78+
/>
79+
<path d="M31.52 83.44V51.56L3.83002 67.43L31.52 83.44Z" fill={primaryFill} />
80+
</svg>
81+
);
82+
};
83+
84+
export default MesheryIcon;

src/icons/Meshery/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as MesheryIcon } from './MesheryIcon';

0 commit comments

Comments
 (0)