-
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.
refactor: refactor the structure of base container
Description: Refactor the structure of base component VAN-1840
- Loading branch information
1 parent
3953c76
commit 4c9485c
Showing
7 changed files
with
72 additions
and
51 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
File renamed without changes.
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,42 @@ | ||
import React from 'react'; | ||
|
||
import { ModalDialog } from '@openedx/paragon'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import PrivacyPolicy from './PrivacyPolicyFooter'; | ||
import BaseContainer from '../base-container'; | ||
import './index.scss'; | ||
|
||
const AuthnComponent = ({ | ||
children, open, onClose, isPrivacyPolicy, | ||
}) => ( | ||
<ModalDialog | ||
isOpen={open} | ||
onClose={onClose} | ||
size="fullscreen" | ||
variant="default" | ||
hasCloseButton | ||
> | ||
<ModalDialog.Body className="modal-body-container overflow-hidden"> | ||
<BaseContainer> | ||
{children} | ||
</BaseContainer> | ||
</ModalDialog.Body> | ||
<ModalDialog.Footer className="modal-footer-content"> | ||
{isPrivacyPolicy && (<PrivacyPolicy />)} | ||
</ModalDialog.Footer> | ||
</ModalDialog> | ||
); | ||
|
||
AuthnComponent.defaultProps = { | ||
isPrivacyPolicy: false, | ||
}; | ||
|
||
AuthnComponent.propTypes = { | ||
children: PropTypes.node.isRequired, | ||
open: PropTypes.bool.isRequired, | ||
onClose: PropTypes.func.isRequired, | ||
isPrivacyPolicy: PropTypes.bool, | ||
}; | ||
|
||
export default AuthnComponent; |
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,16 @@ | ||
.modal-body-container .pgn__modal-body-content { | ||
height: 100%; | ||
} | ||
|
||
.pgn__modal-close-container { | ||
background: white; | ||
border-radius: 50%; | ||
} | ||
|
||
.modal-footer-content { | ||
padding: 0 !important; | ||
} | ||
|
||
.privacy-policy-content { | ||
margin-bottom: 0px; | ||
} |
File renamed without changes.
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,47 +1,26 @@ | ||
import React from 'react'; | ||
|
||
import { ModalDialog } from '@openedx/paragon'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import LargeLayout from './layout/LargeLayout'; | ||
import PrivacyPolicy from './PrivacyPolicyFooter'; | ||
import './index.scss'; | ||
|
||
const BaseContainer = ({ | ||
children, open, onClose, isPrivacyPolicy, | ||
children, | ||
}) => ( | ||
<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, | ||
}; | ||
<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> | ||
); | ||
|
||
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 |
---|---|---|
@@ -1,22 +1,6 @@ | ||
.modal-body-container .pgn__modal-body-content { | ||
height: 100%; | ||
} | ||
|
||
.modal-body-container .modal-body-content-layout { | ||
.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; | ||
} |