-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(container.sidebar): remove chakra ui
ref:MANAGER-11708 Signed-off-by: Alex Boungnaseng <[email protected]>
- Loading branch information
1 parent
6326e9f
commit 96435c7
Showing
190 changed files
with
1,067 additions
and
7,474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/manager/apps/container/src/container/legacy/server-sidebar/OdsIconWrapper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { OsdsIcon } from '@ovhcloud/ods-stencil/components/react/'; | ||
import { OdsIconName, OdsIconSize } from '@ovhcloud/ods-core'; | ||
import { OdsThemeColorIntent } from '@ovhcloud/ods-theming'; | ||
|
||
type OdsIconWrapperType = { | ||
name: OdsIconName; | ||
}; | ||
|
||
const OdsIconWrapper = ({ name }: OdsIconWrapperType) => ( | ||
<OsdsIcon | ||
hoverable | ||
name={name} | ||
size={OdsIconSize.lg} | ||
color={OdsThemeColorIntent.primary} | ||
/> | ||
); | ||
|
||
export default OdsIconWrapper; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
packages/manager/apps/container/src/container/legacy/server-sidebar/SvgIconWrapper.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
|
||
import { dedicatedIcons } from './order/shop-config/icons/dedicatedIcons'; | ||
import { webIcons } from './order/shop-config/icons/webIcons'; | ||
import { telecomIcons } from './order/shop-config/icons/telecomIcons'; | ||
|
||
interface SvgIconProps { | ||
name: string; | ||
className?: string; | ||
width?: number; | ||
height?: number; | ||
} | ||
|
||
interface IconComponents { | ||
[key: string]: FunctionComponent< | ||
React.SVGProps<SVGSVGElement> & { title?: string } | ||
>; | ||
} | ||
|
||
const iconComponents: IconComponents = { | ||
...dedicatedIcons, | ||
...webIcons, | ||
...telecomIcons, | ||
}; | ||
|
||
const SvgIconWrapper: React.FC<SvgIconProps> = ({ | ||
name, | ||
className, | ||
width, | ||
height, | ||
}) => { | ||
const IconComponent = iconComponents[name]; | ||
|
||
if (!IconComponent) { | ||
return null; | ||
} | ||
|
||
return <IconComponent className={className} width={width} height={height} />; | ||
}; | ||
|
||
export default SvgIconWrapper; |
Oops, something went wrong.