mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +02:00
feat(ui): break css into module EE-3629 (#7180)
* break css into module and fix icon mode
This commit is contained in:
parent
33861a834b
commit
69baa279d4
6 changed files with 234 additions and 189 deletions
|
@ -12,9 +12,22 @@ interface Props {
|
|||
icon: ReactNode | ComponentType<unknown>;
|
||||
feather?: boolean;
|
||||
className?: string;
|
||||
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
||||
mode?:
|
||||
| 'alt'
|
||||
| 'primary'
|
||||
| 'primary-alt'
|
||||
| 'secondary'
|
||||
| 'secondary-alt'
|
||||
| 'warning'
|
||||
| 'warning-alt'
|
||||
| 'danger'
|
||||
| 'danger-alt'
|
||||
| 'success'
|
||||
| 'success-alt';
|
||||
}
|
||||
|
||||
export function Icon({ icon, feather, className }: Props) {
|
||||
export function Icon({ icon, feather, className, mode, size }: Props) {
|
||||
useEffect(() => {
|
||||
if (feather) {
|
||||
featherIcons.replace();
|
||||
|
@ -31,11 +44,18 @@ export function Icon({ icon, feather, className }: Props) {
|
|||
);
|
||||
}
|
||||
|
||||
const classes = clsx(
|
||||
className,
|
||||
'icon',
|
||||
{ [`icon-${mode}`]: mode },
|
||||
{ [`icon-${size}`]: size }
|
||||
);
|
||||
|
||||
if (feather) {
|
||||
return (
|
||||
<i
|
||||
data-feather={icon}
|
||||
className={className}
|
||||
className={classes}
|
||||
aria-hidden="true"
|
||||
role="img"
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue