Skip to content

Commit 89463a6

Browse files
author
kuldip-simform
committed
refactor(UNT-T23346): code refactoring and documentation update
1 parent 693c572 commit 89463a6

36 files changed

+571
-553
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: "🚀 Publish"
33
on:
44
push:
55
branches:
6-
- main
6+
- master
77

88
jobs:
99
release:

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ CONTRIBUTING.md
77
babel.config.js
88
.buckconfig
99
jest-setup.js
10+
.husky

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
We welcome code changes that improve this library or fix a problem, and please make sure to follow all best practices and test all the changes/fixes before committing and creating a pull request. 🚀 🚀
44

5-
### Commiting and Pushing Changes
5+
### Committing and Pushing Changes
66

77
Commit messages should be formatted as:
88

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 Simform Solutions
3+
Copyright (c) 2024 Simform Solutions
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 97 additions & 96 deletions
Large diffs are not rendered by default.

example/README.md

Lines changed: 0 additions & 79 deletions
This file was deleted.

example/ios/AudioWaveformExample.xcodeproj/project.pbxproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
1515
4A3054DD28F34283AA8FEE0D /* file_example_mp3_15s.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = C2A26BD00D7D401B9804E1AA /* file_example_mp3_15s.mp3 */; };
1616
578F19E664D14A79A203A29B /* file_example_mp3_12s.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = D09FCEB6D8A04D349E9422A5 /* file_example_mp3_12s.mp3 */; };
17-
6393E563479648F7B8E27E90 /* file_example_mp3_700kb.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 2026064602944A9C9A1F84D3 /* file_example_mp3_700kb.mp3 */; };
18-
75825DA638CD44CCB89B4B48 /* index.ts in Resources */ = {isa = PBXBuildFile; fileRef = 4879BE3405234CBFAFAD88DB /* index.ts */; };
1917
7699B88040F8A987B510C191 /* libPods-AudioWaveformExample-AudioWaveformExampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-AudioWaveformExample-AudioWaveformExampleTests.a */; };
2018
81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; };
19+
75825DA638CD44CCB89B4B48 /* index.ts in Resources */ = {isa = PBXBuildFile; fileRef = 4879BE3405234CBFAFAD88DB /* index.ts */; };
2120
F754817CD5E04214A63ED292 /* file_example_mp3_1mg.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 3D92446673D84104B7DBB5E8 /* file_example_mp3_1mg.mp3 */; };
21+
6393E563479648F7B8E27E90 /* file_example_mp3_700kb.mp3 in Resources */ = {isa = PBXBuildFile; fileRef = 2026064602944A9C9A1F84D3 /* file_example_mp3_700kb.mp3 */; };
2222
/* End PBXBuildFile section */
2323

2424
/* Begin PBXContainerItemProxy section */
@@ -42,10 +42,7 @@
4242
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = AudioWaveformExample/Info.plist; sourceTree = "<group>"; };
4343
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = AudioWaveformExample/main.m; sourceTree = "<group>"; };
4444
19F6CBCC0A4E27FBF8BF4A61 /* libPods-AudioWaveformExample-AudioWaveformExampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AudioWaveformExample-AudioWaveformExampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; };
45-
2026064602944A9C9A1F84D3 /* file_example_mp3_700kb.mp3 */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = file_example_mp3_700kb.mp3; path = ../src/assets/audio/file_example_mp3_700kb.mp3; sourceTree = "<group>"; };
4645
3B4392A12AC88292D35C810B /* Pods-AudioWaveformExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AudioWaveformExample.debug.xcconfig"; path = "Target Support Files/Pods-AudioWaveformExample/Pods-AudioWaveformExample.debug.xcconfig"; sourceTree = "<group>"; };
47-
3D92446673D84104B7DBB5E8 /* file_example_mp3_1mg.mp3 */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = file_example_mp3_1mg.mp3; path = ../src/assets/audio/file_example_mp3_1mg.mp3; sourceTree = "<group>"; };
48-
4879BE3405234CBFAFAD88DB /* index.ts */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = index.ts; path = ../src/assets/audio/index.ts; sourceTree = "<group>"; };
4946
5709B34CF0A7D63546082F79 /* Pods-AudioWaveformExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AudioWaveformExample.release.xcconfig"; path = "Target Support Files/Pods-AudioWaveformExample/Pods-AudioWaveformExample.release.xcconfig"; sourceTree = "<group>"; };
5047
5B7EB9410499542E8C5724F5 /* Pods-AudioWaveformExample-AudioWaveformExampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-AudioWaveformExample-AudioWaveformExampleTests.debug.xcconfig"; path = "Target Support Files/Pods-AudioWaveformExample-AudioWaveformExampleTests/Pods-AudioWaveformExample-AudioWaveformExampleTests.debug.xcconfig"; sourceTree = "<group>"; };
5148
5DCACB8F33CDC322A6C60F78 /* libPods-AudioWaveformExample.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-AudioWaveformExample.a"; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -54,6 +51,9 @@
5451
C2A26BD00D7D401B9804E1AA /* file_example_mp3_15s.mp3 */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = file_example_mp3_15s.mp3; path = ../src/assets/audio/file_example_mp3_15s.mp3; sourceTree = "<group>"; };
5552
D09FCEB6D8A04D349E9422A5 /* file_example_mp3_12s.mp3 */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = undefined; includeInIndex = 0; lastKnownFileType = unknown; name = file_example_mp3_12s.mp3; path = ../src/assets/audio/file_example_mp3_12s.mp3; sourceTree = "<group>"; };
5653
ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; };
54+
4879BE3405234CBFAFAD88DB /* index.ts */ = {isa = PBXFileReference; name = "index.ts"; path = "../src/assets/audio/index.ts"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
55+
3D92446673D84104B7DBB5E8 /* file_example_mp3_1mg.mp3 */ = {isa = PBXFileReference; name = "file_example_mp3_1mg.mp3"; path = "../src/assets/audio/file_example_mp3_1mg.mp3"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
56+
2026064602944A9C9A1F84D3 /* file_example_mp3_700kb.mp3 */ = {isa = PBXFileReference; name = "file_example_mp3_700kb.mp3"; path = "../src/assets/audio/file_example_mp3_700kb.mp3"; sourceTree = "<group>"; fileEncoding = undefined; lastKnownFileType = unknown; explicitFileType = undefined; includeInIndex = 0; };
5757
/* End PBXFileReference section */
5858

5959
/* Begin PBXFrameworksBuildPhase section */

example/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ PODS:
375375
- React-jsinspector (0.72.7)
376376
- React-logger (0.72.7):
377377
- glog
378-
- react-native-audio-waveform (0.0.1):
378+
- react-native-audio-waveform (1.0.0):
379379
- RCT-Folly (= 2021.07.22.00)
380380
- React-Core
381381
- react-native-safe-area-context (4.9.0):
@@ -714,7 +714,7 @@ SPEC CHECKSUMS:
714714
React-jsiexecutor: c49502e5d02112247ee4526bc3ccfc891ae3eb9b
715715
React-jsinspector: 8baadae51f01d867c3921213a25ab78ab4fbcd91
716716
React-logger: 8edc785c47c8686c7962199a307015e2ce9a0e4f
717-
react-native-audio-waveform: 1ac5dbbdc1686d3fb48ad1a2ad0851bfd826fca1
717+
react-native-audio-waveform: 7cdb6e4963eeae907240396975b9c79713591758
718718
react-native-safe-area-context: b97eb6f9e3b7f437806c2ce5983f479f8eb5de4b
719719
React-NativeModulesApple: b6868ee904013a7923128892ee4a032498a1024a
720720
React-perflogger: 31ea61077185eb1428baf60c0db6e2886f141a5a

example/src/App.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ import {
1616
} from 'react-native';
1717
import {
1818
FinishMode,
19-
IPlayWaveformRef,
20-
IRecordWaveformRef,
19+
IWaveformRef,
2120
PermissionStatus,
2221
PlayerState,
2322
RecorderState,
@@ -47,7 +46,7 @@ const ListItem = React.memo(
4746
setCurrentPlaying: Dispatch<SetStateAction<string>>;
4847
onPanStateChange: (value: boolean) => void;
4948
}) => {
50-
const ref = useRef<IPlayWaveformRef>(null);
49+
const ref = useRef<IWaveformRef>(null);
5150
const [playerState, setPlayerState] = useState(PlayerState.stopped);
5251
const styles = stylesheet({ currentUser: item.fromCurrentUser });
5352

@@ -88,7 +87,7 @@ const ListItem = React.memo(
8887
resizeMode="contain"
8988
/>
9089
</Pressable>
91-
<Waveform<'static'>
90+
<Waveform
9291
containerStyle={styles.staticWaveformView}
9392
mode="static"
9493
key={item.path}
@@ -113,7 +112,7 @@ const LivePlayerComponent = ({
113112
}: {
114113
setList: Dispatch<SetStateAction<ListItem[]>>;
115114
}) => {
116-
const ref = useRef<IRecordWaveformRef>(null);
115+
const ref = useRef<IWaveformRef>(null);
117116
const [recorderState, setRecorderState] = useState(RecorderState.stopped);
118117
const styles = stylesheet();
119118
const { checkHasAudioRecorderPermission, getAudioRecorderPermission } =
@@ -151,13 +150,13 @@ const LivePlayerComponent = ({
151150

152151
return (
153152
<View style={styles.liveWaveformContainer}>
154-
<Waveform<'live'>
153+
<Waveform
155154
mode="live"
156155
containerStyle={styles.liveWaveformView}
157156
ref={ref}
158157
candleSpace={2}
159158
candleWidth={2}
160-
waveColor={Colors.simformPink}
159+
waveColor={Colors.pink}
161160
onRecorderStateChange={setRecorderState}
162161
/>
163162
<Pressable

example/src/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const styles = (params: StyleSheetParams = {}) =>
8181
buttonImageLive: {
8282
height: '100%',
8383
width: '100%',
84-
tintColor: Colors.simformPink,
84+
tintColor: Colors.pink,
8585
},
8686
simformImageContainer: {
8787
alignItems: 'center',

0 commit comments

Comments
 (0)