diff --git a/packages/suite/src/actions/suite/modalActions.ts b/packages/suite/src/actions/suite/modalActions.ts index 4b2d03b904c..c9811367cee 100644 --- a/packages/suite/src/actions/suite/modalActions.ts +++ b/packages/suite/src/actions/suite/modalActions.ts @@ -114,6 +114,13 @@ export type UserContextPayload = } | { type: 'safety-checks'; + } + | { + type: 'send-aopp-message'; + address: string; + signature: string; + callback: string; + decision: Deferred; }; export type ModalAction = @@ -200,7 +207,8 @@ type DeferredModals = Extract< | 'coinmarket-buy-terms' | 'coinmarket-sell-terms' | 'coinmarket-exchange-dex-terms' - | 'coinmarket-exchange-terms'; + | 'coinmarket-exchange-terms' + | 'send-aopp-message'; } >; // extract single modal by `type` util diff --git a/packages/suite/src/components/suite/modals/SendAoppMessage/index.tsx b/packages/suite/src/components/suite/modals/SendAoppMessage/index.tsx new file mode 100644 index 00000000000..70ff042e53e --- /dev/null +++ b/packages/suite/src/components/suite/modals/SendAoppMessage/index.tsx @@ -0,0 +1,63 @@ +import React from 'react'; +import styled from 'styled-components'; +import { Button, variables } from '@trezor/components'; +import { Modal, Translation } from '@suite-components'; +import type { UserContextPayload } from '@suite-actions/modalActions'; + +const Row = styled.div` + display: flex; + text-align: left; + margin-bottom: 8px; + & > * { + &:first-child { + min-width: 120px; + font-weight: ${variables.FONT_WEIGHT.MEDIUM}; + } + &:not(:first-child) { + overflow-wrap: anywhere; + } + } +`; + +const ActionRow = styled.div` + display: flex; + justify-content: space-evenly; + margin-top: 24px; +`; + +const StyledButton = styled(Button)` + width: 200px; +`; + +type Props = Extract & { + onCancel: () => void; +}; + +const SendAoppMessage = ({ onCancel, decision, address, signature, callback }: Props) => ( + }> + + +
{address}
+
+ + +
{signature}
+
+ + +
{callback}
+
+ + { + decision.resolve(true); + onCancel(); + }} + > + + + +
+); + +export default SendAoppMessage; diff --git a/packages/suite/src/components/suite/modals/index.tsx b/packages/suite/src/components/suite/modals/index.tsx index 65c3f4a3658..10267070653 100644 --- a/packages/suite/src/components/suite/modals/index.tsx +++ b/packages/suite/src/components/suite/modals/index.tsx @@ -40,6 +40,7 @@ import MetadataProvider from './metadata/MetadataProvider'; import AdvancedCoinSettings from './AdvancedCoinSettings'; import AddToken from './AddToken'; import SafetyChecks from './SafetyChecks'; +import SendAoppMessage from './SendAoppMessage'; import type { AcquiredDevice } from '@suite-types'; @@ -231,6 +232,8 @@ const getUserContextModal = ({ modal, onCancel }: SharedProps) => { return ; case 'safety-checks': return ; + case 'send-aopp-message': + return ; default: return null; }