fix(striker-ui): correct types on FullSize

main
Tsu-ba-me 1 year ago committed by Yanhao Lei
parent 0ada0d4292
commit 44fa698927
  1. 20
      striker-ui/components/Display/FullSize.tsx
  2. 6
      striker-ui/types/FullSize.d.ts

@ -2,7 +2,7 @@ import {
Close as CloseIcon, Close as CloseIcon,
Keyboard as KeyboardIcon, Keyboard as KeyboardIcon,
} from '@mui/icons-material'; } from '@mui/icons-material';
import { Box, IconButtonProps, Menu, styled, Typography } from '@mui/material'; import { Box, Menu, styled, Typography } from '@mui/material';
import RFB from '@novnc/novnc/core/rfb'; import RFB from '@novnc/novnc/core/rfb';
import dynamic from 'next/dynamic'; import dynamic from 'next/dynamic';
import { useState, useEffect, FC, useMemo, useRef, useCallback } from 'react'; import { useState, useEffect, FC, useMemo, useRef, useCallback } from 'react';
@ -39,22 +39,6 @@ const StyledDiv = styled('div')(() => ({
const VncDisplay = dynamic(() => import('./VncDisplay'), { ssr: false }); const VncDisplay = dynamic(() => import('./VncDisplay'), { ssr: false });
type FullSizeOptionalProps = {
onClickCloseButton?: IconButtonProps['onClick'];
};
type FullSizeProps = FullSizeOptionalProps & {
vncReconnectTimerStart: number;
serverUUID: string;
serverName: string | string[] | undefined;
};
const FULL_SIZE_DEFAULT_PROPS: Required<
Omit<FullSizeOptionalProps, 'onClickCloseButton'>
> &
Pick<FullSizeOptionalProps, 'onClickCloseButton'> = {
onClickCloseButton: undefined,
};
// Unit: seconds // Unit: seconds
const DEFAULT_VNC_RECONNECT_TIMER_START = 5; const DEFAULT_VNC_RECONNECT_TIMER_START = 5;
@ -275,6 +259,4 @@ const FullSize: FC<FullSizeProps> = ({
); );
}; };
FullSize.defaultProps = FULL_SIZE_DEFAULT_PROPS;
export default FullSize; export default FullSize;

@ -0,0 +1,6 @@
type FullSizeProps = {
onClickCloseButton?: import('@mui/material').IconButtonProps['onClick'];
serverUUID: string;
serverName: string;
vncReconnectTimerStart?: number;
};
Loading…
Cancel
Save