Files
react/lib/components/icons/sun.tsx
2020-03-19 01:15:58 +08:00

41 lines
1.1 KiB
TypeScript

import React from 'react'
import withDefaults from 'components/utils/with-defaults'
import useTheme from 'components/styles/use-theme'
interface Props {
width: number
height: number
}
const defaultProps = {
width: 24,
height: 24,
}
export type SunIconProps = Props & typeof defaultProps
const SunIcon: React.FC<SunIconProps> = React.memo(({
width, height, ...props
}) => {
const theme = useTheme()
return (
<svg {...props} width={width} height={height}
viewBox="0 0 24 24" stroke="currentColor"
strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"
fill="none" shapeRendering="geometricPrecision"
style={{ color: theme.palette.accents_5 }}>
<circle cx="12" cy="12" r="5" />
<path d="M12 1v2" />
<path d="M12 21v2" />
<path d="M4.22 4.22l1.42 1.42" />
<path d="M18.36 18.36l1.42 1.42" />
<path d="M1 12h2" />
<path d="M21 12h2" />
<path d="M4.22 19.78l1.42-1.42" />
<path d="M18.36 5.64l1.42-1.42" />
</svg>
)
})
export default withDefaults(SunIcon, defaultProps)