-
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.
feat: create popup base layout for forms
Description: Create popup basic layout for forms VAN-1840
- Loading branch information
1 parent
203d56d
commit 95040a4
Showing
6 changed files
with
111 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import { useIntl } from '@edx/frontend-platform/i18n'; | ||
import messages from './messages'; | ||
|
||
const PrivacyPolicy = () => { | ||
const { formatMessage } = useIntl(); | ||
return ( | ||
<p className="bg-dark-500 p-4 text-light-100 privacy-policy-content"> | ||
{formatMessage(messages.privacyPolicyLabel)} | ||
</p> | ||
); | ||
}; | ||
export default PrivacyPolicy; |
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,46 @@ | ||
import React from 'react'; | ||
|
||
import { ModalDialog } from '@openedx/paragon'; | ||
import PropTypes from 'prop-types'; | ||
import PrivacyPolicy from './PrivacyPolicyFooter'; | ||
import LargeLayout from './layout/LargeLayout'; | ||
import './index.scss'; | ||
|
||
const BaseContainer = ({ | ||
children, open, onClose, isPrivacyPolicy, | ||
}) => ( | ||
<ModalDialog | ||
isOpen={open} | ||
onClose={onClose} | ||
size="fullscreen" | ||
variant="default" | ||
hasCloseButton | ||
> | ||
<ModalDialog.Body className="modal-body-container overflow-hidden"> | ||
<div className="modal-body-content-layout"> | ||
<div className="w-50 d-flex"> | ||
{children} | ||
</div> | ||
<LargeLayout> | ||
<div className="w-100 h-100 bg-dark-500" /> | ||
</LargeLayout> | ||
</div> | ||
</ModalDialog.Body> | ||
<ModalDialog.Footer className="modal-footer-content"> | ||
{isPrivacyPolicy && (<PrivacyPolicy />)} | ||
</ModalDialog.Footer> | ||
</ModalDialog> | ||
); | ||
|
||
BaseContainer.defaultProps = { | ||
isPrivacyPolicy: false, | ||
}; | ||
|
||
BaseContainer.propTypes = { | ||
children: PropTypes.node.isRequired, | ||
open: PropTypes.bool.isRequired, | ||
onClose: PropTypes.func.isRequired, | ||
isPrivacyPolicy: PropTypes.bool, | ||
}; | ||
|
||
export default BaseContainer; |
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,22 @@ | ||
.modal-body-container .pgn__modal-body-content { | ||
height: 100%; | ||
} | ||
|
||
.modal-body-container .modal-body-content-layout { | ||
display: flex; | ||
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
.pgn__modal-close-container { | ||
background: white; | ||
border-radius: 50%; | ||
} | ||
|
||
.modal-footer-content { | ||
padding: 0 !important; | ||
} | ||
|
||
.privacy-policy-content { | ||
margin-bottom: 0px; | ||
} |
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,14 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
|
||
const LargeLayout = ({ children }) => ( | ||
<div className="w-50 d-flex"> | ||
{children} | ||
</div> | ||
); | ||
|
||
LargeLayout.propTypes = { | ||
children: PropTypes.node.isRequired, | ||
}; | ||
|
||
export default LargeLayout; |
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,13 @@ | ||
import { defineMessages } from '@edx/frontend-platform/i18n'; | ||
|
||
const messages = defineMessages({ | ||
privacyPolicyLabel: { | ||
id: 'privacy.policy.label', | ||
defaultMessage: 'By creating an account, you agree to the Terms of ' | ||
+ 'Service and Honor Code and you acknowledge that edX and ' | ||
+ 'each Member process your personal data in accordance with the Privacy Policy.', | ||
description: 'Label for Privacy Policy', | ||
}, | ||
}); | ||
|
||
export default messages; |