Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Markusplay committed Feb 9, 2025
1 parent c384a3c commit 82a8d35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { DotButton } from './dot-button';
import { useState } from 'react';
import { useDotButton } from './use-dot-button';
import { DefaultAnnouncementSlide } from './default-announcement-slide';
import { Show } from '@/components/utils/show';

const AUTOPLAY_DELAY = 10_000; // 10 seconds

Expand All @@ -30,15 +31,18 @@ export const AnnouncementsCarousel = ({ announcements }: AnnouncementsCarouselPr
setApi={setApi}
>
<CarouselContent className="-ml-4 mb-4">
<Slide>
<DefaultAnnouncementSlide />
</Slide>
<Show when={!announcements.length}>
<Slide>
<DefaultAnnouncementSlide />
</Slide>
</Show>
{announcements.map((announcement) => (
<Slide key={announcement.id}>
<AnnouncementSlide
title={announcement.title}
description={announcement.description}
link={announcement.link}
linkTitle={announcement.linkTitle}
image={announcement.image}
/>
</Slide>
Expand Down
2 changes: 1 addition & 1 deletion src/app/[locale]/(private)/notice-board/notice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function Notice({ announcement }: NoticeProps) {
<Heading4>{announcement.title}</Heading4>
<Paragraph className="m-0 line-clamp-3 font-medium">{announcement.description}</Paragraph>
</div>
<Show when={!isAnnouncementOutdated}>
<Show when={!!announcement.link && !isAnnouncementOutdated}>
<Button className="w-fit" variant="secondary" asChild>
<Link href={announcement.link || ''} target="_blank">
{announcement.linkTitle}
Expand Down

0 comments on commit 82a8d35

Please sign in to comment.