Skip to content

Commit

Permalink
Merge pull request #1351 from matiasbenary/feat/add-close-button-news…
Browse files Browse the repository at this point in the history
…letter-banner

fix(navbar): correct newletter bar issue on mobile
  • Loading branch information
flmel authored Nov 28, 2024
2 parents 6523305 + c02d3b7 commit 7c76569
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,20 @@ const StyledCard = ({ href, title, description }: { href: string; title: string;
);
};

const NewsletterBanner = styled.div<{ isSidebarExpanded: boolean }>`
const NewsletterBanner = styled.div<{ isSidebarExpanded: boolean; deviceType: string }>`
background-color: #0072ce;
color: white;
padding: 8px;
text-align: center;
font-size: 14px;
position: absolute;
top: 0;
left: ${(p) => (p.isSidebarExpanded ? 'var(--sidebar-width-expanded)' : 'var(--sidebar-width-collapsed)')};
left: ${(p) =>
p.deviceType === 'mobile'
? 0
: p.isSidebarExpanded
? 'var(--sidebar-width-expanded)'
: 'var(--sidebar-width-collapsed)'};
transition: all var(--sidebar-expand-transition-speed);
right: 0;
Expand Down Expand Up @@ -117,7 +122,7 @@ const HomePage: NextPageWithLayout = () => {
return (
<Section grow="available">
{visible && (
<NewsletterBanner isSidebarExpanded={isSidebarExpanded}>
<NewsletterBanner isSidebarExpanded={isSidebarExpanded} deviceType={deviceType}>
Stay updated!{' '}
<a
href="https://bit.ly/devhubnews"
Expand Down

0 comments on commit 7c76569

Please sign in to comment.