mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
refactor(packages): clean up UI component types and data flow (#479)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { FullscreenButtonCore } from '@videojs/core';
|
||||
import { FullscreenButtonCore, FullscreenButtonDataAttrs } from '@videojs/core';
|
||||
import { logMissingFeature, selectFullscreen } from '@videojs/core/dom';
|
||||
import type { ForwardedRef } from 'react';
|
||||
import { forwardRef, useState } from 'react';
|
||||
@@ -32,17 +32,20 @@ export const FullscreenButton = forwardRef(function FullscreenButton(
|
||||
});
|
||||
|
||||
if (!fullscreen) {
|
||||
logMissingFeature('FullscreenButton', 'fullscreen');
|
||||
if (__DEV__) logMissingFeature('FullscreenButton', 'fullscreen');
|
||||
return null;
|
||||
}
|
||||
|
||||
const state = core.getState(fullscreen);
|
||||
|
||||
return renderElement(
|
||||
'button',
|
||||
{ render, className, style },
|
||||
{
|
||||
state: core.getState(fullscreen),
|
||||
state,
|
||||
stateAttrMap: FullscreenButtonDataAttrs,
|
||||
ref: [forwardedRef, buttonRef],
|
||||
props: [core.getAttrs(fullscreen), elementProps, getButtonProps()],
|
||||
props: [core.getAttrs(state), elementProps, getButtonProps()],
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user