w-aura/src/components/palmistry/step-gender/step-gender.tsx
Денис Катаев 2d7be6a578 AW-51-newAuthentication
2024-05-04 20:11:24 +00:00

45 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Button from "../button/button";
import useSteps, { GenderChoice } from "../../../hooks/palmistry/use-steps";
import { useDispatch } from "react-redux";
import { actions } from "@/store";
export default function StepGender() {
const steps = useSteps();
const dispatch = useDispatch();
const onNext = (choice: GenderChoice) => {
dispatch(actions.questionnaire.update({ gender: choice }));
steps.saveCurrent(choice);
steps.goNext(choice);
};
return (
<>
<h3 className="palmistry-container__header">Whats your gender?</h3>
<p className="palmistry-container__description">
In Palmistry, everyone is a blend of masculine and feminine, so it helps
to know yours.
</p>
<div className="palmistry-container__button-wrapper">
<Button
type="button"
active={steps.storedValue === GenderChoice.Male}
onClick={() => onNext(GenderChoice.Male)}
>
Male
</Button>
<Button
type="button"
active={steps.storedValue === GenderChoice.Female}
onClick={() => onNext(GenderChoice.Female)}
>
Female
</Button>
</div>
</>
);
}