Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F10615108
D13583.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D13583.id.diff
View Options
diff --git a/cashtab/src/components/Alias/Alias.js b/cashtab/src/components/Alias/Alias.js
--- a/cashtab/src/components/Alias/Alias.js
+++ b/cashtab/src/components/Alias/Alias.js
@@ -10,7 +10,7 @@
} from 'components/Common/Atoms';
import { DestinationAddressSingle } from 'components/Common/EnhancedInputs';
import { AntdFormWrapper } from 'components/Common/EnhancedInputs';
-import { Form } from 'antd';
+import { Form, Modal } from 'antd';
import { SmartButton } from 'components/Common/PrimaryButton';
import BalanceHeader from 'components/Common/BalanceHeader';
import BalanceHeaderFiat from 'components/Common/BalanceHeaderFiat';
@@ -78,6 +78,9 @@
const [aliasLength, setAliasLength] = useState(false); // real time tracking of alias char length
const [aliasFee, setAliasFee] = useState(false); // real time tracking of alias registration fee
+ // Show a confirmation modal on alias registrations
+ const [isModalVisible, setIsModalVisible] = useState(false);
+
useEffect(() => {
passLoadingStatus(false);
}, [balances.totalBalance]);
@@ -123,6 +126,15 @@
passLoadingStatus(false);
}, [wallet.name, cashtabCache.aliasCache.aliases]);
+ const handleOk = () => {
+ setIsModalVisible(false);
+ registerAlias();
+ };
+
+ const handleCancel = () => {
+ setIsModalVisible(false);
+ };
+
const registerAlias = async () => {
passLoadingStatus(true);
@@ -287,6 +299,16 @@
return (
<>
+ <Modal
+ title="Confirm Alias Registration"
+ open={isModalVisible}
+ onOk={handleOk}
+ onCancel={handleCancel}
+ >
+ <p>
+ {`Are you sure you want to register the alias '${formData.aliasName}' for ${fromSatoshisToXec(aliasFee)} XECs?`}
+ </p>
+ </Modal>
<WalletInfoCtn>
<WalletLabel
name={wallet.name}
@@ -358,7 +380,7 @@
<Form.Item>
<SmartButton
disabled={!isValidAliasInput}
- onClick={() => registerAlias()}
+ onClick={() => setIsModalVisible(true)}
>
Register Alias
</SmartButton>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 09:57 (15 h, 57 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4558996
Default Alt Text
D13583.id.diff (2 KB)
Attached To
D13583: [Cashtab] [Alias] Confirmation modal on registration
Event Timeline
Log In to Comment