-
-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
17,988 additions
and
813 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
} |
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
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
This file was deleted.
Oops, something went wrong.
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,52 +1,36 @@ | ||
import * as React from "react"; | ||
import Svg from "./Svg"; | ||
import * as React from 'react' | ||
import Svg from './Svg' | ||
|
||
export interface IContentLoaderProps { | ||
animate?: boolean; | ||
ariaLabel?: string; | ||
children?: React.ReactNode; | ||
className?: string; | ||
height?: number; | ||
preserveAspectRatio?: "none" | "xMinYMin meet" | "xMidYMin meet" | "xMaxYMin meet" | | ||
"xMinYMid meet" | "xMidYMid meet" | "xMaxYMid meet" | "xMinYMax meet" | "xMidYMax meet" | "xMaxYMax meet" | "xMinYMin slice" | "xMidYMin slice" | "xMaxYMin slice" | "xMinYMid slice" | | ||
"xMidYMid slice" | "xMaxYMid slice" | "xMinYMax slice" | "xMidYMax slice" | "xMaxYMax slice"; | ||
primaryColor?: string; | ||
primaryOpacity?: number; | ||
rtl?: boolean; | ||
secondaryColor?: string; | ||
secondaryOpacity?: number; | ||
speed?: number; | ||
style?: React.CSSProperties; | ||
uniquekey?: string; | ||
width?: number; | ||
} | ||
import { IContentLoaderProps } from './interface' | ||
|
||
export const defaultProps: IContentLoaderProps = { | ||
animate: true, | ||
ariaLabel: "Loading interface...", | ||
ariaLabel: 'Loading interface...', | ||
height: 130, | ||
preserveAspectRatio: "none", | ||
primaryColor: "#f0f0f0", | ||
preserveAspectRatio: 'none', | ||
primaryColor: '#f0f0f0', | ||
primaryOpacity: 1, | ||
rtl: false, | ||
secondaryColor: "#e0e0e0", | ||
secondaryColor: '#e0e0e0', | ||
secondaryOpacity: 1, | ||
speed: 2, | ||
style: {}, | ||
width: 400, | ||
}; | ||
} | ||
|
||
const InitialComponent: React.FunctionComponent<IContentLoaderProps> = (props) => ( | ||
const InitialComponent: React.FunctionComponent< | ||
IContentLoaderProps | ||
> = props => ( | ||
<rect x="0" y="0" rx="5" ry="5" width={props.width} height={props.height} /> | ||
); | ||
) | ||
|
||
export default (props: IContentLoaderProps) => { | ||
const mergedProps = { ...defaultProps, ...props }; | ||
const mergedProps = { ...defaultProps, ...props } | ||
const children = props.children ? ( | ||
props.children | ||
) : ( | ||
<InitialComponent {...mergedProps} /> | ||
); | ||
) | ||
|
||
return <Svg {...mergedProps}>{children}</Svg>; | ||
}; | ||
return <Svg {...mergedProps}>{children}</Svg> | ||
} |
Oops, something went wrong.