Icon based on Disclosure state #645
-
Hi team! We have another implementation question regarding the Console Navigation. When the user has a bug, a pulsing red icon shows up on the monitor tab and moves to nested components as the user goes deeper.
I tried the following solution using disclosure state, but this causes the components to rerender and "jiggle" when the disclosure is opened or closed. Do you have any recommendations on the best way to accomplish this? const MonitorNavitationItem = ({ navigationItem, hasBugs }) => {
const disclosure = useDisclosureState();
const isDebugger = navigationItem.key === "debugger";
return (
<Disclosure key={navigationItem.key} state={disclosure}>
<DisclosureHeading as="div" variant="heading50">
<Box>
<Text as="span">{navigationItem.title}</Text>
{isDebugger && hasBugs && !disclosure.visible ? (
<DebuggerNotification />
) : null}
</Box>
</DisclosureHeading>
<>
{navigationItem.productPages.map((subItem: any) => {
const isEventPage =
navigationItem.key === "debugger" && subItem.key === "events";
return (
<DisclosureContent key={subItem.key}>
<Box>
<NavigationSubItem subItem={subItem} />
{isEventPage && hasBugs && disclosure.visible ? (
<DebuggerNotification />
) : null}
</Box>
</DisclosureContent>
);
})}
</>
</Disclosure>
);
}; |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
Hey @kateschwarz - I'll forward this along to our eng team and see if they have any suggestions. We'll report back soon! |
Beta Was this translation helpful? Give feedback.
-
Hi @kateschwarz, can you provide more information for us please? A Code sandbox using the paste starter template that demonstrates your issue would be super useful to show us whats going on. |
Beta Was this translation helpful? Give feedback.
-
@SiTaggart After some investigation, I found the issue is outside of Paste. Sorry for the unnecessary discussion, and thank you for your help! |
Beta Was this translation helpful? Give feedback.
@SiTaggart After some investigation, I found the issue is outside of Paste. Sorry for the unnecessary discussion, and thank you for your help!