-
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 b4473ba
Showing
8 changed files
with
68 additions
and
96 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from 'react'; | ||
|
||
import { ModalDialog } from '@openedx/paragon'; | ||
import PropTypes from 'prop-types'; | ||
|
||
import BaseContainer from '../base-container'; | ||
import './index.scss'; | ||
|
||
const AuthnComponent = ({ | ||
open, setOpen, footerContext, | ||
}) => ( | ||
<ModalDialog | ||
isOpen={open} | ||
onClose={setOpen} | ||
size="fullscreen" | ||
variant="default" | ||
className="bg-light-400" | ||
hasCloseButton | ||
> | ||
<ModalDialog.Body className="modal-body-container overflow-hidden"> | ||
<BaseContainer> | ||
<div>Login Form</div> | ||
</BaseContainer> | ||
</ModalDialog.Body> | ||
{footerContext && ( | ||
<ModalDialog.Footer className="bg-dark-500 p-0"> | ||
<p className="p-4.5 mb-0 text-white">{footerContext}</p> | ||
</ModalDialog.Footer> | ||
)} | ||
</ModalDialog> | ||
); | ||
|
||
AuthnComponent.defaultProps = { | ||
footerContext: null, | ||
}; | ||
|
||
AuthnComponent.propTypes = { | ||
open: PropTypes.bool.isRequired, | ||
setOpen: PropTypes.func.isRequired, | ||
footerContext: PropTypes.string, | ||
}; | ||
|
||
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,12 @@ | ||
@import "@edx/brand/paragon/variables"; | ||
|
||
.modal-body-container .pgn__modal-body-content { | ||
height: 100%; | ||
} | ||
|
||
.pgn__modal-close-container { | ||
background: $light-400; | ||
border-radius: 50%; | ||
border: 2px solid $light-500; | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
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,25 @@ | ||
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> | ||
<div className="w-50 d-flex"> | ||
<div className="w-100 h-100 bg-dark-500" /> | ||
</div> | ||
</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; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.