Skip to content

Commit

Permalink
clean up playableChords logic
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanButton committed Jul 29, 2022
1 parent cb864d6 commit 6327003
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 14 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,5 @@ useSound({

## Developing

- `yarn add --dev eslint -W` will add eslint to workspace
- `yarn build` will build the component and the site, this is mandatory the first time you clone the repo.
- `yarn start` will spin up the storybook and the site and all the packages in watch mode.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"storybook"
],
"devDependencies": {
"eslint": "^8.20.0",
"husky": ">=7.0.1",
"lerna": "^4.0.0",
"lint-staged": ">=11.1.2",
Expand Down
11 changes: 1 addition & 10 deletions packages/react-guitar-fretter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export default function fretter(
const isBarreChord = (fretting: number[]) => {
const strippedFretting = fretting.filter((fret) => fret > 0)
const duplicates = findDuplicates(strippedFretting)

return (
duplicates.length !== 0 &&
duplicates.some(
Expand All @@ -98,15 +97,7 @@ export default function fretter(
const playableChords = (fretting: number[]) => {
const strippedFretting = fretting.filter((fret) => fret > 0)
const duplicates = findDuplicates(strippedFretting)

// console.log(strippedFretting)

if (isOpenChord(fretting) && strippedFretting.length < 5) return true

return (
(strippedFretting.length >= 5 && !duplicates) ||
(duplicates && !isBarreChord(fretting))
)
return strippedFretting.length < 5 || (duplicates && isBarreChord(fretting))
}

const frettings = search<number[]>(
Expand Down
2 changes: 0 additions & 2 deletions packages/react-guitar/src/styles/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/** @jsxRuntime classic /
/* @jsx jsx */
import { css } from '@emotion/react'
import { Theme } from '..'
import color from 'color'
Expand Down

0 comments on commit 6327003

Please sign in to comment.