diff --git a/src/alerts.ts b/src/alerts.ts
index 192625c5..17259527 100644
--- a/src/alerts.ts
+++ b/src/alerts.ts
@@ -9,6 +9,7 @@ import explorer from './explorer/alerts';
import firmware from './firmware/alerts';
import hub from './hub/alerts';
import mpy from './mpy/alerts';
+import sponsor from './sponsor/alerts';
import type { CreateToast } from './toasterTypes';
/** This collects alerts from all of the subsystems of the app */
@@ -20,6 +21,7 @@ const alertDomains = {
firmware,
hub,
mpy,
+ sponsor,
};
/** Gets the type of available alert domains. */
diff --git a/src/sponsor/SponsorDialog.tsx b/src/sponsor/SponsorDialog.tsx
index 6ceaa79a..f59207cd 100644
--- a/src/sponsor/SponsorDialog.tsx
+++ b/src/sponsor/SponsorDialog.tsx
@@ -5,6 +5,7 @@ import { AnchorButton, Classes, Dialog, Intent } from '@blueprintjs/core';
import classNames from 'classnames';
import React from 'react';
import { useDispatch } from 'react-redux';
+import { alertsShowAlert } from '../alerts/actions';
import { pybricksTeamUrl } from '../app/constants';
import { useSelector } from '../reducers';
import ClipboardIcon from '../utils/ClipboardIcon';
@@ -107,7 +108,10 @@ const SponsorDialog: React.VoidFunctionComponent = () => {
intent={Intent.PRIMARY}
icon={}
fill={true}
- onClick={() => navigator.clipboard.writeText('pybricks.eth')}
+ onClick={() => {
+ navigator.clipboard.writeText('pybricks.eth');
+ dispatch(alertsShowAlert('sponsor', 'addressCopied'));
+ }}
>
pybricks.eth
{i18n.translate('addressCopied.message')}
; +}; + +export const addressCopied: CreateToast = (onAction) => { + return { + message: