Skip to content

Commit e991f05

Browse files
authored
Merge branch 'master' into injected-web3
2 parents 5af8dbd + b453bd2 commit e991f05

File tree

4 files changed

+24
-2
lines changed

4 files changed

+24
-2
lines changed

apps/remix-ide/src/app/panels/layout.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,8 @@ export class Layout extends Plugin {
8080
const params = queryParams.get()
8181
if (params.minimizeterminal || params.embed) {
8282
this.panels.terminal.minimized = true
83-
this.event.emit('change', null)
83+
this.event.emit('change', this.panels)
84+
this.emit('change', this.panels)
8485
}
8586
if (params.minimizesidepanel || params.embed) {
8687
this.event.emit('minimizesidepanel')

libs/remix-ui/panel/src/lib/dragbar/dragbar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ const DragBar = (props: IRemixDragBarUi) => {
2020
props.refObject.current.setAttribute('style', `height: ${h}px;`)
2121
setDragBarPosY(window.innerHeight - props.refObject.current.offsetHeight)
2222
setDragState(false)
23+
props.setHideStatus(false)
2324
}
2425
const handleResize = () => {
2526
setDragBarPosY(window.innerHeight - props.refObject.current.offsetHeight)

libs/remix-ui/panel/src/lib/main/main-panel.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,24 @@ const RemixUIMainPanel = () => {
3737
appContext.layout.event.on('change', () => {
3838
renderPanels()
3939
})
40+
41+
return () => {
42+
appContext.layout.event.off('change')
43+
}
4044
}, [])
4145

46+
const showTerminal = (hide: boolean) => {
47+
appContext.layout.panels.terminal.minimized = hide
48+
appContext.layout.event.emit('change', appContext.layout.panels)
49+
appContext.layout.emit('change', appContext.layout.panels)
50+
}
51+
4252
return (
4353
<div className="mainview">
4454
{Object.values(plugins).map((pluginRecord, i) => {
4555
return (
4656
<React.Fragment key={`mainView${i}`}>
47-
{(pluginRecord.profile.name === 'terminal') ? <DragBar key='dragbar-terminal' hidden={pluginRecord.minimized || false} setHideStatus={() => {}} refObject={terminalRef}></DragBar> : null}
57+
{(pluginRecord.profile.name === 'terminal') ? <DragBar key='dragbar-terminal' hidden={pluginRecord.minimized || false} setHideStatus={showTerminal} refObject={terminalRef}></DragBar> : null}
4858
<RemixUIPanelPlugin
4959
ref={refs[i]}
5060
key={pluginRecord.profile.name}

libs/remix-ui/terminal/src/lib/remix-ui-terminal.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,16 @@ export const RemixUiTerminal = (props: RemixUiTerminalProps) => {
419419
props.plugin.call('layout', 'minimize', props.plugin.profile.name, isOpen)
420420
}
421421

422+
useEffect(() => {
423+
props.plugin.on('layout', 'change', (panels) => {
424+
setIsOpen(!panels.terminal.minimized)
425+
})
426+
427+
return () => {
428+
props.plugin.off('layout', 'change')
429+
}
430+
}, [])
431+
422432
const classNameBlock = 'remix_ui_terminal_block px-4 py-1 text-break'
423433

424434
return (

0 commit comments

Comments
 (0)