Skip to content

Commit

Permalink
fix(form-builder): fix ui issues in PTE toolbar
Browse files Browse the repository at this point in the history
  • Loading branch information
hermanwikner committed Jan 11, 2022
1 parent 680cc9f commit f35a010
Showing 1 changed file with 32 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,22 @@ const RootFlex = styled(Flex)`
`

const StyleSelectBox = styled(Box)`
min-width: 8em;
width: 8em;
`

const StyleSelectFlex = styled(Flex)`
border-right: 1px solid var(--card-border-color);
`

const ActionMenuBox = styled(Box)<{$withMaxWidth: boolean}>`
${({$withMaxWidth}) =>
$withMaxWidth &&
const ActionMenuBox = styled(Box)<{$withInsertMenu: boolean}>`
${({$withInsertMenu}) =>
$withInsertMenu &&
css`
max-width: max-content;
border-right: 1px solid var(--card-border-color);
`}
`

const InsertMenuBox = styled(Box)`
border-left: 1px solid var(--card-border-color);
`

const FullscreenButtonBox = styled(Box)`
border-left: 1px solid var(--card-border-color);
`
Expand Down Expand Up @@ -102,32 +99,33 @@ const InnerToolbar = memo(function InnerToolbar({
</StyleSelectBox>
</StyleSelectFlex>

{showActionMenu && (
<ActionMenuBox
flex={collapsed ? undefined : 1}
padding={isFullscreen ? 2 : 1}
$withMaxWidth={showInsertMenu}
>
<ActionMenu
disabled={disabled}
collapsed={collapsed}
groups={actionGroups}
isFullscreen={isFullscreen}
/>
</ActionMenuBox>
)}

{showInsertMenu && (
<InsertMenuBox flex={collapsed ? undefined : 1} padding={isFullscreen ? 2 : 1}>
<InsertMenu
disabled={disabled}
collapsed={collapsed}
items={insertMenuItems}
isFullscreen={isFullscreen}
/>
</InsertMenuBox>
)}

<Flex flex={1}>
{showActionMenu && (
<ActionMenuBox
flex={collapsed ? undefined : 1}
padding={isFullscreen ? 2 : 1}
$withInsertMenu={showInsertMenu}
>
<ActionMenu
disabled={disabled}
collapsed={collapsed}
groups={actionGroups}
isFullscreen={isFullscreen}
/>
</ActionMenuBox>
)}

{showInsertMenu && (
<Box flex={collapsed ? undefined : 1} padding={isFullscreen ? 2 : 1}>
<InsertMenu
disabled={disabled}
collapsed={collapsed}
items={insertMenuItems}
isFullscreen={isFullscreen}
/>
</Box>
)}
</Flex>
<FullscreenButtonBox padding={isFullscreen ? 2 : 1}>
<Tooltip
content={
Expand Down

3 comments on commit f35a010

@vercel
Copy link

@vercel vercel bot commented on f35a010 Jan 11, 2022

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-git-next.sanity.build
studio-workshop.sanity.build

@vercel
Copy link

@vercel vercel bot commented on f35a010 Jan 11, 2022

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

@vercel
Copy link

@vercel vercel bot commented on f35a010 Jan 11, 2022

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-git-next.sanity.build
perf-studio.sanity.build

Please sign in to comment.