From 1c2a89d7efc33e0ff51a6ddad9aabacf07a58ffe Mon Sep 17 00:00:00 2001 From: captain-Akshay Date: Mon, 26 Aug 2024 15:00:03 +0530 Subject: [PATCH] chore: addition of transferlist kind based org Signed-off-by: captain-Akshay --- .../TransferList/TransferList.tsx | 15 +++- src/icons/Meshery/MesheryIcon.tsx | 84 +++++++++++++++++++ src/icons/Meshery/index.ts | 1 + 3 files changed, 99 insertions(+), 1 deletion(-) create mode 100644 src/icons/Meshery/MesheryIcon.tsx create mode 100644 src/icons/Meshery/index.ts diff --git a/src/custom/TransferModal/TransferList/TransferList.tsx b/src/custom/TransferModal/TransferList/TransferList.tsx index ffaea425..8fe1d302 100644 --- a/src/custom/TransferModal/TransferList/TransferList.tsx +++ b/src/custom/TransferModal/TransferList/TransferList.tsx @@ -1,6 +1,7 @@ import React from 'react'; import { Checkbox, Grid, List, ListItem, Typography } from '../../../base'; import { KubernetesIcon, LeftArrowIcon, RightArrowIcon, SMPIcon } from '../../../icons'; +import { MesheryIcon } from '../../../icons/Meshery'; import Tooltip from '../../../patches/Tooltip'; import { ButtonGrid, @@ -15,6 +16,17 @@ export const TRANSFER_COMPONET = { CHIP: 'chip', OTHER: 'other' }; +export function getFallbackImageBasedOnKind(kind: string | undefined): JSX.Element { + if (!kind) { + return ; + } + const fallbackComponents: { [key: string]: JSX.Element } = { + meshery: , + kubernetes: + }; + + return fallbackComponents[kind] || null; +} export interface TransferListProps { name: string; @@ -37,6 +49,7 @@ export interface TransferListProps { interface ListItemType { id: number; name: string; + kind: string | undefined; } function not(a: T[], b: T[]): T[] { @@ -227,7 +240,7 @@ function TransferList({ label={item.name} onDelete={() => {}} deleteIcon={} - icon={} + icon={getFallbackImageBasedOnKind(item?.kind) || } /> ) : ( diff --git a/src/icons/Meshery/MesheryIcon.tsx b/src/icons/Meshery/MesheryIcon.tsx new file mode 100644 index 00000000..c8421126 --- /dev/null +++ b/src/icons/Meshery/MesheryIcon.tsx @@ -0,0 +1,84 @@ +import { FC } from 'react'; +import { DEFAULT_HEIGHT, DEFAULT_WIDTH } from '../../constants/constants'; +import { CustomIconProps } from '../types'; + +const MesheryIcon: FC = ({ + width = DEFAULT_WIDTH, + height = DEFAULT_HEIGHT, + primaryFill = '#00B39F', + secondaryFill = '#00D3A9', + ...props +}) => { + return ( + + + + + + + + + + + + + + + + + + + + + + + + + + + ); +}; + +export default MesheryIcon; diff --git a/src/icons/Meshery/index.ts b/src/icons/Meshery/index.ts new file mode 100644 index 00000000..5e90c5e7 --- /dev/null +++ b/src/icons/Meshery/index.ts @@ -0,0 +1 @@ +export { default as MesheryIcon } from './MesheryIcon';