Skip to content

Commit

Permalink
fix(core): fix padding issue on global dropdown (#8495)
Browse files Browse the repository at this point in the history
  • Loading branch information
RitaDias authored and pedrobonamin committed Feb 4, 2025
1 parent d65fc53 commit 3144d8b
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions packages/sanity/src/core/perspective/navbar/ReleasesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,19 @@ const StyledBox = styled(Box)`
max-height: 75vh;
`

const StyledPublishedBox = styled(Box)<{$removePadding: boolean}>(
({$removePadding}) => css`
const StyledPublishedBox = styled(Box)<{$reducePadding: boolean; $removePadding?: boolean}>(({
$reducePadding,
$removePadding,
}) => {
const padding = $reducePadding ? '4px' : '16px'
return css`
position: sticky;
top: 0;
background-color: var(--card-bg-color);
z-index: 10;
padding-bottom: ${$removePadding ? '4px' : '16px'};
`,
)
padding-bottom: ${$removePadding ? '0px' : padding};
`
})

export function ReleasesList({
areReleasesEnabled,
Expand Down Expand Up @@ -117,7 +121,10 @@ export function ReleasesList({
return (
<Box>
<StyledBox ref={setScrollContainer} onScroll={onScroll}>
<StyledPublishedBox $removePadding={!releases.length || !areReleasesEnabled}>
<StyledPublishedBox
$reducePadding={!releases.length || !areReleasesEnabled}
$removePadding={!areReleasesEnabled}
>
<GlobalPerspectiveMenuItem
rangePosition={isRangeVisible ? getRangePosition(range, 0) : undefined}
release={'published'}
Expand Down

0 comments on commit 3144d8b

Please sign in to comment.