-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from zattoo/release
Release 1.0.0-alpha.0
- Loading branch information
Showing
16 changed files
with
201 additions
and
168 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This config defines repository maintainers | ||
# and automatically requests reviews from them when a pull request changes any owned files | ||
# For more details see https://github.com/blog/2392-introducing-code-owners | ||
|
||
* @nitzanashi @godban @pverkhovskyi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
We as members, contributors, and leaders pledge to make participation in our | ||
community a harassment-free experience for everyone, regardless of age, body | ||
size, visible or invisible disability, ethnicity, sex characteristics, gender | ||
identity and expression, level of experience, education, socio-economic status, | ||
nationality, personal appearance, race, religion, or sexual identity | ||
and orientation. | ||
|
||
We pledge to act and interact in ways that contribute to an open, welcoming, | ||
diverse, inclusive, and healthy community. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to a positive environment for our | ||
community include: | ||
|
||
* Demonstrating empathy and kindness toward other people | ||
* Being respectful of differing opinions, viewpoints, and experiences | ||
* Giving and gracefully accepting constructive feedback | ||
* Accepting responsibility and apologizing to those affected by our mistakes, | ||
and learning from the experience | ||
* Focusing on what is best not just for us as individuals, but for the | ||
overall community | ||
|
||
Examples of unacceptable behavior include: | ||
|
||
* The use of sexualized language or imagery, and sexual attention or | ||
advances of any kind | ||
* Trolling, insulting or derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or email | ||
address, without their explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a | ||
professional setting | ||
|
||
## Enforcement Responsibilities | ||
|
||
Community leaders are responsible for clarifying and enforcing our standards of | ||
acceptable behavior and will take appropriate and fair corrective action in | ||
response to any behavior that they deem inappropriate, threatening, offensive, | ||
or harmful. | ||
|
||
Community leaders have the right and responsibility to remove, edit, or reject | ||
comments, commits, code, wiki edits, issues, and other contributions that are | ||
not aligned to this Code of Conduct, and will communicate reasons for moderation | ||
decisions when appropriate. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies within all community spaces, and also applies when | ||
an individual is officially representing the community in public spaces. | ||
Examples of representing our community include using an official e-mail address, | ||
posting via an official social media account, or acting as an appointed | ||
representative at an online or offline event. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be | ||
reported to the community leaders responsible for enforcement at [support@zattoo.com](mailto:support@zattoo.com). | ||
All complaints will be reviewed and investigated promptly and fairly. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], | ||
version 2.0, available [here](https://www.contributor-covenant.org/version/2/0/code_of_conduct.html). | ||
|
||
Community Impact Guidelines were inspired by [Mozilla's code of conduct | ||
enforcement ladder](https://github.com/mozilla/diversity). | ||
|
||
[homepage]: https://www.contributor-covenant.org | ||
|
||
For answers to common questions about this code of conduct, see the [FAQ](https://www.contributor-covenant.org/faq). Translations are available [here](https://www.contributor-covenant.org/translations). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Contributing | ||
|
||
Thank you for contributing to this project | ||
|
||
## Issues | ||
|
||
Please report any issues found in this project. | ||
We can't promise to solve it right away but will try to find some resources. Otherwise, feel free to contribute yourself. | ||
|
||
## Pull Request | ||
|
||
Try to bring a clear and comprehensive description of the PR body so it could help us better understand the proposed changes. | ||
|
||
### Quality | ||
|
||
Make sure your PR is passing our quality automation. | ||
|
||
## Help wanted | ||
|
||
If you want to support us, and don't know where to start, there might be some good issues under [help wanted](https://github.com/zattoo/use-double-click/issues?q=is%3Aopen+is%3Aissue+label%3A%22help+wanted) or [good first issue](https://github.com/zattoo/use-double-click/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue) labels. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: Acceptance | ||
|
||
on: [pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '14.x' | ||
- run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} | ||
- run: npm ci | ||
- run: npm run test:lint | ||
- run: npm run test:types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
branches: | ||
- production | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: '14.x' | ||
- run: npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }} | ||
- run: npm ci | ||
- run: npm i @zattoo/zploy@1.0.0-rc.0 -g | ||
- run: zploy --gh_token=${{ secrets.GH_TOKEN }} --npm_token=${{ secrets.NPM_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,44 @@ | ||
# Zattoo use-double-click React Hook | ||
React hook for combining double-click function into click event, as well as repeatable double-click. | ||
# useDoubleClick | ||
|
||
[React hook][0] for continuous double-clicks and combining click and double-click events | ||
|
||
### Install | ||
|
||
```shell | ||
npm install @zattoo/use-double-click | ||
npm i @zattoo/use-double-click --save --save-exact | ||
``` | ||
|
||
Make sure you have at least version 16.8 of `react` and `react-dom` installed, or otherwise hooks won't work for you. | ||
|
||
### Usage | ||
|
||
```jsx | ||
export const Example = () => { | ||
const [doubleClickCount, setDoubleClickCount] = useState(0); | ||
const [clickCount, setClickCount] = useState(0); | ||
|
||
const hybridClick = useDoubleClick( | ||
() => setDoubleClickCount(doubleClickCount + 1), | ||
() => setClickCount(clickCount+1), | ||
300 | ||
() => setClickCount(clickCount + 1), | ||
); | ||
|
||
return ( | ||
<div> | ||
<section> | ||
<p>You clicked {clickCount} times</p> | ||
<p>You double-clicked {doubleClickCount} times</p> | ||
<button onClick={hybridClick}> | ||
<button | ||
type="button" | ||
onClick={hybridClick} | ||
> | ||
Click me | ||
</button> | ||
</div> | ||
</section> | ||
); | ||
} | ||
``` | ||
|
||
### Call Signature | ||
|
||
```typescript | ||
export function useDoubleClick(doubleClick: clickEvent, click?: clickEvent, timeout?: number): clickEvent; | ||
export type clickEvent = (event?: import("react").SyntheticEvent<Element, Event>) => any; | ||
``` | ||
|
||
### Parameters | ||
- `doubleClick: (event? React.SyntheticEvent) => void`: double-click function to be executed when user double-clicks (single or multiple times) on the bounded component. | ||
- `click?: (event? React.SyntheticEvent) => void`: click function to be executed when user clicks (single time) on the bounded component. | ||
- `timeout?: number`: number of milliseconds to detect double-click event | ||
|
||
### Found an issue or have a feature request? | ||
|
||
Open up an issue or pull request and participate. | ||
- `doubleClick: (event? React.SyntheticEvent) => void` - double-click function to be executed when user double-clicks (single or multiple times) on the bounded component. | ||
- `click?: (event? React.SyntheticEvent) => void` - click function to be executed when user clicks (single time) on the bounded component. | ||
- `options?: Object` | ||
- `timeout?: number` - number of milliseconds to detect double-click event | ||
|
||
[0]: https://reactjs.org/docs/hooks-intro.html |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.