-
Notifications
You must be signed in to change notification settings - Fork 24
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
1 parent
d0096ac
commit 1c9d130
Showing
6 changed files
with
73 additions
and
13 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,18 +1,36 @@ | ||
import * as React from 'react'; | ||
|
||
interface IProps { | ||
overlay?: boolean; | ||
interface IPropsOverlay { | ||
overlay: true; | ||
backgroundColor?: React.CSSProperties['backgroundColor']; | ||
} | ||
|
||
interface IPropsInline { | ||
overlay?: false; | ||
width?: React.CSSProperties['width']; | ||
height?: React.CSSProperties['height']; | ||
backgroundColor?: React.CSSProperties['backgroundColor']; | ||
} | ||
|
||
type IProps = IPropsOverlay | IPropsInline; | ||
|
||
export class Loader extends React.Component<IProps> { | ||
render() { | ||
|
||
if (this.props.overlay) { | ||
return ( | ||
<div className='sd-loader'></div> | ||
<div className="sd-loader" style={{backgroundColor: this.props.backgroundColor}} /> | ||
); | ||
} else { | ||
return null; | ||
return ( | ||
<div | ||
className="sd-loader--inline" | ||
style={{ | ||
width: this.props.width, | ||
height: this.props.height, | ||
backgroundColor: this.props.backgroundColor, | ||
}} | ||
/> | ||
); | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import * as React from 'react'; | ||
import * as Markup from '../../js/react'; | ||
import {Loader} from '../../../app-typescript'; | ||
|
||
export default class LoaderDoc extends React.Component { | ||
render() { | ||
return ( | ||
<section className='docs-page__container'> | ||
<h2 className='docs-page__h2'>Loader</h2> | ||
|
||
<Markup.ReactMarkup> | ||
<Markup.ReactMarkupPreview> | ||
<Loader /> | ||
</Markup.ReactMarkupPreview> | ||
|
||
<Markup.ReactMarkupCode>{` | ||
<Loader /> | ||
`} | ||
</Markup.ReactMarkupCode> | ||
</Markup.ReactMarkup> | ||
</section> | ||
) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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