From bcc58a6c1d57ddc658a5d9ff8d1768882287c8ca Mon Sep 17 00:00:00 2001 From: Tim Roberts Date: Sat, 18 May 2024 15:16:50 +0100 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=92=84=20minor=20fix=20for=20exmaple?= =?UTF-8?q?=20styling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- example/App.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/example/App.tsx b/example/App.tsx index 1f5ce2b..015d7bb 100644 --- a/example/App.tsx +++ b/example/App.tsx @@ -22,9 +22,7 @@ import { View, useWindowDimensions, } from "react-native"; -import type { - NativeScrollEvent, - NativeSyntheticEvent} from "react-native"; +import type { NativeScrollEvent, NativeSyntheticEvent } from "react-native"; import { TimerPicker, TimerPickerModal } from "../src"; @@ -205,6 +203,7 @@ export default function App() { secondLabel="" styles={{ theme: "dark", + backgroundColor: "#202020", pickerItem: { fontSize: 34, }, From 709f6e290e9d787e15db824dd936ea1d7e9ad08b Mon Sep 17 00:00:00 2001 From: Tim Roberts Date: Sat, 18 May 2024 15:29:14 +0100 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=93=9D=20=F0=9F=A9=B9=20remove=20defa?= =?UTF-8?q?ult=20click=20sound=20mp3=20asset=20from=20module=20(switch=20t?= =?UTF-8?q?o=20using=20hosted=20asset)=20+=20document=20changes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 +++++- src/assets/select_click.mp3 | Bin 1664 -> 0 bytes src/components/DurationScroll/index.tsx | 7 +++++-- 3 files changed, 10 insertions(+), 3 deletions(-) delete mode 100644 src/assets/select_click.mp3 diff --git a/README.md b/README.md index 553f7a8..a36c971 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,9 @@ This is currently only supported on Expo with the [expo-av](https://www.npmjs.co **To enable audio feedback, you need to supply the imported `Audio` class as a prop to either TimerPickerModal or TimerPicker.** +Please note that the default click sound uses a hosted mp3 file. To make the click sound work offline, you need to supply your own +sound asset through the `clickSoundAsset` prop. You can download the default click sound [here](https://drive.google.com/uc?export=download&id=10e1YkbNsRh-vGx1jmS1Nntz8xzkBp4_I). +
## Installation 🚀 @@ -246,6 +249,7 @@ return ( closeOnOverlayPress use12HourPicker Audio={Audio} + // supply your own custom click sound asset clickSoundAsset={require("./assets/custom_click.mp3")} LinearGradient={LinearGradient} Haptics={Haptics} @@ -396,7 +400,7 @@ return ( | LinearGradient | Linear Gradient Component | [expo-linear-gradient](https://www.npmjs.com/package/expo-linear-gradient).LinearGradient or [react-native-linear-gradient](https://www.npmjs.com/package/react-native-linear-gradient).default | - | false | | Haptics | Haptics Namespace (required for Haptic feedback) | [expo-haptics](https://www.npmjs.com/package/expo-haptics) | - | false | | Audio | Audio Class (required for audio feedback i.e. click sound) | [expo-av](https://www.npmjs.com/package/expo-av).Audio | - | false | -| clickSoundAsset | Custom sound asset for click sound | require(.../somefolderpath) or {uri: www.someurl} | - | false | +| clickSoundAsset | Custom sound asset for click sound (required for offline click sound - download default [here](https://drive.google.com/uc?export=download&id=10e1YkbNsRh-vGx1jmS1Nntz8xzkBp4_I)) | require(.../somefolderpath) or {uri: www.someurl} | - | false | | pickerContainerProps | Props for the picker container | `React.ComponentProps` | - | false | | pickerGradientOverlayProps | Props for both gradient overlays | `Partial` | - | false | | topPickerGradientOverlayProps | Props for the top gradient overlay | `Partial` | - | false | diff --git a/src/assets/select_click.mp3 b/src/assets/select_click.mp3 deleted file mode 100644 index dbc0a7a2ace67b7cfe124871e912c42e5c6c6a82..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1664 zcmeZtF=k-^f#Q&ehzKC9&cMK&SWr-uUy+%cSdyxcQd*Q)l9`{UkeR1YoSK}Umr~4N zpl4uY&H&XQ2GmfTUs{x$s*sdfqL7kWP?EvmX=ug}5*+LbG>{J{?~_=TW@eygtY>Io z0J01U{{MD30As`Hh|IinAcr4_nHd<^m>H%M0`CZc|AYX@a-bWN!EOX`U_gbf7s3R( zW5-@$F#G@S14lp%#w8*Q49dMH)b?uz2rwjYFeI=s6tFWlHXKM$;64x#Ag25v_grJU z^22l7i4RY4ZvL>*flGklgZ>X*#sfzZ3vYppeP~8+Q8xc|G*K41qKH! zI2aFb__1j+bZGzo!N_{xzykpXF=k;VhI5Vyh7vYB5*+{kAIQAI=ETuB-!mam$U|b! z6t+3qjH`PYT;{Qb^8Nq+k1d(Ev6-Ra=7xj}PNs<(As1dIv}CdiocO$LU=$JFVb z4-cp_)$H(|*7e$LJ+;^5bMZwT#(|Qv8J5eNW8dymHj}Sy%nC zTiLBEtJ_xmzxnD*#;1n+g~>gS?)MyE5#SLxAZc~C*ioR-)L*@r(ZQ67VU4kl(FW(o znhrru0xOv6&h)W9a4}eWvf2CjnfIqc4kX<7IquqMo4jgz<%_cmmhyO?;yAg24eEjYNK=s9j#3%oS9UHf`DO^R`icmaXl|*?#{0<6o!e81D~F zc2VXu^*1QiyL8j=lWjBK!h^<>q&Axf${U?gf6Tin#Lz6V7d09`_K0d4XF(Z$qft)|CDS$ yWcfJyx`MOsD)Ip}%pl+PQJtiO!2jO@N3Jm+02Xq( const loadSound = async () => { if (Audio) { const { sound } = await Audio.Sound.createAsync( - clickSoundAsset ?? - require("../../assets/select_click.mp3"), + clickSoundAsset ?? { + // use a hosted sound as a fallback (do not use local asset due to loader issues + // in some environments when including mp3 in library) + uri: "https://drive.google.com/uc?export=download&id=10e1YkbNsRh-vGx1jmS1Nntz8xzkBp4_I", + }, { shouldPlay: false } ); setClickSound(sound); From 5a16703ab68993d4cebb3abfc7f3ec8cfb17f091 Mon Sep 17 00:00:00 2001 From: Tim Roberts Date: Sat, 18 May 2024 15:29:38 +0100 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=A9=B9=20do=20not=20upload=20`src`=20?= =?UTF-8?q?folder=20to=20npm?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .npmignore | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..e850295 --- /dev/null +++ b/.npmignore @@ -0,0 +1,3 @@ +src/ +tests/ +node_modules/ \ No newline at end of file From b6aaf58f5a2e17e04ce2f9cd28af62e53c416bf8 Mon Sep 17 00:00:00 2001 From: Tim Roberts Date: Sat, 18 May 2024 15:29:55 +0100 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=94=96=20bump=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 70b8e4b..27a9fac 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "url": "https://github.com/troberts-28" }, "license": "MIT", - "version": "1.8.1", + "version": "1.8.2", "main": "dist/commonjs/index.js", "types": "dist/typescript/src/index.d.ts", "scripts": {