diff --git a/news/40.feature b/news/40.feature index b6813bc..63ac652 100644 --- a/news/40.feature +++ b/news/40.feature @@ -1 +1 @@ -Add `single-slide` classname to improve styling @danalvrz \ No newline at end of file +Add conditionals around arrow and dot buttons, and hide them, if there is only one slide @danalvrz \ No newline at end of file diff --git a/src/components/View.jsx b/src/components/View.jsx index 32fd5b3..607a2c2 100644 --- a/src/components/View.jsx +++ b/src/components/View.jsx @@ -96,9 +96,7 @@ const SliderView = (props) => { return ( <>
{(data.slides?.length === 0 || !data.slides) && isEditMode && ( @@ -112,7 +110,7 @@ const SliderView = (props) => { {data.slides?.length > 0 && ( <>
- {!data.hideArrows && ( + {!data.hideArrows && data.slides?.length > 1 && ( <> @@ -143,7 +141,7 @@ const SliderView = (props) => {
- + {data.slides?.length > 1 && (
{scrollSnaps.map((_, index) => ( { )} /> ))} -
+ )} )}