Skip to content

Commit 02c9c89

Browse files
authored
chore: move doc editjson menu into an actionicon (#648)
1 parent 898cd14 commit 02c9c89

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

packages/root-cms/ui/pages/DocumentPage/DocumentPage.css

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,10 @@
5454
justify-self: flex-end;
5555
display: flex;
5656
align-items: center;
57-
gap: 4px;
57+
}
58+
59+
.DocumentPage__side__header__saveButton {
60+
margin-right: 8px;
5861
}
5962

6063
.DocumentPage__side__editor {

packages/root-cms/ui/pages/DocumentPage/DocumentPage.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
IconWorld,
1414
IconLayoutSidebarRightCollapse,
1515
IconLayoutSidebarRightExpand,
16+
IconJson,
1617
} from '@tabler/icons-preact';
1718
import {useEffect, useRef, useState} from 'preact/hooks';
1819

@@ -116,6 +117,7 @@ export function DocumentPage(props: DocumentPageProps) {
116117
</div>
117118
<div className="DocumentPage__side__header__buttons">
118119
<Button
120+
className="DocumentPage__side__header__saveButton"
119121
variant="filled"
120122
color="dark"
121123
size="xs"
@@ -125,7 +127,15 @@ export function DocumentPage(props: DocumentPageProps) {
125127
>
126128
Save
127129
</Button>
128-
<Menu
130+
<Tooltip label="Edit JSON">
131+
<ActionIcon
132+
className="DocumentPage__side__header__editJson"
133+
onClick={() => editJson()}
134+
>
135+
<IconBraces size={14} />
136+
</ActionIcon>
137+
</Tooltip>
138+
{/* <Menu
129139
className="DocumentPage__side__header__menu"
130140
position="bottom"
131141
control={
@@ -140,7 +150,7 @@ export function DocumentPage(props: DocumentPageProps) {
140150
>
141151
Edit JSON
142152
</Menu.Item>
143-
</Menu>
153+
</Menu> */}
144154
<Tooltip
145155
label={isPreviewVisible ? 'Hide preview' : 'Show preview'}
146156
>

0 commit comments

Comments
 (0)