Skip to content

Commit c6e49ca

Browse files
fix: close panel in direction of panelLocation (#147)
closes #146 --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
1 parent a8fd5a2 commit c6e49ca

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

packages/devtools/src/components/main-panel.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ export const MainPanel = (props: {
2727
settings().panelLocation,
2828
Boolean(pip().pipWindow),
2929
),
30-
styles().devtoolsPanelContainerAnimation(props.isOpen(), height()),
30+
styles().devtoolsPanelContainerAnimation(
31+
props.isOpen(),
32+
height(),
33+
settings().panelLocation,
34+
),
3135
styles().devtoolsPanelContainerVisibility(props.isOpen()),
3236
styles().devtoolsPanelContainerResizing(props.isResizing),
3337
)}

packages/devtools/src/styles/use-styles.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,11 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
166166
transition: all 0.4s ease;
167167
`
168168
},
169-
devtoolsPanelContainerAnimation: (isOpen: boolean, height: number) => {
169+
devtoolsPanelContainerAnimation: (
170+
isOpen: boolean,
171+
height: number,
172+
panelLocation: TanStackDevtoolsConfig['panelLocation'],
173+
) => {
170174
if (isOpen) {
171175
return css`
172176
pointer-events: auto;
@@ -175,7 +179,7 @@ const stylesFactory = (theme: DevtoolsStore['settings']['theme']) => {
175179
}
176180
return css`
177181
pointer-events: none;
178-
transform: translateY(${height}px);
182+
transform: translateY(${panelLocation === 'top' ? -height : height}px);
179183
`
180184
},
181185
devtoolsPanel: css`

0 commit comments

Comments
 (0)