-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #364 from BinaryStudioAcademy/task/OV-348-create-m…
…odal-warning OV-348: Create warning modal
- Loading branch information
Showing
5 changed files
with
89 additions
and
0 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
1 change: 1 addition & 0 deletions
1
frontend/src/bundles/studio/components/warning-modal/components/components.ts
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 @@ | ||
export { WarningContent } from './warning-content.js'; |
54 changes: 54 additions & 0 deletions
54
frontend/src/bundles/studio/components/warning-modal/components/warning-content.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,54 @@ | ||
import { | ||
Box, | ||
Button, | ||
Flex, | ||
Heading, | ||
Icon, | ||
Text, | ||
} from '~/bundles/common/components/components.js'; | ||
import { IconName } from '~/bundles/common/icons/icon-name.js'; | ||
|
||
type Properties = { | ||
onCancel: () => void; | ||
onSubmit: () => void; | ||
}; | ||
|
||
const WarningContent: React.FC<Properties> = ({ onCancel, onSubmit }) => { | ||
return ( | ||
<> | ||
<Heading variant="H3" color="typography.900" mb="20px"> | ||
Notice before you submit | ||
</Heading> | ||
|
||
<Text as="p" color="typography.600" mb="20px"> | ||
These issues may affect the final outcome of the generated | ||
video. It is recommended to update your video before submission. | ||
</Text> | ||
|
||
<Box bg="background.50" p="20px 40px" borderRadius="md" mb="20px"> | ||
<Text variant="H4" color="brand.secondary.300"> | ||
<Flex align="center" gap="5px" mb="10px"> | ||
<Icon as={IconName.WARNING} /> Overall scene duration | ||
exceeds overall script duration. | ||
</Flex> | ||
</Text> | ||
<Text as="p" color="typography.600"> | ||
The scene duration exceeding the TTS (text to speech) audio | ||
of script will not be included in the final video. | ||
</Text> | ||
</Box> | ||
|
||
<Flex gap="10px" justify="end"> | ||
<Button label="Cancel" w="auto" onClick={onCancel} /> | ||
<Button | ||
label="Submit Anyway" | ||
w="auto" | ||
variant="secondaryOutlined" | ||
onClick={onSubmit} | ||
/> | ||
</Flex> | ||
</> | ||
); | ||
}; | ||
|
||
export { WarningContent }; |
31 changes: 31 additions & 0 deletions
31
frontend/src/bundles/studio/components/warning-modal/warning-modal.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,31 @@ | ||
import { | ||
BaseModal, | ||
ModalBody, | ||
ModalCloseButton, | ||
ModalContent, | ||
ModalOverlay, | ||
} from '~/bundles/common/components/components.js'; | ||
|
||
import { WarningContent } from './components/components.js'; | ||
|
||
type Properties = { | ||
isOpen: boolean; | ||
onClose: () => void; | ||
onSubmit: () => void; | ||
}; | ||
|
||
const WarningModal: React.FC<Properties> = ({ isOpen, onClose, onSubmit }) => { | ||
return ( | ||
<BaseModal isOpen={isOpen} onClose={onClose} size="xl"> | ||
<ModalOverlay /> | ||
<ModalContent> | ||
<ModalCloseButton /> | ||
<ModalBody p="40px"> | ||
<WarningContent onCancel={onClose} onSubmit={onSubmit} /> | ||
</ModalBody> | ||
</ModalContent> | ||
</BaseModal> | ||
); | ||
}; | ||
|
||
export { WarningModal }; |