mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-24 07:28:28 +08:00
59ad48476b
* chore: add boime lint * fix lint * use files ignore * revert change * ignore clarity.js * fix some errors * fix some errors * fix some errors * fix some errors * add yml file * Update clarity.js Signed-off-by: afc163 <afc163@gmail.com> * add npm run lint:biome * add npm run lint:biome * fix test case * fix ts errors * fix ts errors * fix lint and add .lintstagedrc * shorten prop name * chore: update package.json * update biome.json * chore: remove stylelint * chore: useOptionalChain * fix lint * biome format * prettier all code * prettier all code * fix site test --------- Signed-off-by: afc163 <afc163@gmail.com>
42 lines
939 B
TypeScript
42 lines
939 B
TypeScript
import React from 'react';
|
|
import { createStyles, css } from 'antd-style';
|
|
import classNames from 'classnames';
|
|
|
|
interface IconProps {
|
|
className?: string;
|
|
style?: React.CSSProperties;
|
|
}
|
|
|
|
const useStyle = createStyles(() => ({
|
|
iconWrap: css`
|
|
display: inline-flex;
|
|
align-items: center;
|
|
line-height: 0;
|
|
text-align: center;
|
|
vertical-align: -0.125em;
|
|
`,
|
|
}));
|
|
|
|
const NpmIcon: React.FC<IconProps> = (props) => {
|
|
const { className, style } = props;
|
|
const { styles } = useStyle();
|
|
return (
|
|
<span className={classNames(styles.iconWrap, className)} style={style}>
|
|
<svg
|
|
fill="#E53E3E"
|
|
focusable="false"
|
|
height="1em"
|
|
stroke="#E53E3E"
|
|
strokeWidth="0"
|
|
viewBox="0 0 16 16"
|
|
width="1em"
|
|
>
|
|
<title>npm icon</title>
|
|
<path d="M0 0v16h16v-16h-16zM13 13h-2v-8h-3v8h-5v-10h10v10z" />
|
|
</svg>
|
|
</span>
|
|
);
|
|
};
|
|
|
|
export default NpmIcon;
|