File tree Expand file tree Collapse file tree 1 file changed +23
-19
lines changed
frontend/src/components/ui Expand file tree Collapse file tree 1 file changed +23
-19
lines changed Original file line number Diff line number Diff line change @@ -153,25 +153,29 @@ const ReviewCarousel = () => {
153
153
// whileHover is a framer specific attribute
154
154
// It displaces buttons by 10px on hover for that nice slide animation
155
155
}
156
- < motion . button
157
- id = "next"
158
- className = " absolute top-[40%] text-green-900 bg-none border-none text-6xl font-mono font-bold opacity-80 transition-opacity z-10 right-[50px] max-sm:text-white max-sm:text-2xl max-sm:right-2"
159
- onClick = { ( ) =>
160
- setActive ( ( prev ) => ( prev + 1 < items . length ? prev + 1 : prev ) )
161
- }
162
- whileHover = { { x : 10 , color : '#00B2CA' , opacity : 1 } }
163
- >
164
- { '>>' }
165
- </ motion . button >
166
- < motion . button
167
- id = "prev"
168
- className = " absolute top-[40%] text-green-900 bg-none border-none text-6xl font-mono font-bold opacity-80 transition-opacity z-10 left-[50px] max-sm:text-white max-sm:text-2xl max-sm:left-2"
169
- onClick = { ( ) => setActive ( ( prev ) => ( prev - 1 >= 0 ? prev - 1 : prev ) ) }
170
- whileHover = { { x : - 10 , color : '#00B2CA' , opacity : 1 } }
171
- >
172
- { ' ' }
173
- { '<<' }
174
- </ motion . button >
156
+ { active < items . length - 1 && (
157
+ < motion . button
158
+ id = "next"
159
+ className = " absolute top-[40%] text-green-900 bg-none border-none text-6xl font-mono font-bold opacity-80 transition-opacity z-10 right-[50px] max-sm:text-white max-sm:text-2xl max-sm:right-2"
160
+ onClick = { ( ) =>
161
+ setActive ( ( prev ) => ( prev + 1 < items . length ? prev + 1 : prev ) )
162
+ }
163
+ whileHover = { { x : 10 , color : '#00B2CA' , opacity : 1 } }
164
+ >
165
+ { '>>' }
166
+ </ motion . button >
167
+ ) }
168
+ { active > 0 && (
169
+ < motion . button
170
+ id = "prev"
171
+ className = " absolute top-[40%] text-green-900 bg-none border-none text-6xl font-mono font-bold opacity-80 transition-opacity z-10 left-[50px] max-sm:text-white max-sm:text-2xl max-sm:left-2"
172
+ onClick = { ( ) => setActive ( ( prev ) => ( prev - 1 >= 0 ? prev - 1 : prev ) ) }
173
+ whileHover = { { x : - 10 , color : '#00B2CA' , opacity : 1 } }
174
+ >
175
+ { ' ' }
176
+ { '<<' }
177
+ </ motion . button >
178
+ ) }
175
179
</ div >
176
180
</ div >
177
181
) ;
You can’t perform that action at this time.
0 commit comments