Skip to content

Instantly share code, notes, and snippets.

@ashraf2047
Last active September 10, 2022 02:10
Show Gist options
  • Select an option

  • Save ashraf2047/74c75e81535f4b23e822b6b02b3e92a2 to your computer and use it in GitHub Desktop.

Select an option

Save ashraf2047/74c75e81535f4b23e822b6b02b3e92a2 to your computer and use it in GitHub Desktop.
// The layout of the windows in the IDE.
this.windowGrid = [
[new FileWindow(), new NoteWindow()],
[new TerminalWindow()],
];
const getWindow = (window) => {
let component;
switch (window.type) {
case constants.NOTE:
component = (
<NoteWindow
key={window.Id}
id={window.Id}
width={calculatedColumnWidthPX}
/>
);
break;
case constants.TERMINAL:
component = (
<TerminalWindow
key={window.Id}
id={window.Id}
height={calculatedRowHeightPX}
width={calculatedColumnWidthPX}
/>
);
break;
case constants.FILE:
component = (
<FileWindow
height={calculatedRowHeightPX}
key={window.Id}
id={window.Id}
width={calculatedColumnWidthPX}
fileTabWidth={fileTabWidth}
/>
);
break;
default:
break;
}
return component;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment