-
Notifications
You must be signed in to change notification settings - Fork 479
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show icons in redesigned and existing progress dots (Unrevert 13212) #13248
Changes from 1 commit
378b82a
2e10d3e
05ac9b7
92b3d5f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,6 +134,19 @@ const styles = { | |
status: BUBBLE_COLORS | ||
}; | ||
|
||
// Longer term, I'd like the server to provide us an icon type, instead of a | ||
// className. For now, I'm going to use the className in level.icon as if it | ||
// were actually a type key. | ||
const iconClassFromIconType = { | ||
'fa-file-text': 'fa fa-file-text', | ||
// Explicitly don't want to use an icon for this type | ||
'fa-list-ol': undefined, | ||
'fa-external-link-square': 'fa fa-external-link-square', | ||
'fa-video-camera': 'fa fa-video-camera', | ||
'fa-stop-circle': 'fa fa-stop-circle', | ||
'fa-map': 'fa fa-map', | ||
}; | ||
|
||
export const BubbleInterior = React.createClass({ | ||
propTypes: { | ||
showingIcon: React.PropTypes.bool, | ||
|
@@ -202,8 +215,8 @@ export const ProgressDot = Radium(React.createClass({ | |
|
||
// fa-list-ol is used only by our redesigned dots, but we don't want to use | ||
// it here | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
if (level.icon && level.icon !== 'fa-list-ol') { | ||
return 'fa ' + level.icon; | ||
if (level.icon) { | ||
return iconClassFromIconType[level.icon]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You used to return |
||
} | ||
return ''; | ||
}, | ||
|
@@ -235,7 +248,7 @@ export const ProgressDot = Radium(React.createClass({ | |
isLocked && styles.disabledLevel | ||
]} | ||
> | ||
{(level.icon && !isPeerReview) ? | ||
{(iconClassFromIconType[level.icon] && !isPeerReview) ? | ||
<i | ||
className={this.iconClassName()} | ||
style={[ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -443,7 +443,8 @@ describe('ProgressDot component tests', () => { | |
); | ||
|
||
const result = renderer.getRenderOutput(); | ||
expect(result.props.children[0].props.className).to.equal(''); | ||
expect(result.props.children[0].type).to.equal('div'); | ||
expect(result.props.children[0].props.className).to.equal(undefined); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, seems intentional. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't think it makes a big difference one way or the other really, but There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should your default case return There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ahh yes, probably. I expect to do some future work here in the near future, so I'll try to remember to clean that up then. |
||
}); | ||
|
||
it('has no icon in header', () => { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍