Skip to content

Commit

Permalink
Add report button to dapp request modal
Browse files Browse the repository at this point in the history
  • Loading branch information
OKendigelyan committed Oct 3, 2024
1 parent dcada1f commit 775a87e
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 19 deletions.
30 changes: 21 additions & 9 deletions apps/desktop/src/utils/beacon/PermissionRequestModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
FormErrorMessage,
Heading,
Image,
Link,
ModalBody,
ModalCloseButton,
ModalContent,
Expand Down Expand Up @@ -77,15 +78,6 @@ export const PermissionRequestModal = ({ request }: { request: PermissionRequest
<Text marginTop="10px" color={colors.gray[400]} textAlign="center" size="sm">
{request.appMetadata.name} is requesting permission to sign this operation.
</Text>

<Flex alignItems="center" justifyContent="center" marginTop="10px">
<Heading marginRight="4px" color={colors.gray[450]} size="sm">
Network:
</Heading>
<Text color={colors.gray[400]} size="sm">
{capitalize(request.network.type)}
</Text>
</Flex>
</ModalHeader>
<ModalCloseButton />
<ModalBody data-testid="beacon-request-body">
Expand All @@ -102,6 +94,26 @@ export const PermissionRequestModal = ({ request }: { request: PermissionRequest
<Heading size="sm">{request.appMetadata.name}</Heading>
</Flex>

<Flex alignItems="center" justifyContent="space-between" marginTop="12px">
<Flex alignItems="center" gap="4px">
<Text size="xs">Suspicious DApp? </Text>
<Link
fontSize="12px"
textDecoration="underline"
href="mailto:[email protected]"
isExternal
>
Report
</Link>
</Flex>
<Flex alignItems="center" justifyContent="center">
<Heading marginRight="4px" color={colors.gray[450]} size="md">
Network:
</Heading>
<Text color={colors.gray[400]}>{capitalize(request.network.type)}</Text>
</Flex>
</Flex>

<Accordion marginTop="16px" allowToggle={true}>
<AccordionItem background={colors.gray[800]} border="none" borderRadius="8px">
<AccordionButton>
Expand Down
32 changes: 23 additions & 9 deletions apps/web/src/components/beacon/PermissionRequestModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
FormErrorMessage,
Heading,
Image,
Link,
ModalBody,
ModalContent,
ModalFooter,
Expand Down Expand Up @@ -79,15 +80,6 @@ export const PermissionRequestModal = ({ request }: { request: PermissionRequest
<Text marginTop="10px" color={color("700")} textAlign="center" size="sm">
{request.appMetadata.name} is requesting permission to sign this operation.
</Text>

<Flex alignItems="center" justifyContent="center" marginTop="10px">
<Heading marginRight="4px" color={color("700")} size="sm">
Network:
</Heading>
<Text color={color("700")} fontWeight="400" size="sm">
{capitalize(request.network.type)}
</Text>
</Flex>
</ModalHeader>
<ModalCloseButton />
<ModalBody data-testid="beacon-request-body">
Expand All @@ -109,6 +101,28 @@ export const PermissionRequestModal = ({ request }: { request: PermissionRequest
<Heading size="sm">{request.appMetadata.name}</Heading>
</Flex>

<Flex alignItems="center" justifyContent="space-between" marginTop="12px">
<Flex alignItems="center" gap="4px">
<Text size="sm">Suspicious DApp? </Text>
<Link
fontSize="14px"
textDecoration="underline"
href="mailto:[email protected]"
isExternal
>
Report
</Link>
</Flex>
<Flex alignItems="center" justifyContent="center">
<Heading marginRight="4px" color={color("700")} size="md">
Network:
</Heading>
<Text color={color("700")} fontWeight="400">
{capitalize(request.network.type)}
</Text>
</Flex>
</Flex>

<Accordion marginTop="16px" allowToggle={true}>
<AccordionItem background={color("100")} border="none" borderRadius="8px">
<AccordionButton borderRadius="full">
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/styles/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ const theme = extendTheme({
},
Link: {
baseStyle: {
color: "gray.500",
color: "gray.600",
textUnderlineOffset: "2px",
},
variants: {
dropdownOption: {
Expand Down

1 comment on commit 775a87e

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Title Lines Statements Branches Functions
apps/desktop Coverage: 83%
83.63% (1768/2114) 78.81% (837/1062) 78.22% (449/574)
apps/web Coverage: 83%
83.63% (1768/2114) 78.81% (837/1062) 78.22% (449/574)
packages/components Coverage: 97%
97.17% (172/177) 95.12% (78/82) 85.41% (41/48)
packages/core Coverage: 81%
82.22% (222/270) 71.73% (99/138) 81.96% (50/61)
packages/crypto Coverage: 100%
100% (28/28) 100% (3/3) 100% (5/5)
packages/data-polling Coverage: 97%
95.27% (141/148) 87.5% (21/24) 92.85% (39/42)
packages/multisig Coverage: 98%
98.47% (129/131) 85.71% (18/21) 100% (35/35)
packages/social-auth Coverage: 100%
100% (21/21) 100% (11/11) 100% (3/3)
packages/state Coverage: 85%
84.61% (792/936) 80.97% (166/205) 78.72% (296/376)
packages/tezos Coverage: 86%
85.57% (89/104) 89.47% (17/19) 82.75% (24/29)
packages/tzkt Coverage: 86%
84.05% (58/69) 81.25% (13/16) 76.92% (30/39)

Please sign in to comment.