Skip to content

Commit

Permalink
Render the back button conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Jun 5, 2024
1 parent 3cbc45e commit e70b9f2
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/edit-site/src/components/editor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,12 +218,18 @@ export default function EditSiteEditor( { isLoading } ) {
>
{ isEditMode && (
<BackButton>
<Button
className="edit-site-layout__view-mode-toggle"
onClick={ () => setCanvasMode( 'view' ) }
>
<SiteIcon className="edit-site-layout__view-mode-toggle-icon" />
</Button>
{ ( { length } ) =>
length <= 1 && (
<Button
className="edit-site-layout__view-mode-toggle"
onClick={ () =>
setCanvasMode( 'view' )
}
>
<SiteIcon className="edit-site-layout__view-mode-toggle-icon" />
</Button>
)
}
</BackButton>
) }
<SiteEditorMoreMenu />
Expand Down

0 comments on commit e70b9f2

Please sign in to comment.