mau coba di hangtuah yang sudah oke fitur exp nya
This commit is contained in:
@@ -71,11 +71,25 @@ const SidePanelWithServices = ({
|
||||
const activatePanelSubscription = panelService.subscribe(
|
||||
panelService.EVENTS.ACTIVATE_PANEL,
|
||||
(activatePanelEvent: Types.ActivatePanelEvent) => {
|
||||
if (sidePanelOpen || activatePanelEvent.forceActive) {
|
||||
const tabIndex = tabs.findIndex(tab => tab.id === activatePanelEvent.panelId);
|
||||
if (tabIndex !== -1) {
|
||||
setActiveTabIndex(tabIndex);
|
||||
// Handle the `-exp` suffix logic
|
||||
const isExpertisePanel = activatePanelEvent.panelId.endsWith('-exp');
|
||||
const realPanelID = isExpertisePanel
|
||||
? activatePanelEvent.panelId.replace(/-exp$/, '')
|
||||
: activatePanelEvent.panelId;
|
||||
|
||||
const tabIndex = tabs.findIndex(tab => tab.id === realPanelID);
|
||||
|
||||
if (isExpertisePanel && side === 'right') {
|
||||
const shouldOpen = !sidePanelOpen; // Use sidePanelOpen to determine toggle state
|
||||
setSidePanelOpen(shouldOpen);
|
||||
|
||||
if (shouldOpen) {
|
||||
setActiveTabIndex(tabIndex !== -1 ? tabIndex : null);
|
||||
} else {
|
||||
setActiveTabIndex(null);
|
||||
}
|
||||
} else if (tabIndex !== -1) {
|
||||
setActiveTabIndex(tabIndex);
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -95,6 +109,7 @@ const SidePanelWithServices = ({
|
||||
onClose={handleClose}
|
||||
onActiveTabIndexChange={handleActiveTabIndexChange}
|
||||
expandedWidth={expandedWidth}
|
||||
servicesManager={servicesManager} // Pass servicesManager ke SidePanel
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user