This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Slider = ({ speed, onSpeedChange }) => { | |
const handleChange = e => onSpeedChange(e.target.value); | |
return ( | |
<input | |
type='range' | |
min='50' | |
max='1000' | |
step='50' | |
value={speed} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const BoardGrid = ({ boardStatus, onToggleCellStatus }) => { | |
const handleClick = (r,c) => onToggleCellStatus(r,c); | |
const tr = []; | |
for (let r = 0; r < totalBoardRows; r++) { | |
const td = []; | |
for (let c = 0; c < totalBoardColumns; c++) { | |
td.push( | |
<td | |
key={`${r},${c}`} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
const totalBoardRows = 40; | |
const totalBoardColumns = 60; | |
const newBoardStatus = () => {}; | |
const BoardGrid = () => {}; | |
const Slider = () => {}; | |
class App extends Component { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const newBoardStatus = (cellStatus = () => Math.random() < 0.3) => { | |
const grid = []; | |
for (let r = 0; r < totalBoardRows; r++) { | |
grid[r] = []; | |
for (let c = 0; c < totalBoardColumns; c++) { | |
grid[r][c] = cellStatus(); | |
} | |
} | |
return grid; | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Components structure: | |
- App | |
- Title | |
- NewTaskBar | |
- UserDisplayPreference | |
- ViewBar | |
- OrderByBar | |
- SearchBar |
NewerOlder