File size: 2,042 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import { category, Icon, brush, globe } from '@wordpress/icons';
import { translate } from 'i18n-calypso';
import ReaderA8cIcon from 'calypso/reader/components/icons/a8c-icon';

export const SidebarIconPlugins = () => (
	<svg
		className="sidebar__menu-icon svg-plugins"
		width="24"
		height="24"
		viewBox="0 0 24 24"
		fill="none"
		xmlns="http://www.w3.org/2000/svg"
	>
		<path
			fillRule="evenodd"
			clipRule="evenodd"
			d="M10.5 4L10.5 8H13.5V4H15V8H16.5C17.0523 8 17.5 8.44772 17.5 9V13L14.5 17V19C14.5 19.5523 14.0523 20 13.5 20H10.5C9.94772 20 9.5 19.5523 9.5 19V17L6.5 13V9C6.5 8.44772 6.94772 8 7.5 8H9L9 4H10.5ZM11 16.5V18.5H13V16.5L16 12.5V9.5H8V12.5L11 16.5Z"
		/>
	</svg>
);

/**
 * Menu items that support all sites screen.
 */
export default function globalSidebarMenu( { showP2s = false } = {} ) {
	return [
		{
			icon: <Icon icon={ category } className="sidebar__menu-icon svg_all-sites" size={ 24 } />,
			slug: 'sites',
			title: translate( 'Sites' ),
			navigationLabel: translate( 'Manage all my sites' ),
			type: 'menu-item',
			url: '/sites',
		},
		...( showP2s
			? [
					{
						icon: <ReaderA8cIcon />,
						slug: 'sites-p2',
						title: translate( 'P2s' ),
						navigationLabel: translate( 'Manage all my P2 sites' ),
						type: 'menu-item',
						url: '/p2s',
					},
			  ]
			: [] ),
		{
			icon: <Icon icon={ globe } size={ 24 } className="sidebar__menu-icon svg_all-domains" />,
			slug: 'domains',
			title: translate( 'Domains' ),
			navigationLabel: translate( 'Manage all domains' ),
			type: 'menu-item',
			url: '/domains/manage',
		},
		{
			icon: <Icon icon={ brush } size={ 24 } className="sidebar__menu-icon sidebar_svg-brush" />,
			slug: 'themes',
			title: translate( 'Themes' ),
			navigationLabel: translate( 'Themes' ),
			type: 'menu-item',
			url: '/themes',
		},
		{
			icon: <SidebarIconPlugins />,
			slug: 'plugins',
			title: translate( 'Plugins' ),
			navigationLabel: translate( 'Plugins' ),
			type: 'menu-item',
			url: '/plugins',
			forceChevronIcon: true,
		},
	];
}