11import React , { CSSProperties , HTMLAttributes , ReactNode , useEffect , useState } from 'react' ;
2- import { Button } from 'antd ' ;
2+ import { FullscreenExitOutlined , FullscreenOutlined } from '@dtinsight/react-icons ' ;
33
4+ import Button from '../button' ;
45import KeyEventListener from '../keyEventListener' ;
56import useLocale from '../locale/useLocale' ;
6- import MyIcon from './icon ' ;
7+ import './index.scss ' ;
78
89const { KeyCombiner } = KeyEventListener ;
910declare let document : any ;
@@ -27,7 +28,6 @@ interface DocumentWithFullscreen extends Document {
2728
2829export interface IFullscreenProps
2930 extends React . DetailedHTMLProps < HTMLAttributes < HTMLElement > , HTMLElement > {
30- themeDark ?: boolean ;
3131 target ?: string ;
3232 iconStyle ?: CSSProperties ;
3333 fullIcon ?: ReactNode ;
@@ -36,7 +36,6 @@ export interface IFullscreenProps
3636}
3737
3838export default function Fullscreen ( {
39- themeDark,
4039 target,
4140 fullIcon,
4241 exitFullIcon,
@@ -178,24 +177,34 @@ export default function Fullscreen({
178177 } ;
179178
180179 return (
181- < KeyCombiner
182- onTrigger = { handlePressFullScreen }
183- keyMap = { {
184- 70 : true ,
185- 91 : true ,
186- 16 : true ,
187- } }
188- >
189- { customIcon ? (
190- < span { ...other } onClick = { handleFullScreen } >
191- { customIcon }
192- </ span >
193- ) : (
194- < Button onClick = { handleFullScreen } >
195- < MyIcon style = { iconStyle } type = { isFullScreen } themeDark = { themeDark } />
196- { isFullScreen ? locale . exitFull : locale . full }
197- </ Button >
198- ) }
199- </ KeyCombiner >
180+ < div className = "dtc-fullscreen" >
181+ < KeyCombiner
182+ onTrigger = { handlePressFullScreen }
183+ keyMap = { {
184+ 70 : true ,
185+ 91 : true ,
186+ 16 : true ,
187+ } }
188+ >
189+ { customIcon ? (
190+ < span { ...other } onClick = { handleFullScreen } >
191+ { customIcon }
192+ </ span >
193+ ) : (
194+ < Button
195+ onClick = { handleFullScreen }
196+ icon = {
197+ isFullScreen ? (
198+ < FullscreenExitOutlined style = { iconStyle } />
199+ ) : (
200+ < FullscreenOutlined style = { iconStyle } />
201+ )
202+ }
203+ >
204+ { isFullScreen ? locale . exitFull : locale . full }
205+ </ Button >
206+ ) }
207+ </ KeyCombiner >
208+ </ div >
200209 ) ;
201210}
0 commit comments