Skip to content

Commit bfb13c9

Browse files
authored
fix(client): disable sliding animation when there is just one banner (#357)
1 parent ca55bff commit bfb13c9

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

libs/blog/ad-banner/ui/src/lib/banner-carousel/al-banner-carousel.component.ts

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,21 @@ import { AlInfiniteSliderDirective } from '../infinite-slider-directive/al-infin
1212
template: `
1313
<div class="overflow-hidden">
1414
<div class="flex">
15-
<al-ad-image-banner
16-
*alInfiniteSlider="let banner of banners(); msPerSlide: msPerSlide()"
17-
class="flex-shrink-0 flex-grow-0 basis-full"
18-
[banner]="banner"
19-
/>
15+
@if (banners().length > 1) {
16+
<al-ad-image-banner
17+
*alInfiniteSlider="
18+
let banner of banners();
19+
msPerSlide: msPerSlide()
20+
"
21+
class="flex-shrink-0 flex-grow-0 basis-full"
22+
[banner]="banner"
23+
/>
24+
} @else if (banners().length === 1) {
25+
<al-ad-image-banner
26+
class="flex-shrink-0 flex-grow-0 basis-full"
27+
[banner]="banners()[0]"
28+
/>
29+
}
2030
</div>
2131
</div>
2232
`,

0 commit comments

Comments
 (0)