Skip to content

Commit

Permalink
Merge pull request #19807 from gitstart/fix/showPanel-mobile-view
Browse files Browse the repository at this point in the history
UI: Fix `showPanel=false` doesn't work on mobile view
  • Loading branch information
JReinhold authored Nov 17, 2022
2 parents 0545893 + 2061671 commit 7ca44e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 3 additions & 0 deletions code/ui/manager/src/components/layout/mobile.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ export const InitialCanvas = ({ props }: { props: MobileProps }) => (
export const InitialAddons = ({ props }: { props: MobileProps }) => (
<Mobile {...props} options={{ ...props.options, initialActive: ActiveTabs.ADDONS }} />
);
export const NoPanel = ({ props }: { props: MobileProps }) => (
<Mobile {...props} options={{ ...props.options, showPanel: false }} />
);

export const Fullscreen = ({ props }: { props: MobileProps }) => (
<Mobile
Expand Down
8 changes: 2 additions & 6 deletions code/ui/manager/src/components/layout/mobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,7 @@ export interface Page {
}

export interface MobileProps {
options: {
initialActive: ActiveTabsType;
showToolbar: boolean;
isFullscreen: boolean;
};
options: Pick<State['layout'], 'isFullscreen' | 'showPanel' | 'initialActive' | 'showToolbar'>;
Sidebar: ComponentType<any>;
Preview: ComponentType<any>;
Panel: ComponentType<any>;
Expand Down Expand Up @@ -204,7 +200,7 @@ class Mobile extends Component<MobileProps, MobileState> {
<Route key={key}>{key}</Route>
))}
</TabButton>
{viewMode ? (
{viewMode && options.showPanel ? (
<TabButton
onClick={() => this.setState({ active: ADDONS })}
active={active === ADDONS}
Expand Down

0 comments on commit 7ca44e3

Please sign in to comment.