Skip to content

Commit

Permalink
fix: enable 'use my address' in group member step (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
fmorency authored Jan 7, 2025
1 parent 54e721d commit 1773b5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/groups/forms/groups/MemberInfoForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ function MemberInfoFormFields({
setIsContactsOpen,
activeMemberIndex,
setActiveMemberIndex,
address,
}: Readonly<{
dispatch: (action: Action) => void;
isContactsOpen: boolean;
setIsContactsOpen: React.Dispatch<React.SetStateAction<boolean>>;
activeMemberIndex: number | null;
setActiveMemberIndex: React.Dispatch<React.SetStateAction<number | null>>;
address: string;
}>) {
const { values, isValid, setFieldValue } = useFormikContext<{
members: { address: string; name: string; weight: string }[];
Expand Down Expand Up @@ -228,6 +230,7 @@ function MemberInfoFormFields({
isOpen={isContactsOpen}
setOpen={setIsContactsOpen}
showContacts={true}
currentAddress={address}
onSelect={(selectedAddress: string) => {
if (activeMemberIndex !== null) {
setFieldValue(`members.${activeMemberIndex}.address`, selectedAddress);
Expand All @@ -250,11 +253,13 @@ export default function MemberInfoForm({
dispatch,
nextStep,
prevStep,
address,
}: Readonly<{
formData: FormData;
dispatch: (action: Action) => void;
nextStep: () => void;
prevStep: () => void;
address: string;
}>) {
// Local states needed by the form fields
const [isContactsOpen, setIsContactsOpen] = useState(false);
Expand Down Expand Up @@ -289,6 +294,7 @@ export default function MemberInfoForm({
setIsContactsOpen={setIsContactsOpen}
activeMemberIndex={activeMemberIndex}
setActiveMemberIndex={setActiveMemberIndex}
address={address}
/>
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions pages/groups/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export default function CreateGroup() {
dispatch={dispatch}
nextStep={nextStep}
prevStep={prevStep}
address={address ?? ''}
/>
</div>
)}
Expand Down

0 comments on commit 1773b5d

Please sign in to comment.