-
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 #452 from BinaryStudioAcademy/task/OV-444-add-warn…
…ing-that-progress-not-saved-on-studio-page OV-444: + add unsaved warning
- Loading branch information
Showing
5 changed files
with
93 additions
and
13 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
export { UnsavedWarningContent } from './unsaved-warning-content.js'; | ||
export { WarningContent } from './warning-content.js'; |
41 changes: 41 additions & 0 deletions
41
frontend/src/bundles/studio/components/warning-modal/components/unsaved-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,41 @@ | ||
import { | ||
Button, | ||
Flex, | ||
Heading, | ||
Text, | ||
} from '~/bundles/common/components/components.js'; | ||
|
||
type Properties = { | ||
onCancel: () => void; | ||
onSubmit: () => void; | ||
}; | ||
|
||
const UnsavedWarningContent: React.FC<Properties> = ({ | ||
onCancel, | ||
onSubmit, | ||
}) => { | ||
return ( | ||
<> | ||
<Heading variant="H3" color="typography.900" mb="20px"> | ||
Notice before you leave the page | ||
</Heading> | ||
|
||
<Text as="p" color="typography.600" mb="20px"> | ||
If you leave now all your unsaved changes will be lost. Please | ||
save draft or submit to render before leaving. | ||
</Text> | ||
|
||
<Flex gap="10px" justify="end"> | ||
<Button label="Cancel" w="auto" onClick={onCancel} /> | ||
<Button | ||
label="Leave Anyway" | ||
w="auto" | ||
variant="secondaryOutlined" | ||
onClick={onSubmit} | ||
/> | ||
</Flex> | ||
</> | ||
); | ||
}; | ||
|
||
export { UnsavedWarningContent }; |
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