import React from 'react'; import { post } from '../../requests'; import Window from '../../components/Window/Window'; import ContentSection from '../../components/ContentSection/ContentSection'; import TimerButton from './TimerButton/TimerButton'; import SmartList from '../../components/SmartList/SmartList'; import SolutionCard from '../../components/SolutionCard/SolutionCard'; import { Button, makeStyles } from '@material-ui/core'; const useStyles = makeStyles(theme => ({ primary: { padding: theme.spacing(4), }, cell: { padding: theme.spacing(5), }, })); const Timer = ({ user, recentSolutions, setRecentSolutions, setPage }) => { const classes = useStyles(); const registerResult = result => { const solution = { author_id: user.id, result }; post('solutions/', solution).then(response => { setRecentSolutions([response.data].concat(recentSolutions)); }); }; const handleLearnMore = () => { setPage('contribute'); }; const handleLogin = () => { setPage('profile'); }; const removeSolution = (id) => { setRecentSolutions(recentSolutions.filter((solution => solution.id !== id))); }; const renderItem = ({ index, style }) => { const solution = recentSolutions[index]; return (
); }; return ( <>

ChronoCube is a professional speedcubing timer. Share your results publicly - let everyone see your progress and achievements! Every speedcuber will benefit from using it - both amateur and professional!

{user.id === null &&

Tell us your name so we can track your progress

}
); }; export default Timer;