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
Sean Yesmunt
committed
May 10, 2018
1 parent
67da182
commit 87026c8
Showing
8 changed files
with
60 additions
and
36 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,28 +0,0 @@ | ||
// @flow | ||
import * as React from 'react'; | ||
import classnames from 'classnames'; | ||
|
||
type Props = { | ||
dark?: boolean, | ||
}; | ||
|
||
class Spinner extends React.Component<Props> { | ||
static defaultProps = { | ||
dark: false, | ||
}; | ||
|
||
render() { | ||
const { dark } = this.props; | ||
return ( | ||
<div className={classnames('spinner', { 'spinner--dark': dark })}> | ||
<div className="rect rect1" /> | ||
<div className="rect rect2" /> | ||
<div className="rect rect3" /> | ||
<div className="rect rect4" /> | ||
<div className="rect rect5" /> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Spinner; | ||
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,9 @@ | ||
import { connect } from 'react-redux'; | ||
import { selectTheme } from 'redux/selectors/settings'; | ||
import Spinner from './view'; | ||
|
||
const mapStateToProps = state => ({ | ||
theme: selectTheme(state), | ||
}); | ||
|
||
export default connect(mapStateToProps, null)(Spinner); |
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,36 @@ | ||
// @flow | ||
import * as React from 'react'; | ||
import classnames from 'classnames'; | ||
import { DARK_THEME, LIGHT_THEME } from 'constants/settings'; | ||
|
||
type Props = { | ||
dark?: boolean, // always a dark spinner | ||
light?: boolean, // always a light spinner | ||
theme: string, | ||
}; | ||
|
||
const Spinner = (props: Props) => { | ||
const { dark, light, theme } = props; | ||
|
||
return ( | ||
<div | ||
className={classnames('spinner', { | ||
'spinner--dark': !light && (dark || theme === LIGHT_THEME), | ||
'spinner--light': !dark && (light || theme === DARK_THEME), | ||
})} | ||
> | ||
<div className="rect rect1" /> | ||
<div className="rect rect2" /> | ||
<div className="rect rect3" /> | ||
<div className="rect rect4" /> | ||
<div className="rect rect5" /> | ||
</div> | ||
); | ||
}; | ||
|
||
Spinner.defaultProps = { | ||
dark: false, | ||
light: false, | ||
}; | ||
|
||
export default Spinner; |
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