Added classNames props (#38)

This commit is contained in:
Danilo Woznica
2017-12-18 10:49:48 -02:00
committed by GitHub
parent b18a517b57
commit b35914bd8e
5 changed files with 78 additions and 27 deletions

View File

@@ -15,11 +15,10 @@ const Wrap = (props: WrapProps): React.Element<*> => {
return (
<svg
viewBox={`0 0 ${props.width} ${props.height}`}
width={props.width}
height={props.height}
version="1.1"
style={props.style}
preserveAspectRatio={props.preserveAspectRatio}
className={props.className}
>
<rect
style={{ fill: `url(#${idGradient})` }}
@@ -64,4 +63,4 @@ const Wrap = (props: WrapProps): React.Element<*> => {
)
}
export default Wrap
export default Wrap

View File

@@ -20,7 +20,8 @@ export type Props = {
height: number,
primaryColor: string,
secondaryColor: string,
preserveAspectRatio:string,
preserveAspectRatio: string,
className: string,
}
type State = {
@@ -32,6 +33,7 @@ type State = {
primaryColor: string,
secondaryColor: string,
preserveAspectRatio: string,
className: string,
}
class ContentLoader extends React.Component<Props, State> {
@@ -43,6 +45,7 @@ class ContentLoader extends React.Component<Props, State> {
primaryColor: '#f0f0f0',
secondaryColor: '#e0e0e0',
preserveAspectRatio: 'xMidYMid meet',
className: '',
}
constructor(props: Props) {
@@ -57,6 +60,7 @@ class ContentLoader extends React.Component<Props, State> {
primaryColor: props.primaryColor,
secondaryColor: props.secondaryColor,
preserveAspectRatio: props.preserveAspectRatio,
className: props.className,
}
}
@@ -88,4 +92,4 @@ class ContentLoader extends React.Component<Props, State> {
}
export default ContentLoader
export { Rect, Circle }
export { Rect, Circle }