Skip to content

Commit f823260

Browse files
committed
fix home tab height on hidden terminal
1 parent e067fa8 commit f823260

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
3737
themeQuality: themes.light
3838
})
3939

40+
const [isTerminalHidden, setIsTerminalHidden] = useState<boolean>(false)
41+
4042
useEffect(() => {
4143
plugin.call('theme', 'currentTheme').then((theme) => {
4244
// update theme quality. To be used for for images
@@ -56,6 +58,22 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
5658
}
5759
})
5860
})
61+
62+
// Listen to terminal panel visibility events
63+
plugin.call('terminal', 'isPanelHidden').then((hidden) => {
64+
setIsTerminalHidden(hidden)
65+
})
66+
plugin.on('terminal', 'terminalPanelShown', () => {
67+
setIsTerminalHidden(false)
68+
})
69+
plugin.on('terminal', 'terminalPanelHidden', () => {
70+
setIsTerminalHidden(true)
71+
})
72+
73+
return () => {
74+
plugin.off('terminal', 'terminalPanelShown')
75+
plugin.off('terminal', 'terminalPanelHidden')
76+
}
5977
}, [])
6078

6179
const startLearnEth = async () => {
@@ -103,7 +121,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
103121
<HomeTabTitle />
104122
{!(platform === appPlatformTypes.desktop) ? <HomeTabRecentWorkspaces plugin={plugin} /> : <HomeTabRecentWorkspacesElectron plugin={plugin} />}
105123
</div>
106-
<div className="col-lg-4 col-xl-7 col-sm-12" style={{ overflowY: 'auto', maxHeight: '61vh' }}>
124+
<div className="col-lg-4 col-xl-7 col-sm-12" style={{ overflowY: 'auto', maxHeight: isTerminalHidden ? '85vh' : '61vh' }}>
107125
<HomeTabUpdates plugin={plugin} />
108126
<HomeTabFeaturedPlugins plugin={plugin} />
109127
</div>

0 commit comments

Comments
 (0)