-
-
Notifications
You must be signed in to change notification settings - Fork 263
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(suite): #4512 add Send AOPP modal
- Loading branch information
1 parent
a1116a2
commit 9deeb83
Showing
3 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
packages/suite/src/components/suite/modals/SendAoppMessage/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<UserContextPayload, { type: 'send-aopp-message' }> & { | ||
onCancel: () => void; | ||
}; | ||
|
||
const SendAoppMessage = ({ onCancel, decision, address, signature, callback }: Props) => ( | ||
<Modal cancelable onCancel={onCancel} heading={<Translation id="TR_AOPP_SEND" />}> | ||
<Row> | ||
<Translation id="TR_ADDRESS" /> | ||
<div>{address}</div> | ||
</Row> | ||
<Row> | ||
<Translation id="TR_SIGNATURE" /> | ||
<div>{signature}</div> | ||
</Row> | ||
<Row> | ||
<Translation id="TR_TO" /> | ||
<div>{callback}</div> | ||
</Row> | ||
<ActionRow> | ||
<StyledButton | ||
onClick={() => { | ||
decision.resolve(true); | ||
onCancel(); | ||
}} | ||
> | ||
<Translation id="TR_NAV_SEND" /> | ||
</StyledButton> | ||
</ActionRow> | ||
</Modal> | ||
); | ||
|
||
export default SendAoppMessage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters