-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(myActivities): Add StatusIndicatorComponent
- add statusIndicator scss file - add colors representing the various statuses - make use of status indicator component in MyActivities and SocietyStats components
- Loading branch information
Chris Maina
committed
Feb 22, 2019
1 parent
0f8f8d5
commit f2ba8ed
Showing
11 changed files
with
68 additions
and
19 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
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,18 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const StatusIndicatorComponent = ({ className, status }) => ( | ||
<span className={`indicator ${className} ${status.replace(/\s/g, '').toLowerCase()}`} /> | ||
); | ||
|
||
StatusIndicatorComponent.defaultProps = { | ||
status: '', | ||
className: '', | ||
}; | ||
|
||
StatusIndicatorComponent.propTypes = { | ||
status: PropTypes.string, | ||
className: PropTypes.string, | ||
}; | ||
|
||
export default StatusIndicatorComponent; |
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
11 changes: 11 additions & 0 deletions
11
src/app/common/components/tests/StatusIndicatorComponent.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,11 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import StatusIndicatorComponent from '../StatusIndicatorComponent'; | ||
|
||
describe('<StatusIndicatorComponent />', () => { | ||
const shallowWrapper = shallow(<StatusIndicatorComponent />); | ||
|
||
it('should have span tag with class indicator', () => { | ||
expect(shallowWrapper.find('.indicator')).toHaveLength(1); | ||
}); | ||
}); |
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 |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
@import './button.scss'; | ||
@import './sidebar.scss'; | ||
@import './table.scss'; | ||
@import './statusIndicator.scss'; |
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 @@ | ||
.indicator:before { | ||
content: ' \25CF'; | ||
font-size: rem(30px); | ||
} | ||
|
||
.completed { | ||
color: $andelaBlue; | ||
} | ||
|
||
.approved { | ||
color: $approvedStatusGreen; | ||
} | ||
|
||
.rejected { | ||
color: $rejectedStatusRed; | ||
} | ||
|
||
.pending { | ||
color: $andelaGold; | ||
} | ||
|
||
.inreview { | ||
color: $inReviewStatusYellow; | ||
} |
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 |
---|---|---|
|
@@ -23,4 +23,4 @@ | |
&:first-child { | ||
padding-left: rem(30px); | ||
} | ||
} | ||
} |
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