Skip to content

Commit fdfad8b

Browse files
committed
Split BasicField component as ChipList to address browser warnings.
1 parent 9e6d5f2 commit fdfad8b

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

src/components/SchoolContent.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import LikeThis from "./LikeThis";
1515
import ShareButton from "./ShareButton";
1616

1717
import BasicField from "./fields/BasicField";
18+
import ChipList from "./fields/ChipList";
1819
import Email from "./fields/Email";
1920
import Stipend from "./fields/Stipend";
2021
import BusinessType from "./fields/BusinessType";
@@ -167,7 +168,7 @@ class SchoolContent extends Component {
167168
/>
168169
);
169170
});
170-
locations = <BasicField value={locationItems} heading="Locations" />
171+
locations = <ChipList value={locationItems} heading="Locations" />
171172
}
172173

173174
let technologies = "";
@@ -182,7 +183,7 @@ class SchoolContent extends Component {
182183
/>
183184
);
184185
});
185-
technologies = <BasicField value={techItems} heading="Technologies" />
186+
technologies = <ChipList value={techItems} heading="Technologies" />
186187
}
187188

188189
let emailButton = "";

src/components/fields/ChipList.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import React from "react";
2+
import Tooltip from '@material-ui/core/Tooltip';
3+
4+
const ChipList = props => {
5+
let heading = "";
6+
if (props.tooltip) {
7+
heading = <div className="heading">
8+
<Tooltip placement="top-start" title={props.tooltip}>
9+
<div>{props.heading}</div>
10+
</Tooltip>
11+
</div>
12+
} else {
13+
heading = <div className="heading">{props.heading}</div>
14+
}
15+
16+
return (
17+
<div>
18+
{heading}
19+
{props.value}
20+
</div>
21+
);
22+
};
23+
24+
export default ChipList;

0 commit comments

Comments
 (0)