Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Navigation Editor: Improve experience for user creating their first m…
…enu (#28767) * Ensure a navigation post cannot be returned with a null menu id * Show empty state when there are no menus * Add loading spinner to empty state * Add some styling * Finesse loading states * Tidy up variables * Refactor AddMenuForm to general component * Add the menu creation form to the empty state * Update contents of add menu form to match design * Style the add menu form * Hide header items when creating first menu * Remove autofocus * Reduce forehead * Move heading element inside form and remove wrapper div * Hide block inspector when creating first menu * Add autofocus back * Move the loading spinner into layout and style * Update e2e test * Fix linting issue caused by git * Wrap boolean logic Co-authored-by: Kai Hao <kevin830726@gmail.com> * Avoid calling selector instead of returning early from selector * Coerce to boolean Co-authored-by: Kai Hao <kevin830726@gmail.com>
- Loading branch information
1 parent
f31c35c
commit 47bb513
Showing
11 changed files
with
213 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
packages/edit-navigation/src/components/add-menu/style.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.edit-navigation-add-menu { | ||
display: flex; | ||
flex-direction: column; | ||
} | ||
|
||
.edit-navigation-add-menu__title { | ||
margin-top: 0; | ||
} | ||
|
||
.edit-navigation-add-menu__create-menu-button { | ||
align-self: flex-end; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/edit-navigation/src/components/layout/empty-state.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { Card, CardBody } from '@wordpress/components'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import AddMenu from '../add-menu'; | ||
|
||
export default function EmptyState() { | ||
return ( | ||
<Card className="edit-navigation-empty-state"> | ||
<CardBody> | ||
<AddMenu /> | ||
</CardBody> | ||
</Card> | ||
); | ||
} |
Oops, something went wrong.