You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Mobile/components/quiz/FrequencyQuestion.tsx

36 lines
1.1 KiB

import React from "react";
import Question, { QuestionChildProps } from "./Question";
import Text from "../ui/Text";
import SegmentedControl from "../ui/SegmentedControl";
import { View } from "react-native";
export interface FrequencyQuestionProps extends QuestionChildProps {
isMale: boolean;
}
export default React.forwardRef<any, FrequencyQuestionProps>(
(props, ref): React.ReactElement => {
const { isMale, ...rest } = props;
const ANSWERS = ["1", "2", "3", "4", "5"];
const [answer, setAnswer] = React.useState("1");
return (
<Question question="Nombre de séance(s) par semaine ?" {...ref} {...rest}>
<View className="items-center">
<Text size="2xl">
Je suis {isMale ? "prêt" : "prête"} à m'entraîner
</Text>
<Text size="9xl" weight="bold">
{answer}
</Text>
<Text size="2xl">fois par semaine !</Text>
</View>
<SegmentedControl
values={ANSWERS}
selectedIndex={ANSWERS.indexOf(answer)}
onValueChange={setAnswer}
/>
</Question>
);
}
);