import React from 'react'; import { Btn } from './style'; import styled from 'styled-components'; import Icon from 'kwai-icon'; import { IButton } from './types'; export const Button = function({ children, icon, rightIcon, iconSize = 'small', ...rest }: IButton) { if (typeof children === 'string') { children = {children}; } return ( {icon && ( )} {children} {rightIcon && ( )} ); }; Button.defaultProps = { color: 'brand', size: 'large', appearance: 'solid', iconColor: 'white', iconFillColorRule: '&&& path', ripple: true, disabled: false, }; export const Round = styled(Button).attrs(({ icon }) => ({ appearance: 'round', icon: icon || 'Add' }))` box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.18); border-radius: 24px; height: 48px; min-width: 48px; padding: 0 12px; svg { margin: 0 !important; width: 24px; height: 24px; } span { display: inline-block; margin-left: 8px; } &&&&&&&& svg path { fill: rgb(255, 90, 94); } `; Button.Round = Round; export default Button;