Commit 85192cc4 authored by Andrew Hrdy's avatar Andrew Hrdy

Displaying facility labels instead of facility tags (API v2.1).

parent f35800e5
Pipeline #1980 passed with stage
in 1 minute and 40 seconds
import React from 'react';
import Dialog from 'material-ui/Dialog';
import Grid from 'material-ui/Grid';
import FacilityTags from './FacilityTags';
import FacilityLabels from './FacilityLabels';
import WeekHours from './WeekHours';
import Button from 'material-ui/Button';
import Avatar from 'material-ui/Avatar';
......@@ -75,8 +75,8 @@ class FacilityDialog extends React.Component {
</Typography>
</Grid>
<Grid item className={'fd-facility-tags'}>
<FacilityTags facility={facility} />
<Grid item className={'fd-facility-labels'}>
<FacilityLabels facility={facility} />
</Grid>
<Grid item className={'fd-week-hours'}>
......
import React from 'react';
import Chip from 'material-ui/Chip';
const FacilityTags = ({facility}) => {
const FacilityLabels = ({facility}) => {
return (
<div className={'tag-chip-holder'}>
{facility.facility_product_tags && facility.facility_product_tags.map((tag) =>
<Chip className={'tag-chip'} key={tag} label={tag} />
<div className={'label-chip-holder'}>
{facility.facility_labels && facility.facility_labels.map((label) =>
<Chip className={'label-chip'} key={label} label={label} />
)}
</div>
);
};
export default FacilityTags;
\ No newline at end of file
export default FacilityLabels;
\ No newline at end of file
......@@ -7,7 +7,7 @@ import TextwTitle from '../components/TextwTitle';
import FacilitiesMap from '../components/FacilitiesMap';
import classNames from 'classnames';
import WeekHours from './WeekHours';
import FacilityTags from './FacilityTags';
import FacilityLabels from './FacilityLabels';
import CloseIcon from 'material-ui-icons/Close';
import IconButton from 'material-ui/IconButton';
import {removeBrackets} from '../utils/nameUtils';
......@@ -42,7 +42,7 @@ const Sidebar = ({facility, isSidebarOpen, facilities, setSidebar, setSelectedFa
content={facility.facility_location && facility.facility_location.address} />
<TextwTitle label="Phone Number"
content={facility.phone_number ? facility.phone_number : 'Unknown'} />
<TextwTitle label="Tags" content={<FacilityTags facility={facility} />} />
<TextwTitle label="Labels" content={<FacilityLabels facility={facility} />} />
<TextwTitle label="Hours" content={<WeekHours facility={facility} />} />
</div>
</div>
......
......@@ -60,7 +60,7 @@
align-items: center;
}
.fd-facility-tags {
.fd-facility-labels {
@extend .fd-small-grid;
width: 100%;
......
@import '../variables';
.tag-chip-holder {
.label-chip-holder {
display: flex;
flex-wrap: wrap;
}
.tag-chip {
.label-chip {
height: 24px !important;
margin: 2px;
}
@media screen and (max-width: map-get($breakpoints, lg) - 1px) {
.tag-chip-holder {
.label-chip-holder {
justify-content: center;
}
}
\ No newline at end of file
......@@ -6,7 +6,7 @@
@import './components/facilityCategory';
@import './components/facilityDialog';
@import './components/facilityStatus';
@import './components/facilityTags';
@import './components/facilityLabels';
@import './components/favoriteButton';
@import './components/sidebar';
@import './components/textwTitle';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment