Skip to content

Commit

Permalink
Hide chart container when no chart selected.
Browse files Browse the repository at this point in the history
  • Loading branch information
colebillys19 committed Apr 12, 2024
1 parent 8aa7fa8 commit 154e469
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions src/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ import {
const App = () => {
// string passed here determines which chart shows on page load (refer to chartDict constant)
const [activeChart, setActiveChart] = useState('areaStackTemplate');
console.log(activeChart);

return (
<AppContainer className="App">
<AppSubcontainer>
<SelectMenu activeChart={activeChart} setActiveChart={setActiveChart} />
<ChartContainer paddingVal={getPaddingVal(activeChart)}>
{chartDict[activeChart]}
</ChartContainer>
{!!activeChart && activeChart !== '-' && (
<ChartContainer paddingVal={getPaddingVal(activeChart)}>
{chartDict[activeChart]}
</ChartContainer>
)}
</AppSubcontainer>
</AppContainer>
);
Expand Down

0 comments on commit 154e469

Please sign in to comment.