Skip to content

Commit

Permalink
fix: change Math.floor() location (resolve #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
KnowsCount committed Feb 9, 2022
1 parent de90477 commit e74779c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules/
*.tgz
dist
.DS_Store
storybook-static
3 changes: 1 addition & 2 deletions src/Heatmap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { months, days } from './constants'
import './Heatmap.css'

const Heatmap = () => {
const level = Math.floor(Math.random() * 3)
const daysInYear = 365
return (
<>
Expand All @@ -15,7 +14,7 @@ const Heatmap = () => {
{days.map((days, i) => <li key={i}>{days}</li> )}
</ul>
<ul className="squares">
{[...Array(daysInYear)].map((_, i) => <li data-level={level} key={i}></li> )}
{[...Array(daysInYear)].map((_, i) => <li data-level={Math.floor(Math.random() * 3)} key={i}></li> )}
</ul>
</div>
</>
Expand Down

1 comment on commit e74779c

@vercel
Copy link

@vercel vercel bot commented on e74779c Feb 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.