Skip to content

Commit

Permalink
fix: replacing inline validations to const
Browse files Browse the repository at this point in the history
  • Loading branch information
LMArts committed Oct 7, 2023
1 parent 36b43fd commit 706bdd0
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions website/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ class Page extends React.Component {

render() {
const { content } = this.state;
const menuBarBackground = content ? common.white : common.black;
const toggleButtonColor = content ? "inherit" : "yellow";
const toggleButtonContent = content ? "VIEW CONTENT JSON" : "EDITOR";
const exampleBlockClassName = content ? "" : "container--dark";

return (
<ThemeProvider theme={theme}>
Expand All @@ -78,21 +82,18 @@ class Page extends React.Component {
</div>
</LinkScroll>

<MenuBar
showLeft={!!content}
background={content ? common.white : common.black}
>
<MenuBar showLeft={!!content} background={menuBarBackground}>
<Grid container justify="flex-end">
<ToggleButton
onClick={this.handleClick}
color={content ? "inherit" : "yellow"}
color={toggleButtonColor}
>
{content ? "VIEW CONTENT JSON" : "EDITOR"}
{toggleButtonContent}
</ToggleButton>
</Grid>
</MenuBar>

<div className={content ? "" : "container--dark"}>
<div className={exampleBlockClassName}>
<Example activeContent={content} />
</div>
</StickyContainer>
Expand Down

0 comments on commit 706bdd0

Please sign in to comment.