-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
screen-root.js
90 lines (83 loc) · 1.91 KB
/
screen-root.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
85
86
87
88
89
90
/**
* WordPress dependencies
*/
import {
__experimentalItemGroup as ItemGroup,
__experimentalItem as Item,
__experimentalHStack as HStack,
__experimentalVStack as VStack,
FlexItem,
CardBody,
Card,
CardDivider,
} from '@wordpress/components';
import { isRTL, __ } from '@wordpress/i18n';
import { chevronLeft, chevronRight, Icon } from '@wordpress/icons';
import { useSelect } from '@wordpress/data';
import { store as coreStore } from '@wordpress/core-data';
/**
* Internal dependencies
*/
import { NavigationButton } from './navigation-button';
import ContextMenu from './context-menu';
import StylesPreview from './preview';
function ScreenRoot() {
const { variations } = useSelect( ( select ) => {
return {
variations: select(
coreStore
).__experimentalGetCurrentThemeGlobalStylesVariations(),
};
}, [] );
return (
<Card size="small">
<CardBody>
<VStack spacing={ 2 }>
<Card>
<StylesPreview />
</Card>
{ !! variations?.length && (
<NavigationButton path="/variations">
<HStack justify="space-between">
<FlexItem>{ __( 'Browse styles' ) }</FlexItem>
<FlexItem>
<Icon
icon={
isRTL() ? chevronLeft : chevronRight
}
/>
</FlexItem>
</HStack>
</NavigationButton>
) }
</VStack>
</CardBody>
<CardBody>
<ContextMenu />
</CardBody>
<CardDivider />
<CardBody>
<ItemGroup>
<Item>
{ __(
'Customize the appearance of specific blocks for the whole site.'
) }
</Item>
<NavigationButton path="/blocks">
<HStack justify="space-between">
<FlexItem>{ __( 'Blocks' ) }</FlexItem>
<FlexItem>
<Icon
icon={
isRTL() ? chevronLeft : chevronRight
}
/>
</FlexItem>
</HStack>
</NavigationButton>
</ItemGroup>
</CardBody>
</Card>
);
}
export default ScreenRoot;