-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1451 from creative-commoners/pulls/2/security-ext…
…ensions NEW migrate functionality from security-extensions module
- Loading branch information
Showing
27 changed files
with
1,029 additions
and
36 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
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
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React, { PureComponent } from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classnames from 'classnames'; | ||
|
||
class CircularLoading extends PureComponent { | ||
render() { | ||
const { className, size, block } = this.props; | ||
|
||
const classNames = classnames('ss-circular-loading-indicator', className, { | ||
'ss-circular-loading-indicator--block': block, | ||
}); | ||
|
||
return <div style={{ height: size, width: size }} className={classNames} />; | ||
} | ||
} | ||
|
||
CircularLoading.propTypes = { | ||
className: PropTypes.string, | ||
block: PropTypes.bool, | ||
size: PropTypes.string, | ||
}; | ||
|
||
CircularLoading.defaultProps = { | ||
block: false, | ||
size: '6em', | ||
}; | ||
|
||
export default CircularLoading; |
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,55 @@ | ||
$color-blue: rgba(0, 113, 196, 1); | ||
$font-size-small: 10px; | ||
|
||
$loading-indicator-size: 6em; | ||
$loading-indicator-border-size: .4em; | ||
$loading-indicator-border: $loading-indicator-border-size solid transparent; | ||
$loading-indicator-speed: 1.1s; | ||
$loading-indicator-animation: spinner-loader $loading-indicator-speed infinite linear; | ||
|
||
.ss-circular-loading-indicator { | ||
&, | ||
&:after { | ||
border-radius: 50%; | ||
width: $loading-indicator-size; | ||
height: $loading-indicator-size; | ||
} | ||
|
||
&--block { | ||
margin: 30px auto; | ||
} | ||
|
||
font-size: $font-size-small; | ||
position: relative; | ||
text-indent: -9999em; | ||
border: $loading-indicator-border; | ||
border-left: $loading-indicator-border-size solid $color-blue; | ||
-webkit-transform: translateZ(0); | ||
-ms-transform: translateZ(0); | ||
transform: translateZ(0); | ||
-webkit-animation: $loading-indicator-animation; | ||
animation: $loading-indicator-animation; | ||
} | ||
|
||
@-webkit-keyframes spinner-loader { | ||
0% { | ||
-webkit-transform: rotate(0deg); | ||
transform: rotate(0deg); | ||
} | ||
|
||
100% { | ||
-webkit-transform: rotate(360deg); | ||
transform: rotate(360deg); | ||
} | ||
} | ||
@keyframes spinner-loader { | ||
0% { | ||
-webkit-transform: rotate(0deg); | ||
transform: rotate(0deg); | ||
} | ||
|
||
100% { | ||
-webkit-transform: rotate(360deg); | ||
transform: rotate(360deg); | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
client/src/components/Loading/tests/CircularLoading-test.js
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,27 @@ | ||
/* global jest, describe, it, expect */ | ||
import React from 'react'; | ||
import Enzyme, { shallow } from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
import CircularLoading from '../CircularLoading'; | ||
|
||
Enzyme.configure({ adapter: new Adapter() }); | ||
|
||
describe('CircularLoading', () => { | ||
describe('render()', () => { | ||
it('can be displayed as "block"', () => { | ||
const wrapper = shallow( | ||
<CircularLoading block /> | ||
); | ||
|
||
expect(wrapper.find('.ss-circular-loading-indicator--block')).toHaveLength(1); | ||
}); | ||
|
||
it('allows extra classes to be provided', () => { | ||
const wrapper = shallow( | ||
<CircularLoading className="hello-world" /> | ||
); | ||
|
||
expect(wrapper.find('.ss-circular-loading-indicator.hello-world')).toHaveLength(1); | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.