Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added announcement hero to every page #3736

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions components/campaigns/AnnouncementHero.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,16 @@ export default function AnnouncementHero({ className = '', small = false }: IAnn
<div className='relative flex flex-row items-center justify-center overflow-x-hidden md:gap-4'>
{numberOfVisibleBanners > 1 && (
<div
className={`absolute left-0 top-1/2 z-10 mb-2 flex size-8 -translate-y-1/2 cursor-pointer
items-center justify-center rounded-full bg-primary-500 opacity-50 hover:bg-primary-600 md:opacity-100`}
className={
'absolute left-0 top-1/2 z-10 mb-2 flex size-8 -translate-y-1/2 cursor-pointer items-center justify-center rounded-full bg-primary-500 opacity-50 hover:bg-primary-600 md:opacity-100'
}
onClick={goToPrevious}
>
<ArrowLeft className='w-4 text-white' />
</div>
)}
<div className='relative flex w-5/6 flex-col items-center justify-center gap-2'>
<div className='relative flex min-h-72 w-full items-center justify-center overflow-hidden lg:h-[17rem] lg:w-[38rem]'>
<div className='relative flex min-h-80 w-full items-center justify-center overflow-hidden'>
{visibleBanners.map((banner, index) => {
// Only render active banner and immediate neighbors
const isVisible = Math.abs(index - (activeIndex % numberOfVisibleBanners)) <= 1;
Expand Down
4 changes: 3 additions & 1 deletion components/layout/BlogLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ export default function BlogLayout({

return (
<BlogContext.Provider value={{ post }}>
<AnnouncementHero className='mx-8 my-4' />
<div className='mt-4'>
<AnnouncementHero />
</div>
<Container cssBreakingPoint='lg' flex flexReverse>
<TOC
toc={post.toc}
Expand Down
Loading