diff --git a/src/lib/components/icon/Icon.component.tsx b/src/lib/components/icon/Icon.component.tsx index 1247da7119..f87ccc9158 100644 --- a/src/lib/components/icon/Icon.component.tsx +++ b/src/lib/components/icon/Icon.component.tsx @@ -137,6 +137,27 @@ export const iconTable = { News: 'fas faBullhorn', }; +const customIcons = { + 'Remote-user': ({ ariaLabel, color, size }) => ( + + + + + ), +}; + const IconStyled = styled(FontAwesomeIcon)` ${(props) => { const theme = props.theme; @@ -148,7 +169,7 @@ const IconStyled = styled(FontAwesomeIcon)` }} `; -export type IconName = keyof typeof iconTable; +export type IconName = keyof typeof iconTable | keyof typeof customIcons; export type IconColor = keyof CoreUITheme; type Props = { name: IconName; @@ -215,12 +236,17 @@ function NonWrappedIcon({ ariaLabel = '', ...rest }: Omit) { - const iconInfo = iconTable[name]; + const iconInfo = iconTable[name] || customIcons[name]; if (!iconInfo) throw new Error(`${name}: is not a valid icon.`); const { data, status } = useQuery({ queryKey: ['icon', name], queryFn: async () => { + if (customIcons[name]) { + return { + default: customIcons[name], + }; + } const [iconType, iconClass] = iconInfo.split(' '); try { const fontAwesomeType =