diff --git a/components/common/MultiWeaponSelector.tsx b/components/common/MultiWeaponSelector.tsx index 03cf35ed6..31beac224 100644 --- a/components/common/MultiWeaponSelector.tsx +++ b/components/common/MultiWeaponSelector.tsx @@ -10,7 +10,7 @@ interface Props { onChange: (value: string[]) => void; } -const WeaponSelector: React.FC = ({ name, value, onChange }) => { +const MultiWeaponSelector: React.FC = ({ name, value, onChange }) => { const { i18n } = useLingui(); return ( <> @@ -20,9 +20,10 @@ const WeaponSelector: React.FC = ({ name, value, onChange }) => { if (!!e.target.value && !value.includes(e.target.value)) onChange(value.concat(e.target.value)); }} - defaultValue="NO_VALUE" + value="" + disabled={value.length === 5} > - {weaponsWithHeroCategorizedLocalized.map((wpnCategory) => ( @@ -59,4 +60,4 @@ const WeaponSelector: React.FC = ({ name, value, onChange }) => { ); }; -export default WeaponSelector; +export default MultiWeaponSelector; diff --git a/components/common/MySelect.tsx b/components/common/MySelect.tsx index b60089ecd..ce34951d4 100644 --- a/components/common/MySelect.tsx +++ b/components/common/MySelect.tsx @@ -3,32 +3,29 @@ import { Select } from "@chakra-ui/react"; interface Props { value: string; setValue: (value?: string) => void; - options: { - label: string; - value: string; - }[]; placeholder?: string; + name?: string; + children: React.ReactNode; } const MySelect: React.FC = ({ value, setValue, - options, placeholder, + children, + name, }) => { + console.log({ value }); return ( ); }; diff --git a/components/u/ProfileModal.tsx b/components/u/ProfileModal.tsx index 092bd723c..3e039afa3 100644 --- a/components/u/ProfileModal.tsx +++ b/components/u/ProfileModal.tsx @@ -14,7 +14,6 @@ import { ModalFooter, ModalHeader, ModalOverlay, - Select, useToast, } from "@chakra-ui/react"; import { zodResolver } from "@hookform/resolvers/zod"; @@ -230,63 +229,80 @@ const ProfileModal: React.FC = ({ onClose, user }) => { ).map((countryCode) => ({ - label: countries[countryCode].name, - value: countryCode, - }))} placeholder={t`Select country`} - /> + > + {(Object.keys(countries) as Array< + keyof typeof countries + >).map((countryCode) => ( + + ))} + )} /> - - - Weapon pool - - ( - - )} - /> - - {/* Seems to be mistyped */} - {/* @ts-ignore */} - {errors.weaponPool?.message} - - + + Weapon pool + + ( + + )} + /> Stick sensitivity - + ( + + {sensOptions.map((sens) => ( + + ))} + + )} + /> Motion sensitivity - + ( + + {sensOptions.map((sens) => ( + + ))} + + )} + />