Object containing notification state and methods:
notify - Function to trigger a notificationnotification - Current notification state object with:
isOpen - Whether notification is visiblemessage - The notification messageseverity - The notification type (success, error, warning, info)txHash - Optional transaction hash for linkinghandleClose - Function to close the notificationimport { useNotification, Severity } from '@evefrontier/dapp-kit';
const MyComponent = () => {
const { notify } = useNotification();
const showSuccess = () => {
notify({ type: Severity.Success, message: 'Operation completed!' });
};
return <button onClick={showSuccess}>Complete</button>;
};
const { notify } = useNotification();
const handleTransaction = async () => {
try {
const result = await sendTransaction();
notify({
type: Severity.Success,
message: 'Transaction successful!',
txHash: result.digest
});
} catch (error) {
notify({
type: Severity.Error,
message: 'Transaction failed'
});
}
};
Hook for displaying user notifications in EVE Frontier dApps.
Provides a simple notification system for displaying success, error, warning, and info messages to users. Commonly used after transaction completions or to display important status updates.