Skip to content

Commit

Permalink
Run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
tvanlaerhoven committed Sep 11, 2024
1 parent 8defc6b commit d352af8
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 13 deletions.
2 changes: 1 addition & 1 deletion example/index.web.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import {createRoot} from 'react-dom/client';
import App from './App';

createRoot(document.getElementById('app') as HTMLElement).render(<App />);
2 changes: 1 addition & 1 deletion example/web/stub/CastButtonStub.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ViewProps } from 'react-native';
import type {ViewProps} from 'react-native';
import React from 'react';

// Provides a stub for react-native-google-cast on web.
Expand Down
31 changes: 24 additions & 7 deletions example/web/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,19 @@ const CopyWebpackPluginConfig = new CopyWebpackPlugin({
{
// Copy transmuxer worker files.
// THEOplayer will find them by setting `libraryLocation` in the playerConfiguration.
from: path.resolve(projectDirectory, './node_modules/theoplayer/THEOplayer.transmux.*').replace(/\\/g, '/'),
from: path
.resolve(
projectDirectory,
'./node_modules/theoplayer/THEOplayer.transmux.*',
)
.replace(/\\/g, '/'),
to: `${libraryLocation}/[name][ext]`,
},
{
// Copy CSS files
from: path.resolve(projectDirectory, './web/public/*.css').replace(/\\/g, '/'),
from: path
.resolve(projectDirectory, './web/public/*.css')
.replace(/\\/g, '/'),
to: `[name][ext]`,
},
],
Expand Down Expand Up @@ -88,15 +95,25 @@ module.exports = {
'react-native$': 'react-native-web',
'react-native-url-polyfill': 'url-polyfill',
'react-native-google-cast': path.resolve(stubDirectory, 'CastButtonStub'),
'react-native-web': path.resolve(projectDirectory, 'node_modules/react-native-web'),
'react-native-svg': path.resolve(projectDirectory, 'node_modules/react-native-svg-web'),
'react-native-web': path.resolve(
projectDirectory,
'node_modules/react-native-web',
),
'react-native-svg': path.resolve(
projectDirectory,
'node_modules/react-native-svg-web',
),

// Avoid duplicate react env.
'react': path.resolve(projectDirectory, 'node_modules/react'),
'react-dom': path.resolve(projectDirectory, 'node_modules/react-dom')
react: path.resolve(projectDirectory, 'node_modules/react'),
'react-dom': path.resolve(projectDirectory, 'node_modules/react-dom'),
},
},
plugins: [HTMLWebpackPluginConfig, CopyWebpackPluginConfig, new NodePolyfillPlugin()],
plugins: [
HTMLWebpackPluginConfig,
CopyWebpackPluginConfig,
new NodePolyfillPlugin(),
],
devServer: {
// Tells dev-server to open the browser after server had been started.
open: true,
Expand Down
4 changes: 2 additions & 2 deletions src/ui/components/button/SkipButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ export class SkipButton extends PureComponent<SkipButtonProps, SkipButtonState>

private readonly onPlaying = () => {
const player = (this.context as UiContext).player;
const isCasting = player.cast.chromecast?.casting ?? false
this.setState({ enabled: player.seekable.length > 0 || player.buffered.length > 0 || isCasting});
const isCasting = player.cast.chromecast?.casting ?? false;
this.setState({ enabled: player.seekable.length > 0 || player.buffered.length > 0 || isCasting });
};

private readonly onPress = () => {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/seekbar/SeekBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class SeekBar extends PureComponent<SeekBarProps, SeekBarState> {
private _onDurationChange = (event: DurationChangeEvent) => {
const player = (this.context as UiContext).player;
this.setState({ duration: event.duration, seekable: player.seekable });
}
};
private _onProgress = (event: ProgressEvent) => this.setState({ seekable: event.seekable });

private _onSlidingStart = (value: number) => {
Expand Down
2 changes: 1 addition & 1 deletion src/ui/components/seekbar/thumbnail/ThumbnailView.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { PureComponent } from 'react';
import type { ImageErrorEventData, NativeSyntheticEvent, StyleProp, ViewStyle } from "react-native";
import type { ImageErrorEventData, NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
import { Image, View } from 'react-native';
import type { TextTrackCue } from 'react-native-theoplayer';
import { isThumbnailTrack, TextTrack } from 'react-native-theoplayer';
Expand Down

0 comments on commit d352af8

Please sign in to comment.