|
1 | 1 | import cls from 'classnames'; |
2 | | -import React, { useCallback, useEffect } from 'react'; |
| 2 | +import React, { useCallback, useEffect, useMemo } from 'react'; |
3 | 3 |
|
4 | | -import { ComponentRegistryInfo, SlotLocation, useContextMenus, useInjectable } from '@opensumi/ide-core-browser'; |
| 4 | +import { |
| 5 | + AINativeConfigService, |
| 6 | + ComponentRegistryInfo, |
| 7 | + SlotLocation, |
| 8 | + useContextMenus, |
| 9 | + useInjectable, |
| 10 | +} from '@opensumi/ide-core-browser'; |
5 | 11 | import { EDirection } from '@opensumi/ide-core-browser/lib/components'; |
6 | 12 | import { |
7 | 13 | EnhanceIcon, |
@@ -115,6 +121,7 @@ export const AIRightTabRenderer = ({ |
115 | 121 | components: ComponentRegistryInfo[]; |
116 | 122 | }) => { |
117 | 123 | const tabbarService: TabbarService = useInjectable(TabbarServiceFactory)(SlotLocation.right); |
| 124 | + const aiNativeConfigService: AINativeConfigService = useInjectable<AINativeConfigService>(AINativeConfigService); |
118 | 125 |
|
119 | 126 | const handleClose = useCallback(() => { |
120 | 127 | tabbarService.updateCurrentContainerId(''); |
@@ -143,9 +150,15 @@ export const AIRightTabRenderer = ({ |
143 | 150 | ); |
144 | 151 | }, []); |
145 | 152 |
|
| 153 | + const rightTabRenderClassName = useMemo( |
| 154 | + () => (aiNativeConfigService.layout!.useMergeRightWithLeftPanel ? styles.right_tab_renderer : ''), |
| 155 | + [aiNativeConfigService], |
| 156 | + ); |
| 157 | + |
146 | 158 | return ( |
147 | 159 | <DesignRightTabRenderer |
148 | 160 | components={components} |
| 161 | + className={rightTabRenderClassName} |
149 | 162 | tabbarView={() => <RightTabbarRenderer barSize={0} style={{ width: 0 }} />} |
150 | 163 | tabpanelView={() => <BaseTabPanelView PanelView={ContainerViewFn} />} |
151 | 164 | /> |
|
0 commit comments