histogram width divide by mode, not total #2

Merged
christofsteel merged 47 commits from honigle into main 2022-02-02 13:59:36 +01:00
7 changed files with 44 additions and 12 deletions
Showing only changes of commit 34babd87a8 - Show all commits

16
.github/workflows/lint.yml vendored Normal file
View file

@ -0,0 +1,16 @@
name: Lint
on:
pull_request:
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Prettify code
uses: creyD/prettier_action@v4.2
with:
prettier_options: --check src

16
.github/workflows/test.yml vendored Normal file
View file

@ -0,0 +1,16 @@
name: Test
on:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
npm install
- run: |
npm run test

2
package-lock.json generated
View file

@ -28,7 +28,7 @@
"devDependencies": { "devDependencies": {
"autoprefixer": "^10.4.2", "autoprefixer": "^10.4.2",
"postcss": "^8.4.5", "postcss": "^8.4.5",
"prettier": "^2.5.1", "prettier": "2.5.1",
"tailwindcss": "^3.0.12" "tailwindcss": "^3.0.12"
} }
}, },

View file

@ -21,10 +21,12 @@
"react-countdown": "^2.3.2" "react-countdown": "^2.3.2"
}, },
"scripts": { "scripts": {
"start": "react-scripts start",
"build": "react-scripts build", "build": "react-scripts build",
"test": "react-scripts test", "eject": "react-scripts eject",
"eject": "react-scripts eject" "fix": "prettier --write src",
"lint": "prettier --check src",
"start": "react-scripts start",
"test": "react-scripts test"
}, },
"eslintConfig": { "eslintConfig": {
"extends": [ "extends": [
@ -47,7 +49,7 @@
"devDependencies": { "devDependencies": {
"autoprefixer": "^10.4.2", "autoprefixer": "^10.4.2",
"postcss": "^8.4.5", "postcss": "^8.4.5",
"tailwindcss": "^3.0.12", "prettier": "2.5.1",
"prettier": "^2.5.1" "tailwindcss": "^3.0.12"
} }
} }

View file

@ -2,8 +2,8 @@ import React from 'react'
import { render, screen } from '@testing-library/react' import { render, screen } from '@testing-library/react'
import App from './App' import App from './App'
test('renders learn react link', () => { test('renders App component', () => {
render(<App />) render(<App />)
const linkElement = screen.getByText(/learn react/i) const linkElement = screen.getByText(/Not Wordle/)
expect(linkElement).toBeInTheDocument() expect(linkElement).toBeInTheDocument()
}) })

View file

@ -61,9 +61,7 @@ export const BaseModal = ({ title, children, isOpen, handleClose }: Props) => {
> >
{title} {title}
</Dialog.Title> </Dialog.Title>
<div className="mt-2"> <div className="mt-2">{children}</div>
{children}
</div>
</div> </div>
</div> </div>
</div> </div>

View file

@ -4,7 +4,7 @@ import { solutionIndex } from './words'
export const shareStatus = (guesses: string[], lost: boolean) => { export const shareStatus = (guesses: string[], lost: boolean) => {
navigator.clipboard.writeText( navigator.clipboard.writeText(
`Not Wordle ${solutionIndex} ${lost?"X":guesses.length}/6\n\n` + `Not Wordle ${solutionIndex} ${lost?"X":guesses.length}/6\n\n` +
generateEmojiGrid(guesses) generateEmojiGrid(guesses)
) )
} }