[Glitch] Rewrite Icon and IconWithBadge with typescript
Port 81f75b1e0e
to glitch-soc
Signed-off-by: Claire <claire.github-309c@sitedethib.com>
This commit is contained in:
committed by
Claire
parent
7835f8fd22
commit
a49707dacb
14
app/javascript/flavours/glitch/components/icon.tsx
Normal file
14
app/javascript/flavours/glitch/components/icon.tsx
Normal file
@ -0,0 +1,14 @@
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
|
||||
type Props = {
|
||||
id: string;
|
||||
className?: string;
|
||||
fixedWidth?: boolean;
|
||||
children?: never;
|
||||
[key: string]: any;
|
||||
}
|
||||
export const Icon: React.FC<Props> = ({ id, className, fixedWidth, ...other }) =>
|
||||
<i className={classNames('fa', `fa-${id}`, className, { 'fa-fw': fixedWidth })} {...other} />;
|
||||
|
||||
export default Icon;
|
Reference in New Issue
Block a user