Skip to content

Commit 2955889

Browse files
authored
Merge pull request #6 from oslabs-beta/new-series-button
enter series name textbox fixes
2 parents 62c36dc + cfd9e17 commit 2955889

File tree

2 files changed

+24
-18
lines changed

2 files changed

+24
-18
lines changed

src/app/components/BarGraph.tsx

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const tooltipStyles = {
6262
const BarGraph = props => {
6363
const [{ tabs, currentTab }, dispatch] = useStoreContext();
6464
const { width, height, data, comparison } = props;
65-
const [ seriesNameInput, setSeriesNameInput ] = useState(`Series ${comparison.length}`);
65+
const [seriesNameInput, setSeriesNameInput] = useState(`Series ${comparison.length}`);
6666
const {
6767
tooltipOpen,
6868
tooltipLeft,
@@ -123,11 +123,11 @@ const BarGraph = props => {
123123
}
124124
}
125125
});
126-
126+
127127
const saveSeriesClickHandler = () => {
128128
if (tabs[currentTab].seriesSavedStatus === 'inputBoxOpen') {
129129
const actionNames = document.getElementsByClassName('actionname');
130-
for (let i = 0; i < actionNames.length; i++ ) {
130+
for (let i = 0; i < actionNames.length; i++) {
131131
toStorage.data.barStack[i].name = actionNames[i].value;
132132
}
133133
dispatch(save(toStorage, seriesNameInput));
@@ -137,18 +137,21 @@ const BarGraph = props => {
137137
dispatch(save(toStorage))
138138
}
139139

140-
const textbox = tabs[currentTab].seriesSavedStatus === 'inputBoxOpen' ? <input type="text" id="seriesname" value={seriesNameInput} onChange={e => setSeriesNameInput(e.target.value)} /> : null;
140+
const textbox = tabs[currentTab].seriesSavedStatus === 'inputBoxOpen' ? <input type="text" id="seriesname" placeholder="Enter Series Name" onChange={e => setSeriesNameInput(e.target.value)} /> : null;
141141
return (
142142
<div className="bargraph-position">
143+
143144
{/* <input type="text" id ="seriesname" placeholder="Series Name" /> */}
144-
{textbox}
145-
<button
146-
type="button"
147-
className="save-series-button"
148-
onClick={saveSeriesClickHandler}
149-
>
150-
Save Series
151-
</button>
145+
<div>
146+
{textbox}
147+
<button
148+
type="button"
149+
className="save-series-button"
150+
onClick={saveSeriesClickHandler}
151+
>
152+
Save Series
153+
</button>
154+
</div>
152155
<svg ref={containerRef} width={width} height={height}>
153156
<rect
154157
x={0}
@@ -191,8 +194,8 @@ const BarGraph = props => {
191194
height={bar.height === 0 ? null : bar.height}
192195
width={bar.width}
193196
fill={bar.color}
194-
/* TIP TOOL EVENT HANDLERS */
195-
// Hides tool tip once cursor moves off the current rect.
197+
/* TIP TOOL EVENT HANDLERS */
198+
// Hides tool tip once cursor moves off the current rect.
196199
onMouseLeave={() => {
197200
dispatch(
198201
onHoverExit(data.componentData[bar.key].rtid),
@@ -201,7 +204,7 @@ const BarGraph = props => {
201204
}, 300)),
202205
);
203206
}}
204-
// Cursor position in window updates position of the tool tip.
207+
// Cursor position in window updates position of the tool tip.
205208
onMouseMove={event => {
206209
dispatch(onHover(data.componentData[bar.key].rtid));
207210
if (tooltipTimeout) clearTimeout(tooltipTimeout);

src/app/styles/components/_performanceVisx.scss

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
justify-content: center;
44
}
55

6-
.MuiSwitch-colorPrimary.Mui-checked {
6+
.MuiSwitch-colorPrimary.Mui-checked {
77
color: #62d6fb !important;
88
}
99

1010
.MuiSwitch-switchBase {
11-
color: #ff6569 !important;
11+
color: #ff6569 !important;
1212
}
1313

1414
.MuiSwitch-track {
@@ -17,8 +17,11 @@
1717

1818
.MuiTypography-body1 {
1919
font-size: 1em !important;
20-
}
20+
}
2121

2222
#seriesname {
2323
background-color: white;
24+
float: right;
25+
width: 117px;
26+
margin-right: 38px;
2427
}

0 commit comments

Comments
 (0)