Skip to content

Commit

Permalink
Added conditional rendering for colorName and color setting in menu
Browse files Browse the repository at this point in the history
  • Loading branch information
douMax committed May 19, 2019
1 parent 68cd711 commit 1ea5fee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class App extends Component {

return selected ? (
<div className='App' tabIndex='-1' onKeyPress={this.handleKeyPress}>
<div id='color-name' className={colorStayChecked ? '' : 'fadeout'} />
<div id='color-name' style={{ display: selected === 'blobs' ? 'none' : 'block' }} className={colorStayChecked ? '' : 'fadeout'} />
<LoadedVerses className={selected} />
<P5Wrapper sketch={sketches[selected]} isPlaying={isPlaying} />
<ConfigMenu
Expand Down
14 changes: 8 additions & 6 deletions src/components/ConfigMenu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,14 @@ class ConfigMenu extends Component {
onChange={onDefaultPlayChange}
/>
</Menu.Item>
<Menu.Item secondaryText='保留颜色名称'>
<Switch
checked={colorStayChecked}
onChange={onColorStayChange}
/>
</Menu.Item>
{selected === 'waves' && (
<Menu.Item secondaryText='保留颜色名称'>
<Switch
checked={colorStayChecked}
onChange={onColorStayChange}
/>
</Menu.Item>
)}
</Menu.Group>
</Menu>
}
Expand Down

0 comments on commit 1ea5fee

Please sign in to comment.