This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
Add extended field handling to facility details #1593
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,6 @@ import React from 'react'; | |
import { withStyles } from '@material-ui/core/styles'; | ||
import ListItem from '@material-ui/core/ListItem'; | ||
import ListItemText from '@material-ui/core/ListItemText'; | ||
import Divider from '@material-ui/core/Divider'; | ||
import ArrowForwardIcon from '@material-ui/icons/ChevronRight'; | ||
|
||
import ShowOnly from './ShowOnly'; | ||
import BadgeVerified from './BadgeVerified'; | ||
|
@@ -13,56 +11,27 @@ const detailsSidebarStyles = () => | |
primaryText: { | ||
wordWrap: 'break-word', | ||
}, | ||
secondaryText: { | ||
color: 'rgba(0, 0, 0, 0.54)', | ||
display: 'flex', | ||
alignItems: 'center', | ||
fontSize: '12px', | ||
justify: 'flex-end', | ||
}, | ||
divider: { | ||
backgroundColor: 'rgba(0, 0, 0, 0.06)', | ||
item: { | ||
boxShadow: '0px -1px 0px 0px rgb(240, 240, 240)', | ||
}, | ||
}); | ||
|
||
const FacilityDetailSidebarDetail = ({ | ||
hasAdditionalContent, | ||
additionalContentCount, | ||
primary, | ||
secondary, | ||
onClick, | ||
hideTopDivider, | ||
verified, | ||
classes, | ||
}) => ( | ||
<> | ||
<ShowOnly when={!hideTopDivider}> | ||
<Divider className={classes.divider} /> | ||
<ListItem className={classes.item}> | ||
<ShowOnly when={verified}> | ||
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. I'm showing the verified badge when an extended field is verified (presumably includes when the contributor is verified, based on upcoming changes). Do we want this, or should there be no badge for verified items? 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. It makes sense that we visually indicate the status of these items. I like shoing the badge. |
||
<BadgeVerified /> | ||
</ShowOnly> | ||
<ListItem | ||
button={hasAdditionalContent} | ||
onClick={() => { | ||
if (!hasAdditionalContent) return; | ||
onClick(); | ||
}} | ||
> | ||
<ShowOnly when={verified}> | ||
<BadgeVerified /> | ||
</ShowOnly> | ||
<ListItemText | ||
primary={primary} | ||
secondary={secondary} | ||
classes={{ primary: classes.primaryText }} | ||
/> | ||
<ShowOnly when={hasAdditionalContent}> | ||
<div className={classes.secondaryText}> | ||
<ListItemText secondary={additionalContentCount} /> | ||
<ArrowForwardIcon /> | ||
</div> | ||
</ShowOnly> | ||
</ListItem> | ||
<Divider className={classes.divider} /> | ||
</> | ||
<ListItemText | ||
primary={primary} | ||
secondary={secondary} | ||
classes={{ primary: classes.primaryText }} | ||
/> | ||
</ListItem> | ||
); | ||
|
||
export default withStyles(detailsSidebarStyles)(FacilityDetailSidebarDetail); |
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 |
---|---|---|
|
@@ -90,7 +90,7 @@ const getContent = ({ | |
secondary: 'Claim this facility', | ||
icon: <BadgeUnclaimed />, | ||
style: { | ||
background: 'rgb(9, 18, 50)', | ||
background: 'rgb(61, 50, 138)', | ||
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. Updating to new unclaimed header color per new wireframes |
||
color: 'rgb(255, 255, 255)', | ||
}, | ||
}; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Switched from using the FacilityDetailSidebarDetail here because the structure is different enough now to make it overly complex