-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(desk-tool): hide custom pane content if the pane is collapsed
- Loading branch information
1 parent
4fbdb53
commit 1a53747
Showing
2 changed files
with
40 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
packages/@sanity/desk-tool/src/panes/userComponent/UserComponentPaneContent.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import {Box} from '@sanity/ui' | ||
import React from 'react' | ||
import styled from 'styled-components' | ||
import {usePane} from '../../components' | ||
|
||
interface UserComponentPaneContentProps { | ||
children: React.ReactNode | ||
} | ||
|
||
const Root = styled(Box)` | ||
position: relative; | ||
` | ||
|
||
export function UserComponentPaneContent(props: UserComponentPaneContentProps) { | ||
const {children} = props | ||
const {collapsed} = usePane() | ||
|
||
return ( | ||
<Root hidden={collapsed} height="fill" overflow="auto"> | ||
{children} | ||
</Root> | ||
) | ||
} |
1a53747
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
studio-workshop – ./dev/workshop
studio-workshop.sanity.build
studio-workshop-git-next.sanity.build
1a53747
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
test-studio – ./
test-studio-git-next.sanity.build
test-studio.sanity.build
1a53747
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
perf-studio – ./
perf-studio.sanity.build
perf-studio-git-next.sanity.build