-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add disconnect account approval step (#1101)
- Loading branch information
1 parent
008da89
commit 026b971
Showing
16 changed files
with
473 additions
and
232 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { ActionButton, Alert, GapPatterns, Stack } from "@namada/components"; | ||
import { PageHeader } from "App/Common"; | ||
import { DisconnectInterfaceResponseMsg } from "background/approvals"; | ||
import { useQuery } from "hooks"; | ||
import { useRequester } from "hooks/useRequester"; | ||
import { Ports } from "router"; | ||
import { closeCurrentTab } from "utils"; | ||
|
||
export const ApproveDisconnection: React.FC = () => { | ||
const requester = useRequester(); | ||
const params = useQuery(); | ||
const interfaceOrigin = params.get("interfaceOrigin"); | ||
|
||
const handleResponse = async (revokeConnection: boolean): Promise<void> => { | ||
if (interfaceOrigin) { | ||
await requester.sendMessage( | ||
Ports.Background, | ||
new DisconnectInterfaceResponseMsg(interfaceOrigin, revokeConnection) | ||
); | ||
await closeCurrentTab(); | ||
} | ||
}; | ||
|
||
return ( | ||
<Stack full gap={GapPatterns.TitleContent} className="pt-4 pb-8"> | ||
<PageHeader title="Approve Request" /> | ||
<Stack full className="justify-between" gap={12}> | ||
<Alert type="warning"> | ||
Approve disconnect for <strong>{interfaceOrigin}</strong>? | ||
</Alert> | ||
<Stack gap={2}> | ||
<ActionButton onClick={() => handleResponse(true)}> | ||
Approve | ||
</ActionButton> | ||
<ActionButton | ||
outlineColor="yellow" | ||
onClick={() => handleResponse(false)} | ||
> | ||
Reject | ||
</ActionButton> | ||
</Stack> | ||
</Stack> | ||
</Stack> | ||
); | ||
}; |
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
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
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
Oops, something went wrong.
026b971
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Published on https://namada-interface-dev.netlify.app as production
🚀 Deployed on https://66e3fac7e454b3dd2a0cce2f--namada-interface-dev.netlify.app