design-system
design-system copied to clipboard
Expose a context/provider to allow access to sidebar state
Description
I'm using the sidebar to show menu options and also the application version. It's hard to get the content to fit when in a closed state so it would really help if there was a context that could be used to get the current sidebar state and use that to determine the most appropriate content
@antictor
Could you please provide a real-world example of what you are trying to achieve?
It sounds like you are trying to change the size of the sidebar to account for custom content?
I'm trying to detect if the sidebar is open or closed so I can change the content it shows to match the size, so the opposite of what you said. In this case when it's open I want to say 'version: 1.0.0' but when it's closed use v1
This issue has been marked as stale because it has been open for 60 days with no activity
This issue has been marked as stale because it has been open for 60 days with no activity
@k9dh3zij Can you please cast an eye over this? Is this a misuse of sidebar?
@m7kvqbe1 @antictor Thanks for checking. I don't think this is a misuse of the sidebar, as we do allow content that adjusts depending on whether the sidebar is open or closed (eg. the classification bar which displays "OFFICIAL SENSITIVE" or "OS" respectively).
However, while it's OK to show a summary when closed, I'd be very careful to ensure the information displayed does not change. For example, "v1" is not a summary of "v1.6.99" and can be misleading (and also makes it potentially more difficult for tech support to explain to a user how to get the correct version; at the end of the day I'd ask "is it still useful to see just 'v1', or should I omit that altogether?"). In the example above, "OS" is a summary of "OFFICIAL SENSITIVE" and acts as a helpful reminder - it doesn't change the essence of "OFFICIAL SENSITIVE".
This issue has been marked as stale because it has been open for 60 days with no activity
This issue has been marked as stale because it has been open for 60 days with no activity