Skip to content

Commit

Permalink
#78 added useSound hook
Browse files Browse the repository at this point in the history
siropkin authored and artzub committed Feb 3, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 1f12216 commit 1ed1e81
Showing 6 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -172,5 +172,8 @@
],
"lint-staged": {
"*.{js,jsx}": "eslint"
},
"dependencies": {
"use-sound": "^2.0.1"
}
}
7 changes: 7 additions & 0 deletions src/models/SoundTypes.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import buttonClickSound from '@/shared/sounds/button-click.mp3';
import buttonHoverSound from '@/shared/sounds/button-hover.mp3';

export const SoundTypes = {
'button-hover': buttonHoverSound,
'button-click': buttonClickSound,
};
6 changes: 6 additions & 0 deletions src/shared/hooks/useSound.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import useSound from 'use-sound';

export {
useSound,
useSound as default,
};
Binary file added src/shared/sounds/button-click.mp3
Binary file not shown.
Binary file added src/shared/sounds/button-hover.mp3
Binary file not shown.
12 changes: 12 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
@@ -6806,6 +6806,11 @@ hosted-git-info@^2.1.4:
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488"
integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==

howler@^2.1.3:
version "2.2.1"
resolved "https://registry.yarnpkg.com/howler/-/howler-2.2.1.tgz#a521a9b495841e8bb9aa12e651bebba0affc179e"
integrity sha512-0iIXvuBO/81CcrQ/HSSweYmbT50fT2mIc9XMFb+kxIfk2pW/iKzDbX1n3fZmDXMEIpYvyyfrB+gXwPYSDqUxIQ==

hpack.js@^2.1.6:
version "2.1.6"
resolved "https://registry.yarnpkg.com/hpack.js/-/hpack.js-2.1.6.tgz#87774c0949e513f42e84575b3c45681fade2a0b2"
@@ -13364,6 +13369,13 @@ url@^0.11.0:
punycode "1.3.2"
querystring "0.2.0"

use-sound@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/use-sound/-/use-sound-2.0.1.tgz#72e70d4bfdda71a6959e5adab0c7e10ff4080a0a"
integrity sha512-wNwnyIOe8QPDQgWRZd3PqVEJ9BpLO+VJX+EpQSb6EvvjblHhnYMD7WIOTQ4hgloC2jC7Az6FhclHilC441De7A==
dependencies:
howler "^2.1.3"

use@^3.1.0:
version "3.1.1"
resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"

0 comments on commit 1ed1e81

Please sign in to comment.