Update Schema User gender

Took 15 minutes
This commit is contained in:
Lucàs
2023-03-24 12:16:31 +01:00
parent effee3b4c8
commit 668e092dd3
3 changed files with 16 additions and 11 deletions
+8 -7
View File
@@ -3,32 +3,32 @@ import {Flex, IconButton} from '@chakra-ui/react';
import { BiLeftArrowAlt, BiRightArrowAlt } from "react-icons/bi";
interface Props {
images: string[];
images: string[]
borderRadius?: string | number;
}
const Carousel = ({images}: Props) => {
const Carousel = ({images, borderRadius: bRadius}: Props) => {
const [currentIndex, setCurrentIndex] = useState(0);
const handleClickPrevious = () => {
setCurrentIndex(
(currentIndex === 0)
? images.length - 1
: currentIndex - 1,
? images.length - 1 : currentIndex - 1,
);
};
const handleClickNext = () => {
setCurrentIndex(
(currentIndex === images.length - 1)
? 0
: currentIndex + 1,
? 0 : currentIndex + 1,
);
};
return (
<Flex px={2} align="center" justify={'space-between'}
<Flex px={2} align="center" borderRadius={bRadius} overflow={"hidden"} justify={'space-between'}
bgImage={images[currentIndex]} bgSize={'cover'} width={'100%'}
height={500}>
<IconButton aria-label="left-arrow" colorScheme="purple"
borderRadius="full" onClick={handleClickPrevious}>
<BiLeftArrowAlt/>
@@ -38,6 +38,7 @@ const Carousel = ({images}: Props) => {
borderRadius="full" onClick={handleClickNext}>
<BiRightArrowAlt/>
</IconButton>
</Flex>
);
};