Skip to content

Commit

Permalink
Adjust header height based on visible banners
Browse files Browse the repository at this point in the history
  • Loading branch information
Strift committed Nov 28, 2024
1 parent eabc1c4 commit 67d2286
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Body.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const Body = ({
requireApiKeyToWork={requireApiKeyToWork}
client={meilisearchJsClient}
refreshIndexes={getIndexesList}
isBannerVisible={isApiKeyBannerVisible}
isApiKeyBannerVisible={isApiKeyBannerVisible}
isCloudBannerVisible={isCloudBannerVisible}
/>
<BodyWrapper>
Expand Down
5 changes: 4 additions & 1 deletion src/components/Header/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const Header = ({
setCurrentIndex,
refreshIndexes,
requireApiKeyToWork,
isApiKeyBannerVisible,
isCloudBannerVisible,
}) => {
const { meilisearchJsClient } = useMeilisearchClientContext()
Expand All @@ -89,8 +90,10 @@ const Header = ({
getMeilisearchVersion()
}, [meilisearchJsClient])

const topPosition =
(isCloudBannerVisible ? 74 : 0) + (isApiKeyBannerVisible ? 55 : 0)
return (
<HeaderWrapper top={isCloudBannerVisible ? 74 : 0}>
<HeaderWrapper top={topPosition}>
<Container
p={4}
display="flex"
Expand Down

0 comments on commit 67d2286

Please sign in to comment.