-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add props can change size & icon size * fix checkbox props * save yarnlock * remove props size * let line-height === checkbox size * update snap
- Loading branch information
Showing
3 changed files
with
31 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
import React from 'react'; | ||
import { defaultTheme } from '@vital-ui/react-theme'; | ||
import { ThemeConsumer } from 'styled-components'; | ||
|
||
type Props = { | ||
fontSize?: number | string; | ||
color?: string; | ||
size?: string; | ||
}; | ||
|
||
export const CheckIcon = ({ size, fontSize, ...props }: Props) => ( | ||
<svg | ||
role="img" | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 512 512" | ||
width={size} | ||
height={size} | ||
fontSize={fontSize} | ||
{...props} | ||
> | ||
<path | ||
fill="currentColor" | ||
d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" | ||
/> | ||
</svg> | ||
export const CheckIcon = ({ fontSize, ...props }: Props) => ( | ||
<ThemeConsumer> | ||
{(theme = defaultTheme) => ( | ||
<svg | ||
role="img" | ||
xmlns="http://www.w3.org/2000/svg" | ||
viewBox="0 0 512 512" | ||
width={theme.checkbox.icon.size} | ||
height={theme.checkbox.icon.size} | ||
fontSize={fontSize} | ||
{...props} | ||
> | ||
<path | ||
fill="currentColor" | ||
d="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" | ||
/> | ||
</svg> | ||
)} | ||
</ThemeConsumer> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters