-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: create popup base layout for forms #1
Conversation
src/base-container/index.jsx
Outdated
</div> | ||
</ModalDialog.Body> | ||
<ModalDialog.Footer className="modal-footer-content"> | ||
{isPrivacyPolicy && (<PrivacyPolicy />)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we do this like {isPrivacyPolicy && <PrivacyPolicy />}
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it won't be any different
95040a4
to
bb70805
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can discuss this as well but I was expecting BaseContainer to be inside the ModalDialog body since content is inside the modal.
I was expecting a hierary such as: we have an authn component, lets say AuthnComponent
which renders ModalDialog. Inside that ModalDialog, we have BaseContainer. Inside BaseContainer we pass the content (Register or login form). Then we use the AuthnComponent to render as final component.
And then AuthnComponent should be the one to receive open
and onClose
props.
bb70805
to
95eb761
Compare
Description: Create popup basic layout for forms VAN-1840
8bf2dda
to
4c9485c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The background color for the modal is light-400
- We should discuss how we will use the registration & login components in paragon and which component should accept the the form
example/index.jsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets not update this file for now. I will create a separate ticket to handle how we can view different forms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove changes from this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will most likely not have promo content for small screen and this component feels like an overkill. We can easily incorporate this in the Modal content directly.
See my comment about abstraction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok my assumption was that we would have small layout for promo as well that is why I did that abstraction
b4473ba
to
faea39f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add picture of whole screen along with current ss of just modal?
faea39f
to
47d1d15
Compare
47d1d15
to
52c525e
Compare
NIT: Since we are writing new components, can we adopt the practice of putting docstring to each Component and function? Doesn't matter if it's just a line description. Doing this while writing components wouldn't be much effort IMO. |
52c525e
to
10ebf62
Compare
example/index.jsx
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove changes from this file.
src/authn-component/index.jsx
Outdated
/** | ||
* A Authn component that would render the register or login component with condtional logic. | ||
* | ||
* @param {boolean} open - Required. Open veriable that will be used to toggle the modal window. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {boolean} open - Required. Open veriable that will be used to toggle the modal window. | |
* @param {boolean} open - Required. Whether to open the modal window containing login or registration form |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
src/authn-component/index.jsx
Outdated
* @param {boolean} open - Required. Open veriable that will be used to toggle the modal window. | ||
* @param {function} setOpen - Required. Is used to toggle the modal window's open flag. | ||
* | ||
* @returns {JSX.Element} The rendered Login or register component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @returns {JSX.Element} The rendered Login or register component. | |
* @returns {JSX.Element} The rendered BaseContainer component containing either login or registration form. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
src/base-container/index.jsx
Outdated
import './index.scss'; | ||
|
||
/** | ||
* A Base component that would render the paragon modal and content of registration or login. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* A Base component that would render the paragon modal and content of registration or login. | |
* Base component for registration or login form modals. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
src/base-container/index.jsx
Outdated
/** | ||
* A Base component that would render the paragon modal and content of registration or login. | ||
* | ||
* @param {boolean} open - Required. Open veriable that will be used to toggle the modal window. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {boolean} open - Required. Open veriable that will be used to toggle the modal window. | |
* @param {boolean} open - Required. Whether to open the modal window |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
src/base-container/index.jsx
Outdated
* @param {string} footerText - Optional. This is used to render the footer text. | ||
* @param {React.node} children - Required. It contains the React node of registration page or login page. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @param {string} footerText - Optional. This is used to render the footer text. | |
* @param {React.node} children - Required. It contains the React node of registration page or login page. | |
* @param {string} footerText - The text for the modal footer | |
* @param {React.node} children - Required. The login or registration form. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
src/base-container/index.jsx
Outdated
|
||
); | ||
|
||
BaseContainer.defaultProps = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[This is just to make the components consistent] Please move default props below the actual props.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
src/base-container/index.jsx
Outdated
*/ | ||
|
||
const BaseContainer = ({ | ||
children, open, setOpen, footerText, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[This is just to make the components consistent] Please sort these.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
src/base-container/index.jsx
Outdated
* @param {string} footerText - Optional. This is used to render the footer text. | ||
* @param {React.node} children - Required. It contains the React node of registration page or login page. | ||
* | ||
* @returns {JSX.Element} The rendered BaseContainer component. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @returns {JSX.Element} The rendered BaseContainer component. | |
* @returns {JSX.Element} The rendered login or registration form modal. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
addressed
src/authn-component/index.jsx
Outdated
import BaseContainer from '../base-container'; | ||
|
||
/** | ||
* A Authn component that would render the register or login component with condtional logic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* A Authn component that would render the register or login component with condtional logic. | |
* Main component that holds the logic for conditionally rendering login or registration form. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update screenshot of modal. (In full screen)
src/base-container/index.jsx
Outdated
<ModalDialog.Footer className="bg-dark-500 p-0"> | ||
<p className="p-4.5 mb-0 text-white">{footerText}</p> | ||
</ModalDialog.Footer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<ModalDialog.Footer className="bg-dark-500 p-0"> | |
<p className="p-4.5 mb-0 text-white">{footerText}</p> | |
</ModalDialog.Footer> | |
<ModalDialog.Footer className="bg-dark-500 p-4.5"> | |
<p className="mb-0 text-white">{footerText}</p> | |
</ModalDialog.Footer> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works fine either way btw but anyway I have moved this class to footer
10ebf62
to
9d4f74b
Compare
d85ad98
to
eb6d9ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the comment before merging
src/base-container/index.jsx
Outdated
BaseContainer.defaultProps = { | ||
footerText: '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.', | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this some testing code you missed?
BaseContainer.defaultProps = { | |
footerText: '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.', | |
}; | |
BaseContainer.defaultProps = { | |
footerText: '', | |
}; |
Description: Refactor the structure of base component VAN-1840
eb6d9ef
to
832194d
Compare
Description
JIRA
Jira Ticket
How Has This Been Tested?
It has been tested locally.
Screenshots: