Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Commit

Permalink
fix: open edit wallet nickname modal (#2465)
Browse files Browse the repository at this point in the history
  • Loading branch information
alantoa authored Oct 27, 2023
1 parent 03d4fa6 commit 1432a19
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
10 changes: 8 additions & 2 deletions packages/app/components/settings/setting-edit-nickname-moda.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ import { WalletAddressesV2 } from "app/types";
export type EditNicknameModalProps = {
editingWallet?: WalletAddressesV2;
onClose: any;
visible: boolean;
};
export const EditNicknameModal = ({
editingWallet,
onClose,
visible = false,
}: EditNicknameModalProps) => {
const [nickname, setNickname] = useState("");
const { editWalletNickName } = useAddWalletNickname();
Expand All @@ -34,9 +36,13 @@ export const EditNicknameModal = ({
AvoidSoftInput.setEnabled(true);
};
}, [editingWallet?.nickname]);

return (
<Modal tw="bottom-16 md:bottom-0" onClose={onClose} title="Edit Nickname">
<Modal
tw="bottom-16 md:bottom-0"
onClose={onClose}
visible={visible}
title="Edit Nickname"
>
<View tw="p-4">
<Fieldset
placeholder="rainbow wallet"
Expand Down
11 changes: 5 additions & 6 deletions packages/app/components/settings/setting.md.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,11 @@ export const SettingsMd = () => {
</View>

<View style={{ height: bottomHeight }} />
{editingWallet ? (
<EditNicknameModal
editingWallet={editingWallet}
onClose={() => setEditingWallet(undefined)}
/>
) : null}
<EditNicknameModal
editingWallet={editingWallet}
visible={!!editingWallet}
onClose={() => setEditingWallet(undefined)}
/>
</View>
);
};
2 changes: 1 addition & 1 deletion packages/design-system/modal/modal.container.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const ModalContainerComponent = forwardRef<ModalMethods, ModalContainerProps>(
disableBackdropPress,
tw: propTw = "",
headerShown = true,
visible,
visible = false,
closeButtonProps,
}: ModalContainerProps,
ref
Expand Down

0 comments on commit 1432a19

Please sign in to comment.