Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: replacing inline validations to const #434

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading