Skip to content

Commit 0a7c26b

Browse files
RicbetAaaaash
authored andcommitted
fix: right panel container view (#4178)
1 parent 39593db commit 0a7c26b

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

packages/ai-native/src/browser/layout/tabbar.view.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ const AILeftTabbarRenderer: React.FC = () => {
123123
return (
124124
<>
125125
{visibleContainers.length > 0 && <HorizontalVertical margin={'8px auto 0px'} width={'60%'} />}
126-
{visibleContainers.map((component) => renderContainers(component, currentContainerId))}
126+
{visibleContainers.map((component) => renderContainers(component, tabbarService, currentContainerId))}
127127
</>
128128
);
129129
},

packages/main-layout/src/browser/tabbar/bar.view.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,11 @@ export interface ITabbarViewProps {
5454
canHideTabbar?: boolean;
5555
renderOtherVisibleContainers?: React.FC<{
5656
props: ITabbarViewProps;
57-
renderContainers: (component: ComponentRegistryInfo, currentContainerId: string) => JSX.Element | null;
57+
renderContainers: (
58+
component: ComponentRegistryInfo,
59+
tabbarService: TabbarService,
60+
currentContainerId: string,
61+
) => JSX.Element | null;
5862
}>;
5963
}
6064

@@ -109,7 +113,7 @@ export const TabbarViewBase: React.FC<ITabbarViewProps> = (props) => {
109113
});
110114

111115
const renderContainers = React.useCallback(
112-
(component: ComponentRegistryInfo, currentContainerId?: string) => {
116+
(component: ComponentRegistryInfo, tabbarService: TabbarService, currentContainerId?: string) => {
113117
const containerId = component.options?.containerId;
114118
if (!containerId) {
115119
return null;
@@ -164,13 +168,13 @@ export const TabbarViewBase: React.FC<ITabbarViewProps> = (props) => {
164168
</li>
165169
);
166170
},
167-
[tabbarService],
171+
[],
168172
);
169173

170174
return (
171175
<div className={cls([styles_tab_bar, className])}>
172176
<div className={styles_bar_content} style={{ flexDirection: Layout.getTabbarDirection(direction) }}>
173-
{visibleContainers.map((component) => renderContainers(component, currentContainerId))}
177+
{visibleContainers.map((component) => renderContainers(component, tabbarService, currentContainerId))}
174178
{renderOtherVisibleContainers({ props, renderContainers })}
175179
{hideContainers.length ? (
176180
<li
@@ -308,7 +312,11 @@ export const RightTabbarRenderer: React.FC<{ barSize?: number; style?: React.CSS
308312
export const LeftTabbarRenderer: React.FC<{
309313
renderOtherVisibleContainers?: React.FC<{
310314
props: ITabbarViewProps;
311-
renderContainers: (component: ComponentRegistryInfo, currentContainerId: string) => JSX.Element | null;
315+
renderContainers: (
316+
component: ComponentRegistryInfo,
317+
tabbarService: TabbarService,
318+
currentContainerId: string,
319+
) => JSX.Element | null;
312320
}>;
313321
isRenderExtraTopMenus?: boolean;
314322
renderExtraMenus?: React.ReactNode;

0 commit comments

Comments
 (0)