mirror of
https://github.com/finos/SymphonyElectron.git
synced 2024-12-25 16:31:27 -06:00
SDA-3437 (Fix missing title bar on leave fullscreen) (#1285)
* SDA-3437 - Fix missing title bar on leave fullscreen
This commit is contained in:
parent
289dfb42bb
commit
2ef2be7617
@ -4,11 +4,6 @@ exports[`windows title bar should render correctly 1`] = `
|
||||
<div
|
||||
id="title-bar"
|
||||
onDoubleClick={[Function]}
|
||||
style={
|
||||
Object {
|
||||
"display": "flex",
|
||||
}
|
||||
}
|
||||
>
|
||||
<div
|
||||
className="title-bar-button-container"
|
||||
|
@ -17,8 +17,6 @@ describe('windows title bar', () => {
|
||||
const apiName = 'symphony-api';
|
||||
const maximizeEventLabel = 'maximize';
|
||||
const unmaximizeEventLabel = 'unmaximize';
|
||||
const enterFullScreenEventLabel = 'enter-full-screen';
|
||||
const leaveFullScreenEventLabel = 'leave-full-screen';
|
||||
|
||||
it('should render correctly', () => {
|
||||
const wrapper = shallow(React.createElement(WindowsTitleBar));
|
||||
@ -33,16 +31,6 @@ describe('windows title bar', () => {
|
||||
expect(spy).toBeCalled();
|
||||
expect(spy).nthCalledWith(1, maximizeEventLabel, expect.any(Function));
|
||||
expect(spy).nthCalledWith(2, unmaximizeEventLabel, expect.any(Function));
|
||||
expect(spy).nthCalledWith(
|
||||
3,
|
||||
enterFullScreenEventLabel,
|
||||
expect.any(Function),
|
||||
);
|
||||
expect(spy).nthCalledWith(
|
||||
4,
|
||||
leaveFullScreenEventLabel,
|
||||
expect.any(Function),
|
||||
);
|
||||
});
|
||||
|
||||
it('should call `close` correctly', () => {
|
||||
|
@ -7,7 +7,6 @@ import { i18n } from '../../common/i18n-preload';
|
||||
interface IState {
|
||||
title: string;
|
||||
isMaximized: boolean;
|
||||
isFullScreen: boolean;
|
||||
isDisabled: boolean;
|
||||
}
|
||||
const TITLE_BAR_NAMESPACE = 'TitleBar';
|
||||
@ -27,7 +26,6 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
||||
super(props);
|
||||
this.state = {
|
||||
title: document.title || 'Symphony',
|
||||
isFullScreen: false,
|
||||
isMaximized: false,
|
||||
isDisabled: false,
|
||||
};
|
||||
@ -40,12 +38,6 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
||||
ipcRenderer.on('unmaximize', () =>
|
||||
this.updateState({ isMaximized: false }),
|
||||
);
|
||||
ipcRenderer.on('enter-full-screen', () =>
|
||||
this.updateState({ isFullScreen: true }),
|
||||
);
|
||||
ipcRenderer.on('leave-full-screen', () =>
|
||||
this.updateState({ isFullScreen: false }),
|
||||
);
|
||||
|
||||
ipcRenderer.once('disable-action-button', () => {
|
||||
this.updateState({ isDisabled: true });
|
||||
@ -86,8 +78,7 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
||||
* Renders the component
|
||||
*/
|
||||
public render(): JSX.Element | null {
|
||||
const { title, isFullScreen, isDisabled } = this.state;
|
||||
const style = { display: isFullScreen ? 'none' : 'flex' };
|
||||
const { title, isDisabled } = this.state;
|
||||
|
||||
return (
|
||||
<div
|
||||
@ -97,7 +88,6 @@ export default class WindowsTitleBar extends React.Component<{}, IState> {
|
||||
? this.eventHandlers.onUnmaximize
|
||||
: this.eventHandlers.onMaximize
|
||||
}
|
||||
style={style}
|
||||
>
|
||||
<div className='title-bar-button-container'>
|
||||
<button
|
||||
|
Loading…
Reference in New Issue
Block a user