Skip to content

Commit

Permalink
(chore) update full detail view
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilShahi committed Aug 28, 2022
1 parent 6437687 commit 08b36ee
Show file tree
Hide file tree
Showing 2 changed files with 195 additions and 169 deletions.
34 changes: 29 additions & 5 deletions frontend/src/components/Alert/AlertComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ export const AlertComponent: React.FC<AlertComponentProps> = ({
alert.resolutionMessage,
)

const closeModal = () => {
setResolutionMessage(alert.resolutionMessage)
onClose()
}

return (
<Box w="full">
<Box
Expand Down Expand Up @@ -104,12 +109,31 @@ export const AlertComponent: React.FC<AlertComponentProps> = ({
</Button>
</HStack>
</VStack>
<Modal size="6xl" isOpen={isOpen} onClose={onClose}>
<Modal isCentered isOpen={isOpen} onClose={closeModal}>
<ModalOverlay />
<ModalContent>
<ModalHeader>{alert.type}</ModalHeader>
<ModalCloseButton />
<ModalBody maxH="700px" overflowY="auto">
<ModalContent maxW="70%" h="85%">
<ModalHeader mr="30px">
<HStack w="full" justifyContent="space-between">
<Heading size="lg">{alert.type}</Heading>
<Badge
fontSize="lg"
px="2"
py="1"
colorScheme={RISK_TO_COLOR[alert.riskScore]}
>
{alert.riskScore}
</Badge>
</HStack>
</ModalHeader>
<ModalCloseButton mt="10px" />
<ModalBody
h="full"
py="4"
bg="secondaryBG"
borderTopWidth={2}
borderBottomWidth={2}
overflow="auto"
>
{alert && (
<AlertDetail
alert={alert}
Expand Down
Loading

0 comments on commit 08b36ee

Please sign in to comment.