Skip to content

Commit

Permalink
chore(src, example): clean up linting, formatting, and type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jspizziri committed Mar 7, 2024
1 parent 519ba22 commit a3dd6de
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 25 deletions.
15 changes: 1 addition & 14 deletions example/src/components/ActionSheet.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { StyleSheet, ScrollView } from 'react-native';
import { ScrollView } from 'react-native';
import { Spacer } from './Spacer';
import { Button } from './Button';
import TrackPlayer from 'react-native-track-player';
Expand Down Expand Up @@ -46,16 +46,3 @@ export const ActionSheet: React.FC = () => {
</ScrollView>
);
};

const styles = StyleSheet.create({
contentContainer: {
flex: 1,
marginTop: '4%',
marginHorizontal: 16,
},
optionRowLabel: {
color: 'white',
fontSize: 20,
fontWeight: '600',
},
});
11 changes: 6 additions & 5 deletions example/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/************************************************
* NOTE: this is the entrypoint for web
************************************************/
import {AppRegistry} from 'react-native';
import { AppRegistry } from 'react-native';
import App from './App';
import TrackPlayer from 'react-native-track-player';
import {PlaybackService} from './services';
import { PlaybackService } from './services';
import 'mux.js';

/******************************************
Expand All @@ -19,10 +19,11 @@ const iconFontStyles = `@font-face {
}`;

// Create stylesheet
const style: any = document.createElement('style');
const style: HTMLStyleElement = document.createElement('style');
style.type = 'text/css';
if (style.styleSheet) {
style.styleSheet.cssText = iconFontStyles;
if ('styleSheet' in style) {
type CSSTextStyleElement = { styleSheet: { cssText: string } };
(style as unknown as CSSTextStyleElement).styleSheet.cssText = iconFontStyles;
} else {
style.appendChild(document.createTextNode(iconFontStyles));
}
Expand Down
1 change: 0 additions & 1 deletion example/src/services/PlaybackService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export async function PlaybackService() {
console.log('Event.PlaybackProgressUpdated', event);
});


TrackPlayer.addEventListener(Event.PlaybackPlayWhenReadyChanged, (event) => {
console.log('Event.PlaybackPlayWhenReadyChanged', event);
});
Expand Down
4 changes: 2 additions & 2 deletions src/TrackPlayerModule.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { NativeModules } from 'react-native'
const { TrackPlayerModule } = NativeModules
import { NativeModules } from 'react-native';
const { TrackPlayerModule } = NativeModules;
export default TrackPlayerModule;
6 changes: 3 additions & 3 deletions src/resolveAssetSource.web.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const resolveAssetResource = (base64: any) => {
if (/^https?:\/\//.test(base64)) {
const resolveAssetResource = (base64: unknown) => {
if (/^https?:\/\//.test(base64 as string)) {
return base64;
}

// TODO: resolveAssetResource for web
return base64;
}
};

export default resolveAssetResource;

0 comments on commit a3dd6de

Please sign in to comment.