mirror of
https://github.com/zhigang1992/react-content-loader.git
synced 2026-04-23 20:00:57 +08:00
Added classNames props (#38)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user