Skip to content

Commit da74964

Browse files
committed
simplified the heading component
1 parent e541f26 commit da74964

3 files changed

Lines changed: 22 additions & 40 deletions

File tree

vis/js/components/Heading.js

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import React from "react";
22
import { connect } from "react-redux";
33

4-
import ZoomedInHeadingTemplate from "../templates/ZoomedInHeading";
5-
import ZoomedOutHeadingTemplate from "../templates/ZoomedOutHeading";
6-
74
import {
85
BasicTitle,
96
ProjectTitle,
@@ -22,15 +19,31 @@ const Heading = ({
2219
streamgraph,
2320
}) => {
2421
if (zoomed) {
25-
let label = streamgraph ? localization.area_streamgraph : localization.area;
26-
27-
return <ZoomedInHeadingTemplate label={label} title={bubbleTitle} />;
22+
const label = streamgraph
23+
? localization.area_streamgraph
24+
: localization.area;
25+
26+
return (
27+
// html template starts here
28+
<h4>
29+
<span id="area-bold">{label}:</span>{" "}
30+
<span
31+
id="area-not-bold"
32+
dangerouslySetInnerHTML={{ __html: bubbleTitle }}
33+
></span>
34+
</h4>
35+
// html template ends here
36+
);
2837
}
2938

3039
return (
31-
<ZoomedOutHeadingTemplate>
32-
{renderTitle(localization, query, headingParams)}
33-
</ZoomedOutHeadingTemplate>
40+
// html template starts here
41+
<div className="heading-container">
42+
<h4 className="heading">
43+
{renderTitle(localization, query, headingParams)}
44+
</h4>
45+
</div>
46+
// html template ends here
3447
);
3548
};
3649

vis/js/templates/ZoomedInHeading.jsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

vis/js/templates/ZoomedOutHeading.jsx

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)