|
1 | | -import type HangWatch from '@kixelated/hang/watch/element'; |
2 | | -import { customElement } from 'solid-element'; |
3 | | -import { createSignal, onMount } from 'solid-js'; |
4 | | -import BufferingIndicator from './BufferingIndicator'; |
5 | | -import styles from './styles.css'; |
6 | | -import WatchControls from './WatchControls'; |
7 | | -import WatchControlsContextProvider from './WatchControlsContextProvider'; |
| 1 | +import type HangWatch from "@kixelated/hang/watch/element"; |
| 2 | +import { customElement } from "solid-element"; |
| 3 | +import { createSignal, onMount } from "solid-js"; |
| 4 | +import BufferingIndicator from "./BufferingIndicator"; |
| 5 | +import styles from "./styles.css"; |
| 6 | +import WatchControls from "./WatchControls"; |
| 7 | +import WatchControlsContextProvider from "./WatchControlsContextProvider"; |
8 | 8 |
|
9 | | -customElement( |
10 | | - 'hang-publish-ui', |
11 | | - {}, |
12 | | - function PublishControlsWebComponent(_, { element }) { |
13 | | - const [hangWatchhEl, setHangWatchEl] = createSignal<HangWatch>(); |
| 9 | +customElement("hang-watch-ui", {}, function PublishControlsWebComponent(_, { element }) { |
| 10 | + const [hangWatchhEl, setHangWatchEl] = createSignal<HangWatch>(); |
14 | 11 |
|
15 | | - onMount(() => { |
16 | | - const watchEl = element.querySelector('hang-watch'); |
| 12 | + onMount(() => { |
| 13 | + const watchEl = element.querySelector("hang-watch"); |
17 | 14 |
|
18 | | - if (watchEl) { |
19 | | - setHangWatchEl(watchEl); |
20 | | - } |
21 | | - }); |
| 15 | + if (watchEl) { |
| 16 | + setHangWatchEl(watchEl); |
| 17 | + } |
| 18 | + }); |
22 | 19 |
|
23 | | - return ( |
24 | | - <WatchControlsContextProvider hangWatch={hangWatchhEl}> |
25 | | - <style>{styles}</style> |
26 | | - <div class="watchVideoContainer"> |
27 | | - <slot /> |
28 | | - <BufferingIndicator /> |
29 | | - </div> |
30 | | - <WatchControls /> |
31 | | - </WatchControlsContextProvider> |
32 | | - ); |
33 | | - } |
34 | | -); |
| 20 | + return ( |
| 21 | + <WatchControlsContextProvider hangWatch={hangWatchhEl}> |
| 22 | + <style>{styles}</style> |
| 23 | + <div class="watchVideoContainer"> |
| 24 | + <slot /> |
| 25 | + <BufferingIndicator /> |
| 26 | + </div> |
| 27 | + <WatchControls /> |
| 28 | + </WatchControlsContextProvider> |
| 29 | + ); |
| 30 | +}); |
0 commit comments