Skip to content

Commit 775125a

Browse files
committed
Simplify styling
1 parent c6ed77a commit 775125a

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

src/reactComponents/TabContent.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import * as storageModule from '../storage/module';
3131
import * as storageProject from '../storage/project';
3232
import * as commonStorage from '../storage/common_storage';
3333
import { registerToolboxButton } from '../blocks/mrc_event_handler';
34+
import { Content } from 'antd/es/layout/layout';
3435

3536
/** Default size for code panel. */
3637
const CODE_PANEL_DEFAULT_SIZE = '25%';
@@ -188,16 +189,16 @@ export const TabContent: React.FC<TabContentProps> = ({
188189
};
189190

190191
return (
191-
<div style={{ display: 'flex', height: '100%', visibility: isActive ? 'visible' : 'hidden', position: isActive ? 'relative' : 'absolute' }}>
192-
<div style={{ flex: 1, minWidth: 0, display: 'flex', flexDirection: 'column' }}>
192+
<div style={{ display: 'flex', minHeight: '100%', height: '100%' }}>
193+
<Content style={{ flex: 1, minHeight: '100%' }}>
193194
<BlocklyComponent
194195
key={modulePath}
195196
modulePath={modulePath}
196197
onBlocklyComponentCreated={setupBlocklyComponent}
197198
theme={theme}
198199
onWorkspaceCreated={setupWorkspace}
199200
/>
200-
</div>
201+
</Content>
201202
<div
202203
style={{
203204
width: typeof codePanelSize === 'string' ? codePanelSize : `${codePanelSize}px`,

src/reactComponents/Tabs.tsx

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -374,17 +374,12 @@ export function Component(props: TabsProps): React.JSX.Element {
374374

375375
return (
376376
<>
377-
<style>{`
378-
.tabs-full-height .ant-tabs-content-holder {
379-
flex: 1;
380-
overflow: hidden;
381-
}
382-
383-
.tabs-full-height .ant-tabs-content {
377+
<style>{`
378+
.ant-tabs-content {
384379
height: 100%;
385380
}
386381
387-
.tabs-full-height .ant-tabs-tabpane {
382+
.ant-tabs-tabpane {
388383
height: 100%;
389384
}
390385
`}</style>
@@ -464,7 +459,6 @@ export function Component(props: TabsProps): React.JSX.Element {
464459
activeKey={activeKey}
465460
tabBarStyle={{ padding: 0, margin: 0, flex: '0 0 auto' }}
466461
style={{ height: '100%', display: 'flex', flexDirection: 'column' }}
467-
className="tabs-full-height"
468462
hideAdd={false}
469463
items={createTabItems()}
470464
/>

0 commit comments

Comments
 (0)