Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Site Editor: Update Navigation Panel Toggle UI #25622

Merged
merged 8 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function NavigationToggle( { icon, isOpen, onClick } ) {
return null;
}

let buttonIcon = <Icon size="32px" icon={ wordpress } />;
let buttonIcon = <Icon size="36px" icon={ wordpress } />;
david-szabo97 marked this conversation as resolved.
Show resolved Hide resolved

if ( siteIconUrl ) {
buttonIcon = (
Expand All @@ -48,7 +48,7 @@ function NavigationToggle( { icon, isOpen, onClick } ) {
} else if ( isRequestingSiteIcon ) {
buttonIcon = null;
} else if ( icon ) {
buttonIcon = <Icon size="32px" icon={ icon } />;
buttonIcon = <Icon size="36px" icon={ icon } />;
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,58 @@
display: none;

@include break-medium() {
display: flex;
align-items: center;
background-color: #1e1e1e;
height: 61px;
background: $gray-900;
border-radius: 0;
display: flex;
height: $header-height;
}
}

.edit-site-navigation-toggle.is-open {
flex-shrink: 0;
height: $header-height + $border-width; // Cover header border
width: 300px;

.edit-site-navigation-toggle__button {
background: $gray-900;
}
}

.edit-site-navigation-toggle__button {
color: #fff;
margin-left: 14px;
margin-right: 14px;
align-items: center;
background: #23282e; // WP-admin gray.
color: $white;
height: $header-height + $border-width; // Cover header border
width: $header-height;

&.has-icon {
min-width: $header-height;

&:hover {
color: #ddd;
&:hover {
background: #32373d; // WP-admin light-gray.
color: $white;
}
&:active {
color: $white;
}
&:focus {
box-shadow: inset 0 0 0 $border-width-focus var(--wp-admin-theme-color), inset 0 0 0 3px $white;
}
}
}

.edit-site-navigation-toggle.components-button.has-icon {
justify-content: flex-start;
padding: 0;
height: 32px;
width: 32px;
min-width: 32px;
.edit-site-navigation-toggle__site-icon {
width: 36px;
}

.edit-site-navigation-toggle__site-title {
font-style: normal;
font-weight: 600;
font-size: 13px;
line-height: 16px;
color: #ddd;
margin-right: 14px;
font-size: $default-font-size;
line-height: $default-line-height;
color: $gray-300;
margin: 0 $grid-unit-20 0 $grid-unit-10;

display: -webkit-box;
-webkit-line-clamp: 2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,28 @@
import { useState } from '@wordpress/element';
import {
__experimentalNavigation as Navigation,
__experimentalNavigationBackButton as NavigationBackButton,
__experimentalNavigationGroup as NavigationGroup,
__experimentalNavigationItem as NavigationItem,
__experimentalNavigationMenu as NavigationMenu,
} from '@wordpress/components';
import { getBlockType, getBlockFromExample } from '@wordpress/blocks';
import { BlockPreview } from '@wordpress/block-editor';
import { __ } from '@wordpress/i18n';

const NavigationPanel = () => {
const [ showPreview, setShowPreview ] = useState( false );

return (
<div className="edit-site-navigation-panel">
<Navigation>
<NavigationMenu title="Home">
<NavigationItem
item="item-back"
title="Back to dashboard"
href="index.php"
/>
<NavigationBackButton
backButtonLabel={ __( 'Dashboard' ) }
className="edit-site-navigation-panel__back-to-dashboard"
href="index.php"
/>

<NavigationMenu title="Home">
<NavigationGroup title="Example group">
<NavigationItem
item="item-preview"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
}
}

.edit-site-navigation-panel__back-to-dashboard.components-button.is-tertiary {
border-radius: 0;
border-bottom: 1px solid $gray-700;
Copons marked this conversation as resolved.
Show resolved Hide resolved
height: auto;
margin-left: -#{$grid-unit};
padding: $grid-unit $grid-unit-20;
width: calc(100% + #{$grid-unit-20});
}

.edit-site-navigation-panel__preview {
display: none;
border: $border-width solid $gray-400;
Expand Down