Skip to content
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

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

ahtesham-quraish
Copy link
Contributor

@ahtesham-quraish ahtesham-quraish commented Mar 26, 2024

Description

  • Created basic layout using paragon modal for forms
  • Created privacy policy footer for signup form that would be controlled by flag

JIRA

Jira Ticket

How Has This Been Tested?

It has been tested locally.

Screenshots:

After
image

</div>
</ModalDialog.Body>
<ModalDialog.Footer className="modal-footer-content">
{isPrivacyPolicy && (<PrivacyPolicy />)}
Copy link
Member

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 />}?

Copy link
Contributor Author

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

@ahtesham-quraish ahtesham-quraish force-pushed the ahtesham/van-1840 branch 2 times, most recently from 95040a4 to bb70805 Compare March 26, 2024 08:07
Copy link
Contributor

@syedsajjadkazmii syedsajjadkazmii left a 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.

example/index.jsx Outdated Show resolved Hide resolved
src/base-container/index.scss Outdated Show resolved Hide resolved
Description:
Create popup basic layout for forms
VAN-1840
@ahtesham-quraish ahtesham-quraish force-pushed the ahtesham/van-1840 branch 2 times, most recently from 8bf2dda to 4c9485c Compare March 26, 2024 10:25
Copy link
Contributor

@zainab-amir zainab-amir left a 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

Copy link
Contributor

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.

Copy link
Contributor

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/base-container/PrivacyPolicyFooter.jsx Outdated Show resolved Hide resolved
src/base-container/layout/LargeLayout.jsx Outdated Show resolved Hide resolved
src/base-container/index.scss Outdated Show resolved Hide resolved
src/authn-component/PrivacyPolicyFooter.jsx Outdated Show resolved Hide resolved
src/base-container/index.jsx Outdated Show resolved Hide resolved
Copy link
Contributor

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.

Copy link
Contributor Author

@ahtesham-quraish ahtesham-quraish Mar 27, 2024

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

src/authn-component/index.scss Outdated Show resolved Hide resolved
@ahtesham-quraish ahtesham-quraish force-pushed the ahtesham/van-1840 branch 3 times, most recently from b4473ba to faea39f Compare March 27, 2024 07:35
Copy link
Contributor

@syedsajjadkazmii syedsajjadkazmii left a 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?

src/authn-component/index.jsx Outdated Show resolved Hide resolved
src/authn-component/index.jsx Outdated Show resolved Hide resolved
src/authn-component/index.scss Outdated Show resolved Hide resolved
src/authn-component/index.scss Outdated Show resolved Hide resolved
src/authn-component/index.jsx Outdated Show resolved Hide resolved
@syedsajjadkazmii
Copy link
Contributor

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.

Copy link
Contributor

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.

/**
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

* @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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @returns {JSX.Element} The rendered Login or register component.
* @returns {JSX.Element} The rendered BaseContainer component containing either login or registration form.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

import './index.scss';

/**
* A Base component that would render the paragon modal and content of registration or login.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* A Base component that would render the paragon modal and content of registration or login.
* Base component for registration or login form modals.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

/**
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

Comment on lines 13 to 14
* @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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed


);

BaseContainer.defaultProps = {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

*/

const BaseContainer = ({
children, open, setOpen, footerText,
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

* @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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @returns {JSX.Element} The rendered BaseContainer component.
* @returns {JSX.Element} The rendered login or registration form modal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

import BaseContainer from '../base-container';

/**
* A Authn component that would render the register or login component with condtional logic.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.

Copy link
Contributor

@syedsajjadkazmii syedsajjadkazmii left a 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 Show resolved Hide resolved
Comment on lines 41 to 43
<ModalDialog.Footer className="bg-dark-500 p-0">
<p className="p-4.5 mb-0 text-white">{footerText}</p>
</ModalDialog.Footer>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<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>

Copy link
Contributor Author

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

@ahtesham-quraish ahtesham-quraish force-pushed the ahtesham/van-1840 branch 2 times, most recently from d85ad98 to eb6d9ef Compare March 28, 2024 06:39
Copy link
Contributor

@zainab-amir zainab-amir left a 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

Comment on lines 56 to 58
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.',
};
Copy link
Contributor

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?

Suggested change
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
@ahtesham-quraish ahtesham-quraish merged commit e941b18 into master Mar 28, 2024
5 checks passed
@ahtesham-quraish ahtesham-quraish deleted the ahtesham/van-1840 branch March 28, 2024 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants