Skip to content

Commit

Permalink
fix: replacing inline validations to const (#434)
Browse files Browse the repository at this point in the history
  • Loading branch information
LMArts authored Oct 30, 2023
1 parent bd8b443 commit dc14904
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 dc14904

Please sign in to comment.