-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 sidebar: home template details #51223
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
ffa68fe
Initial commit:
ramonjd bbdecb2
- displaying template areas
ramonjd 69a7c26
- bare bones rest controller changes to return modified for `get_item`
ramonjd c869804
- passing footer class to row
ramonjd d7b7519
- hooking into settings.
ramonjd d857c7a
Refactoring input controls layout
ramonjd 4859f0e
Reverted prefix change to file that was not copied to GB
ramonjd bed5420
Removing last modified changes until the templates API supports it.
ramonjd 4970d48
Showing the details pages for the index template
ramonjd 4860c8f
Fixed new unlock path
ramonjd 076d6cb
updating design of area buttons
ramonjd d0679a7
Updated hover states of area buttons
ramonjd 09601a6
This commit:
ramonjd 6096d07
Don't need these
ramonjd 8b37c3c
Reinstate post title and posts per page controls
ramonjd 374bb50
Updated copy
ramonjd 484e981
Update help text
jameskoster 1316ff9
SidebarNavigationItem instead of button for links to template parts f…
ramonjd 0c8f0b6
Wrap areas in ItemGroup
jameskoster dfe8f75
Remove bottom margin on last detail panel
jameskoster 424cec1
Spacing
jameskoster aa2af8e
Large inputs
jameskoster 88787ed
Leave border radius on inputs as 2px for now
jameskoster 90c3d79
Use NumberControl
jameskoster a7d95ff
Remove debounce
ramonjd 2ade33c
Restore since annotation change made in https://github.com/WordPress/…
ramonjd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
39 changes: 39 additions & 0 deletions
39
packages/edit-site/src/components/sidebar-navigation-screen-details-footer/index.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,39 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __, sprintf } from '@wordpress/i18n'; | ||
import { humanTimeDiff } from '@wordpress/date'; | ||
import { createInterpolateElement } from '@wordpress/element'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import { | ||
SidebarNavigationScreenDetailsPanelRow, | ||
SidebarNavigationScreenDetailsPanelLabel, | ||
SidebarNavigationScreenDetailsPanelValue, | ||
} from '../sidebar-navigation-screen-details-panel'; | ||
|
||
export default function SidebarNavigationScreenDetailsFooter( { | ||
lastModifiedDateTime, | ||
} ) { | ||
return ( | ||
<SidebarNavigationScreenDetailsPanelRow className="edit-site-sidebar-navigation-screen-details-footer"> | ||
<SidebarNavigationScreenDetailsPanelLabel> | ||
{ __( 'Last modified' ) } | ||
</SidebarNavigationScreenDetailsPanelLabel> | ||
<SidebarNavigationScreenDetailsPanelValue> | ||
{ createInterpolateElement( | ||
sprintf( | ||
/* translators: %s: is the relative time when the post was last modified. */ | ||
__( '<time>%s</time>' ), | ||
humanTimeDiff( lastModifiedDateTime ) | ||
), | ||
{ | ||
time: <time dateTime={ lastModifiedDateTime } />, | ||
} | ||
) } | ||
</SidebarNavigationScreenDetailsPanelValue> | ||
</SidebarNavigationScreenDetailsPanelRow> | ||
); | ||
} |
5 changes: 5 additions & 0 deletions
5
packages/edit-site/src/components/sidebar-navigation-screen-details-footer/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,5 @@ | ||
.edit-site-sidebar-navigation-screen-details-footer { | ||
padding-top: $grid-unit-10; | ||
padding-bottom: $grid-unit-10; | ||
padding-left: $grid-unit-20; | ||
} |
40 changes: 40 additions & 0 deletions
40
packages/edit-site/src/components/sidebar-navigation-screen-details-panel/index.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,40 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
__experimentalVStack as VStack, | ||
__experimentalHeading as Heading, | ||
} from '@wordpress/components'; | ||
|
||
/** | ||
* Internal dependencies | ||
*/ | ||
import SidebarNavigationScreenDetailsPanelLabel from './sidebar-navigation-screen-details-panel-label'; | ||
import SidebarNavigationScreenDetailsPanelRow from './sidebar-navigation-screen-details-panel-row'; | ||
import SidebarNavigationScreenDetailsPanelValue from './sidebar-navigation-screen-details-panel-value'; | ||
|
||
function SidebarNavigationScreenDetailsPanel( { title, children, spacing } ) { | ||
return ( | ||
<VStack | ||
className="edit-site-sidebar-navigation-details-screen-panel" | ||
spacing={ spacing } | ||
> | ||
{ title && ( | ||
<Heading | ||
className="edit-site-sidebar-navigation-details-screen-panel__heading" | ||
level={ 3 } | ||
> | ||
{ title } | ||
</Heading> | ||
) } | ||
{ children } | ||
</VStack> | ||
); | ||
} | ||
|
||
export { | ||
SidebarNavigationScreenDetailsPanel, | ||
SidebarNavigationScreenDetailsPanelRow, | ||
SidebarNavigationScreenDetailsPanelLabel, | ||
SidebarNavigationScreenDetailsPanelValue, | ||
}; |
14 changes: 14 additions & 0 deletions
14
.../sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-label.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,14 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __experimentalText as Text } from '@wordpress/components'; | ||
|
||
export default function SidebarNavigationScreenDetailsPanelLabel( { | ||
children, | ||
} ) { | ||
return ( | ||
<Text className="edit-site-sidebar-navigation-details-screen-panel__label"> | ||
{ children } | ||
</Text> | ||
); | ||
} |
29 changes: 29 additions & 0 deletions
29
...ts/sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-row.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,29 @@ | ||
/** | ||
* External dependencies | ||
*/ | ||
import classnames from 'classnames'; | ||
|
||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __experimentalHStack as HStack } from '@wordpress/components'; | ||
|
||
export default function SidebarNavigationScreenDetailsPanelRow( { | ||
label, | ||
children, | ||
className, | ||
} ) { | ||
return ( | ||
<HStack | ||
key={ label } | ||
spacing={ 5 } | ||
alignment="left" | ||
className={ classnames( | ||
'edit-site-sidebar-navigation-details-screen-panel__row', | ||
className | ||
) } | ||
> | ||
{ children } | ||
</HStack> | ||
); | ||
} |
14 changes: 14 additions & 0 deletions
14
.../sidebar-navigation-screen-details-panel/sidebar-navigation-screen-details-panel-value.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,14 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __experimentalText as Text } from '@wordpress/components'; | ||
|
||
export default function SidebarNavigationScreenDetailsPanelValue( { | ||
children, | ||
} ) { | ||
return ( | ||
<Text className="edit-site-sidebar-navigation-details-screen-panel__value"> | ||
{ children } | ||
</Text> | ||
); | ||
} |
25 changes: 25 additions & 0 deletions
25
packages/edit-site/src/components/sidebar-navigation-screen-details-panel/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,25 @@ | ||
.edit-site-sidebar-navigation-details-screen-panel { | ||
margin-bottom: $grid-unit-30; | ||
|
||
&:last-of-type { | ||
margin-bottom: 0; | ||
} | ||
|
||
.edit-site-sidebar-navigation-details-screen-panel__heading { | ||
color: $gray-400; | ||
text-transform: uppercase; | ||
font-weight: 500; | ||
font-size: 11px; | ||
padding: 0; | ||
margin-bottom: 0; | ||
} | ||
} | ||
|
||
.edit-site-sidebar-navigation-details-screen-panel__label.edit-site-sidebar-navigation-details-screen-panel__label { | ||
color: $gray-600; | ||
width: 100px; | ||
} | ||
|
||
.edit-site-sidebar-navigation-details-screen-panel__value.edit-site-sidebar-navigation-details-screen-panel__value { | ||
color: $gray-200; | ||
} |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny nit: again not-blocking, but since this is a generic footer component, I was wondering if the check for whether or not to render the last modified row should exist within this component instead?
Just a thought though, and I wouldn't worry about changing it in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent. I'll add it to the imminent follow-up