Skip to content

Commit

Permalink
fix: fix back button alignment on smaller breakpoints, tweak search s…
Browse files Browse the repository at this point in the history
…tyles
  • Loading branch information
robinpyon authored and rexxars committed Dec 19, 2023
1 parent 1afcc29 commit d680d5f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ const AnimatedSpinnerIcon = styled(SpinnerIcon)`
animation: ${rotate} 500ms linear infinite;
`

const FilterBox = styled(Box)`
const FilterDiv = styled.div`
line-height: 0;
position: relative;
`

Expand Down Expand Up @@ -90,15 +91,13 @@ export const SearchHeader = forwardRef<HTMLInputElement, SearchHeaderProps>(func
<Flex align="center" flex={1} gap={fullscreen ? 2 : 1} padding={fullscreen ? 2 : 1}>
{/* (Fullscreen) Close button */}
{fullscreen && (
<Card>
<Button
aria-label={t('search.action.close-search-aria-label')}
icon={ArrowLeftIcon}
mode="bleed"
onClick={onClose}
tooltipProps={{content: t('search.action.close-search-aria-label')}}
/>
</Card>
<Button
aria-label={t('search.action.close-search-aria-label')}
icon={ArrowLeftIcon}
mode="bleed"
onClick={onClose}
tooltipProps={{content: t('search.action.close-search-aria-label')}}
/>
)}

{/* Search field */}
Expand All @@ -112,7 +111,7 @@ export const SearchHeader = forwardRef<HTMLInputElement, SearchHeaderProps>(func
autoComplete="off"
border={false}
clearButton={!!query}
fontSize={1}
fontSize={[2, 2, 1]}
icon={loading ? AnimatedSpinnerIcon : SearchIcon}
onChange={handleQueryChange}
onClear={handleQueryClear}
Expand All @@ -126,7 +125,7 @@ export const SearchHeader = forwardRef<HTMLInputElement, SearchHeaderProps>(func

{/* Filter toggle */}
{fullscreen && (
<FilterBox>
<FilterDiv>
<Button
aria-expanded={filtersVisible}
aria-label={t('search.action.toggle-filters-aria-label', {
Expand All @@ -141,7 +140,7 @@ export const SearchHeader = forwardRef<HTMLInputElement, SearchHeaderProps>(func
tooltipProps={{content: filtersVisible ? 'Hide filters' : 'Show filters'}}
/>
{notificationBadgeVisible && <NotificationBadge />}
</FilterBox>
</FilterDiv>
)}
</Flex>
</Card>
Expand Down
2 changes: 1 addition & 1 deletion packages/sanity/src/desk/components/pane/PaneHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const PaneHeader = forwardRef(function PaneHeader(
style={layoutStyle}
>
{backButton && (
<Box flex="none" padding={1}>
<Box flex="none" padding={1} paddingLeft={0}>
{backButton}
</Box>
)}
Expand Down

0 comments on commit d680d5f

Please sign in to comment.