mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
refactor(cx): pass className
This commit is contained in:
parent
2cb86d8957
commit
5ac46e0b2a
1 changed files with 4 additions and 2 deletions
|
|
@ -17,6 +17,8 @@ import FileCode from '../assets/icons/octicons/file-code.svg?svgr'
|
|||
import X from '../assets/icons/octicons/x.svg?svgr'
|
||||
import Gear from '../assets/icons/octicons/gear.svg?svgr'
|
||||
|
||||
import cx from '../utils/cx'
|
||||
|
||||
function getSVGIconComponent(type) {
|
||||
switch (type) {
|
||||
case 'octoface':
|
||||
|
|
@ -63,9 +65,9 @@ function getSVGIconComponent(type) {
|
|||
}
|
||||
}
|
||||
|
||||
export default function Icon({ type, ...otherProps }) {
|
||||
export default function Icon({ type, className, ...otherProps }) {
|
||||
return (
|
||||
<div className={'octicon-wrapper'} {...otherProps}>
|
||||
<div className={cx('octicon-wrapper', className)} {...otherProps}>
|
||||
{preact.h(getSVGIconComponent(type), { width: '100%', height: '100%' })}
|
||||
</div>
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue