-
Notifications
You must be signed in to change notification settings - Fork 4.3k
/
index.js
84 lines (79 loc) · 2.15 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
* WordPress dependencies
*/
import { __experimentalItemGroup as ItemGroup } from '@wordpress/components';
import { __ } from '@wordpress/i18n';
import { layout, symbol, navigation, styles, page } from '@wordpress/icons';
import { useDispatch } from '@wordpress/data';
import { useEffect } from '@wordpress/element';
/**
* Internal dependencies
*/
import SidebarNavigationScreen from '../sidebar-navigation-screen';
import SidebarNavigationItem from '../sidebar-navigation-item';
import { SidebarNavigationItemGlobalStyles } from '../sidebar-navigation-screen-global-styles';
import { unlock } from '../../lock-unlock';
import { store as editSiteStore } from '../../store';
export function MainSidebarNavigationContent() {
return (
<ItemGroup>
<SidebarNavigationItem
uid="navigation-navigation-item"
to="/navigation"
withChevron
icon={ navigation }
>
{ __( 'Navigation' ) }
</SidebarNavigationItem>
<SidebarNavigationItemGlobalStyles
uid="styles-navigation-item"
icon={ styles }
>
{ __( 'Styles' ) }
</SidebarNavigationItemGlobalStyles>
<SidebarNavigationItem
uid="page-navigation-item"
to="/page"
withChevron
icon={ page }
>
{ __( 'Pages' ) }
</SidebarNavigationItem>
<SidebarNavigationItem
uid="template-navigation-item"
to="/template"
withChevron
icon={ layout }
>
{ __( 'Templates' ) }
</SidebarNavigationItem>
<SidebarNavigationItem
uid="patterns-navigation-item"
to="/pattern"
withChevron
icon={ symbol }
>
{ __( 'Patterns' ) }
</SidebarNavigationItem>
</ItemGroup>
);
}
export default function SidebarNavigationScreenMain() {
const { setEditorCanvasContainerView } = unlock(
useDispatch( editSiteStore )
);
// Clear the editor canvas container view when accessing the main navigation screen.
useEffect( () => {
setEditorCanvasContainerView( undefined );
}, [ setEditorCanvasContainerView ] );
return (
<SidebarNavigationScreen
isRoot
title={ __( 'Design' ) }
description={ __(
'Customize the appearance of your website using the block editor.'
) }
content={ <MainSidebarNavigationContent /> }
/>
);
}