Skip to content

Commit

Permalink
fix: initialVisibleSections
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltamaki-okta committed Nov 20, 2024
1 parent 159bfc0 commit 503f6d7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@ const UiShellContent = ({
</StyledBannersContainer>

<StyledAppSwitcherContainer>
{
/* If AppSwitcher should be initially visible and we have not yet received props, render AppSwitcher in the loading state */
initialVisibleSections?.includes("AppSwitcher") &&
!appSwitcherProps && (
<ErrorBoundary fallback={null} onError={onError}>
<AppSwitcher isLoading appIcons={[]} selectedAppName="" />
</ErrorBoundary>
)
}
{appSwitcherProps && (
<ErrorBoundary fallback={null} onError={onError}>
<AppSwitcher {...appSwitcherProps} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export const InvisibleFirstRender: StoryObj<UiShellProps> = {

export const TopNavOnly: StoryObj<UiShellProps> = {
args: {
initialVisibleSections: ["TopNav", "AppSwitcher"],
initialVisibleSections: ["TopNav"],
optionalComponents: sharedOptionalComponents,
subscribeToPropChanges: (subscriber) => {
subscriber({
Expand All @@ -256,6 +256,7 @@ export const TopNavOnly: StoryObj<UiShellProps> = {

export const AppSwitcherOnly: StoryObj<UiShellProps> = {
args: {
initialVisibleSections: ["AppSwitcher"],
subscribeToPropChanges: (subscriber) => {
subscriber({
topNavProps: {},
Expand Down

0 comments on commit 503f6d7

Please sign in to comment.