-
-
Notifications
You must be signed in to change notification settings - Fork 259
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style(suite): Style remove contact confirmation
- Loading branch information
Showing
3 changed files
with
57 additions
and
98 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
packages/suite/src/views/contacts/RemoveContactConfirmation.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,42 @@ | ||
import React from 'react'; | ||
|
||
import { NewModal } from '@trezor/components'; | ||
import { contactsActions } from '@suite-common/contacts/src/redux/contactsActions'; | ||
import { Contact } from '@suite-common/contacts'; | ||
|
||
import { useDispatch } from '../../hooks/suite'; | ||
|
||
type RemoveContactConfirmationProps = { | ||
onClose: () => void; | ||
contact: Contact; | ||
}; | ||
|
||
export const RemoveContactConfirmation = ({ onClose, contact }: RemoveContactConfirmationProps) => { | ||
const dispatch = useDispatch(); | ||
|
||
const onRemoveContact = () => { | ||
dispatch(contactsActions.removeContact(contact)); | ||
onClose(); | ||
}; | ||
|
||
return ( | ||
<NewModal | ||
onCancel={onClose} | ||
iconName="warningFilled" | ||
variant="destructive" | ||
size="small" | ||
bottomContent={ | ||
<> | ||
<NewModal.Button variant="destructive" onClick={onRemoveContact}> | ||
Remove | ||
</NewModal.Button> | ||
<NewModal.Button variant="tertiary" onClick={onClose}> | ||
Close | ||
</NewModal.Button> | ||
</> | ||
} | ||
> | ||
Are you sure you want to remove the contact? | ||
</NewModal> | ||
); | ||
}; |
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
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