Skip to content

Commit

Permalink
feat(customCheckZone) Allow the user to define a custom checkZone thr…
Browse files Browse the repository at this point in the history
…ough props
  • Loading branch information
dopey2 committed Nov 7, 2021
1 parent a6bb86c commit 4f305ad
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 83 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"react/jsx-handler-names": 0,
"react/jsx-fragments": 0,
"react/no-unused-prop-types": 0,
"import/export": 0
"import/export": 0,
"semi": ["error", "always"]
}
}
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"singleQuote": true,
"jsxSingleQuote": true,
"semi": false,
"semi": true,
"tabWidth": 2,
"bracketSpacing": true,
"jsxBracketSameLine": false,
Expand Down
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,16 @@ const App = () => {

### Props

| **name** | **type** | **default** |
|---------------|----------------|-------------|
| width | number | |
| height | number | |
| image | File or Base64 | |
| finishPercent | ?number | 70 |
| brushSize | ?number | 20 |
| onComplete | ?callback | |
| customBrush | ?CustomBrush | |
| **name** | **type** | **default** |
|-----------------|-----------------|-------------|
| width | number | |
| height | number | |
| image | File or Base64 | |
| finishPercent | ?number | 70 |
| brushSize | ?number | 20 |
| onComplete | ?callback | |
| customBrush | ?CustomBrush | |
| customCheckZone | ?CustomCheckZone| |


### CustomBrush
Expand All @@ -109,6 +110,16 @@ const App = () => {
| height | number |
| image | File or Base64 |

### CustomCheckZone

| **name** | **type** |
|----------|----------------|
| x | number |
| y | number |
| width | number |
| height | number |



## License

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-scratchcard-v2",
"version": "1.0.0",
"version": "1.0.2",
"description": "A scratchcard component for React",
"author": "dopey2",
"license": "MIT",
Expand Down
162 changes: 91 additions & 71 deletions src/index.tsx

Large diffs are not rendered by default.

0 comments on commit 4f305ad

Please sign in to comment.