Skip to content

Commit a8e1c9b

Browse files
committed
Try button to top in new loc on narrow window
1 parent abbdba2 commit a8e1c9b

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

src/components/TreeView/index.tsx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,15 @@ export default function TreeView(props: TreeViewProps): ReactElement {
113113
? undefined
114114
: () => animateHandler();
115115

116+
const buttonToTop = (
117+
<IconButtonWithTooltip
118+
icon={<KeyboardDoubleArrowUp />}
119+
textId={"treeView.returnToTop"}
120+
onClick={onClickTop}
121+
buttonId={TreeViewIds.ButtonTop}
122+
/>
123+
);
124+
116125
return (
117126
<>
118127
{/* Domain search */}
@@ -135,14 +144,7 @@ export default function TreeView(props: TreeViewProps): ReactElement {
135144
</Grid2>
136145

137146
<Grid2>
138-
{showButtonToTop && (
139-
<IconButtonWithTooltip
140-
icon={<KeyboardDoubleArrowUp />}
141-
textId={"treeView.returnToTop"}
142-
onClick={onClickTop}
143-
buttonId={TreeViewIds.ButtonTop}
144-
/>
145-
)}
147+
{showButtonToTop && buttonToTop}
146148
{exit && (
147149
<IconButtonWithTooltip
148150
icon={<Close />}
@@ -154,6 +156,12 @@ export default function TreeView(props: TreeViewProps): ReactElement {
154156
</Grid2>
155157
</Grid2>
156158

159+
{!showButtonToTop && (
160+
<Grid2 container justifyContent="center" size={12}>
161+
{buttonToTop}
162+
</Grid2>
163+
)}
164+
157165
{/* Domain tree */}
158166
<Zoom
159167
in={visible}

0 commit comments

Comments
 (0)