-
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: add page details #50767
Changes from 11 commits
0e598d5
237a864
f38ff69
b027db4
5eeb21a
e9d241c
40e2825
929f2e6
70bab25
c05d38b
7287a73
8bbb116
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { | ||
__experimentalHStack as HStack, | ||
__experimentalText as Text, | ||
} from '@wordpress/components'; | ||
|
||
export default function DataListItem( { label, value } ) { | ||
return ( | ||
<HStack | ||
className="edit-site-sidebar-navigation_data-list__item" | ||
key={ label } | ||
spacing={ 5 } | ||
alignment="left" | ||
> | ||
<Text className="edit-site-sidebar-navigation_data-list__label"> | ||
{ label } | ||
</Text> | ||
<Text className="edit-site-sidebar-navigation_data-list__value"> | ||
{ value } | ||
</Text> | ||
</HStack> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { __experimentalVStack as VStack } from '@wordpress/components'; | ||
/** | ||
* Internal dependencies | ||
*/ | ||
ramonjd marked this conversation as resolved.
Show resolved
Hide resolved
|
||
import DataListItem from './data-list-item'; | ||
|
||
export default function SidebarDetails( { details } ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The naming of the file and the above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree. I suspect it's specific to display individual entity properties, e.g., page/template. @SaxonF can confirm. We can rename in a follow up if so. |
||
return ( | ||
<VStack | ||
className="edit-site-sidebar-navigation_data-list" | ||
spacing={ 5 } | ||
> | ||
{ details.map( ( detail ) => ( | ||
<DataListItem | ||
key={ detail.label } | ||
label={ detail.label } | ||
value={ detail.value } | ||
/> | ||
) ) } | ||
</VStack> | ||
); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
|
||
|
||
.edit-site-sidebar-navigation_data-list__item { | ||
.edit-site-sidebar-navigation_data-list__label { | ||
color: $gray-600; | ||
width: 100px; | ||
} | ||
|
||
.edit-site-sidebar-navigation_data-list__value.edit-site-sidebar-navigation_data-list__value { | ||
color: $gray-200; | ||
} | ||
} |
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.
I just added some tests to make sure it can handle future dates.