-
Notifications
You must be signed in to change notification settings - Fork 903
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #21614 from Yoast/493-add-navigation-sidebar-with-…
…alert-center-and-first-time-configuration-links 493 add navigation sidebar with alert center and first time configuration links
- Loading branch information
Showing
17 changed files
with
299 additions
and
55 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
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,86 @@ | ||
body.seo_page_wpseo_page_new_dashboard { | ||
@apply yst-bg-slate-100; | ||
|
||
/* Move WP footer behind our content. */ | ||
z-index: -1; | ||
|
||
#wpcontent { | ||
padding-left: 0 !important; | ||
} | ||
|
||
#wpfooter { | ||
@apply yst-pr-4; | ||
|
||
@media (min-width: 768px) { | ||
@apply yst-pr-8; | ||
|
||
padding-left: 17rem; | ||
} | ||
} | ||
|
||
.wp-responsive-open #wpbody { | ||
@media screen and (max-width: 782px) { | ||
right: -190px; /* Override to not leave space between the mobile menu and the content. */ | ||
} | ||
} | ||
|
||
#modal-search .yst-modal__close { | ||
margin-top: -0.25rem; | ||
} | ||
|
||
&.sticky-menu { | ||
.yst-root .yst-notifications--bottom-left { | ||
@media (min-width: 783px) and (max-width: 962px) { | ||
left: calc(160px + 2rem); /* Next to admin menu. 160px is the admin menu width. */ | ||
} | ||
} | ||
|
||
&.folded, &.auto-fold { | ||
.yst-root .yst-notifications--bottom-left { | ||
@media (min-width: 783px) and (max-width: 963px) { | ||
left: calc(32px + 2rem); /* Next to admin menu. 32px is the collapsed admin menu width. */ | ||
} | ||
} | ||
} | ||
|
||
&.folded { | ||
.yst-root .yst-notifications--bottom-left { | ||
@media (min-width: 962px) { | ||
left: calc(32px + 2rem); /* Next to admin menu. 32px is the collapsed admin menu width. */ | ||
} | ||
} | ||
} | ||
} | ||
|
||
&:not(.sticky-menu) .wp-responsive-open .yst-root { | ||
.yst-notifications--bottom-left { | ||
@media (max-width: 783px) { | ||
left: calc(190px + 2rem); /* Next to admin menu. 190px is the responsive admin menu width. */ | ||
} | ||
} | ||
} | ||
|
||
.yst-root { | ||
|
||
.yst-mobile-navigation__top { | ||
@media (min-width: 601px) and (max-width: 768px) { | ||
top: 46px; | ||
} | ||
|
||
@media (min-width: 783px) { | ||
@apply yst-hidden; | ||
} | ||
} | ||
|
||
.yst-mobile-navigation__dialog { | ||
z-index: 99999; | ||
} | ||
} | ||
/* RTL */ | ||
|
||
&.rtl { | ||
.yst-root .yst-replacevar .emoji-select-popover { | ||
@apply yst-left-0 yst-right-auto; | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default as RouteLayout } from "./route-layout"; |
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,48 @@ | ||
import { __, sprintf } from "@wordpress/i18n"; | ||
import { Title } from "@yoast/ui-library"; | ||
import PropTypes from "prop-types"; | ||
import { Helmet } from "react-helmet"; | ||
import { LiveAnnouncer, LiveMessage } from "react-aria-live"; | ||
|
||
/** | ||
* @param {Object} props The properties. | ||
* @param {JSX.node} children The children. | ||
* @param {string} title The title. | ||
* @param {JSX.node} [description] The description. | ||
* @returns {JSX.Element} The route layout component. | ||
*/ | ||
const RouteLayout = ( { | ||
children, | ||
title, | ||
description, | ||
} ) => { | ||
const ariaLiveTitle = sprintf( | ||
/* translators: 1: Settings' section title, 2: Yoast SEO */ | ||
__( "%1$s Dashboard - %2$s", "wordpress-seo" ), | ||
title, | ||
"Yoast SEO" | ||
); | ||
return ( | ||
<LiveAnnouncer> | ||
<LiveMessage message={ ariaLiveTitle } aria-live="polite" /> | ||
<Helmet> | ||
<title>Dashboard</title> | ||
</Helmet> | ||
<header className="yst-p-8 yst-border-b yst-border-slate-200"> | ||
<div className="yst-max-w-screen-sm"> | ||
<Title>{ title }</Title> | ||
{ description && <p className="yst-text-tiny yst-mt-3">{ description }</p> } | ||
</div> | ||
</header> | ||
{ children } | ||
</LiveAnnouncer> | ||
); | ||
}; | ||
|
||
RouteLayout.propTypes = { | ||
children: PropTypes.node.isRequired, | ||
title: PropTypes.string.isRequired, | ||
description: PropTypes.node, | ||
}; | ||
|
||
export default RouteLayout; |
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,2 @@ | ||
|
||
export { default as useSelectDashboard } from "./use-select-dashboard"; |
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 @@ | ||
import { useSelect } from "@wordpress/data"; | ||
import { STORE_NAME } from "../constants"; | ||
|
||
/** | ||
* @param {string} selector The name of the selector. | ||
* @param {array} [deps] List of dependencies. | ||
* @param {*} [args] Selector arguments. | ||
* @returns {*} The result. | ||
*/ | ||
const useSelectDashboard = ( selector, deps = [], ...args ) => useSelect( select => select( STORE_NAME )[ selector ]?.( ...args ), deps ); | ||
|
||
export default useSelectDashboard; |
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
Oops, something went wrong.