mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-06 22:40:26 -05:00
e9e4552658
* refactor: relocate theme-ui as plugin * refactor: relocate theme-ui as plugin * refactor: relocate theme-ui as plugin * chore: fix lint * chore: add missing folder * refactor: relocate theme-ui as plugin * refactor: relocate theme-ui as plugin * refactor: relocate theme-ui as plugin * chore: update scripts * refactor: relocate theme-ui as plugin * refactor: relocate theme-ui as plugin * refactor: relocate theme-ui as plugin * refactor: relocate theme-ui as plugin
38 lines
826 B
TypeScript
38 lines
826 B
TypeScript
import styled from '@emotion/styled';
|
|
import { default as MaterialUISvgIcon, SvgIconProps } from '@material-ui/core/SvgIcon';
|
|
import React from 'react';
|
|
|
|
type Size = 'sm' | 'md';
|
|
|
|
type Props = Omit<SvgIconProps, 'color' | 'fontsize' | 'name'> & {
|
|
size?: Size;
|
|
title?: string;
|
|
className?: string;
|
|
};
|
|
|
|
const SvgIcon = React.forwardRef<SVGSVGElement, Props>(function SvgIcon(
|
|
{ size = 'md', title, ...props },
|
|
ref
|
|
) {
|
|
return <StyledMaterialUISvgIcon size={size} titleAccess={title} {...props} ref={ref} />;
|
|
});
|
|
|
|
export { SvgIcon };
|
|
|
|
const getSize = (size: Size) => {
|
|
if (size === 'md') {
|
|
return {
|
|
width: 18,
|
|
height: 18,
|
|
};
|
|
}
|
|
|
|
return {
|
|
width: 14,
|
|
height: 16,
|
|
};
|
|
};
|
|
|
|
const StyledMaterialUISvgIcon = styled(MaterialUISvgIcon)<{ size: Size }>(({ size }) => ({
|
|
...getSize(size),
|
|
}));
|