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

Login in page #468

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Login in page #468

merged 1 commit into from
Nov 8, 2023

Conversation

Elkrival
Copy link
Collaborator

@Elkrival Elkrival commented Nov 7, 2023

This pr updates the design for the Login Page, it adds an HeroLayout component that can be used for other pages in this format. It adds a form provider to mock the react hook form provider. The TextInput component now passes it's ref for focus.

Screenshot 2023-11-06 at 8 02 58 PM

const FormProviderFixture = ({ children }) => {
const methods = useForm()

return <FormProvider {...methods}>{children} </FormProvider>
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit

Suggested change
return <FormProvider {...methods}>{children} </FormProvider>
return <FormProvider {...methods}>{children}</FormProvider>

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -0,0 +1,20 @@
.HeroCard_container {
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO the block should be the component name for consistency throughout the app, so either Hero or change the name of the component to HeroCard.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -1,23 +1,23 @@
import React, { useState, useContext } from 'react'
Copy link
Collaborator

Choose a reason for hiding this comment

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

should these files be nested in a SignInPage directory like the other component directories?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

.HeroLayout_container {
display: flex;
flex-direction: column;
height: 897px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are we specifying a pixel height? Should the layout take up at least the screen height?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

align-items: center;
justify-content: space-around;
flex-direction: row;
height: 100%;
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be a minimum height?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

align-items: center;
}
.footer_actions {
width: 1018px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

we shouldn't need this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines 18 to 22
const { container } = wrapper

const Footer = container.firstChild

expect(Footer).toBeInTheDocument()
Copy link
Collaborator

Choose a reason for hiding this comment

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

let's use the screen import instead of defining a wrapper. Also, do we need this test if we have the others?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines 13 to 18
test('renders the form', () => {
const { container } = wrapper
const form = container.firstChild

expect(form).toBeInTheDocument()
})
Copy link
Collaborator

Choose a reason for hiding this comment

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

same comment re: using screen and this test may not be valuable given the others.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -0,0 +1,7 @@
.SignInButton_container {
Copy link
Collaborator

Choose a reason for hiding this comment

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

consistent block name (LoginForm_submitBtnContainer)

Copy link
Collaborator

Choose a reason for hiding this comment

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

the block should be the same for all elements in a component. If we extract elements to a new component, they become elements with a block name of the new component name.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -0,0 +1,29 @@
.LoginForm_container {
Copy link
Collaborator

Choose a reason for hiding this comment

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

consistent block names

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Comment on lines +3 to +8
width: 565px;
height: 270px;
}
.HeroCard_image {
height: 106px;
width: 476px;
Copy link
Collaborator

Choose a reason for hiding this comment

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

can we remove these heights and widths? Maybe we need to regroup on this. If these are meant to be components that can in theory be used elsewhere in app then this could really cause us headaches.

Copy link
Collaborator Author

@Elkrival Elkrival Nov 8, 2023

Choose a reason for hiding this comment

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

It's not used anywhere else besides this layout. The right container of this layout is the different forms, but otherwise this stays the same.

@Elkrival Elkrival force-pushed the 428-update-material-ui-version-to-the-latest-stable-version branch 2 times, most recently from 5dc9d5a to b125c60 Compare November 8, 2023 18:14
Base automatically changed from 428-update-material-ui-version-to-the-latest-stable-version to Updated-Dpdash-designs November 8, 2023 18:17
@Elkrival Elkrival changed the base branch from Updated-Dpdash-designs to pnl-devel November 8, 2023 18:20
@Elkrival Elkrival changed the base branch from pnl-devel to Updated-Dpdash-designs November 8, 2023 18:20
* Login Page

* Added Login Page UI designs

3Fixed Test
@Elkrival Elkrival merged commit c52b499 into Updated-Dpdash-designs Nov 8, 2023
@Elkrival Elkrival deleted the login-in-page branch November 8, 2023 19:15

const TextInput = (props) => {
const { name, control, onChange, ...rest } = props
const { name, onChange, ...rest } = props
const { control } = useFormContext()
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Elkrival this change broke the admin page when a user logs in. I think we need the control from props.

Elkrival added a commit that referenced this pull request Nov 27, 2023
* Login Page

* Added Login Page UI designs

3Fixed Test
Elkrival added a commit that referenced this pull request Nov 27, 2023
* Login Page

* Added Login Page UI designs

3Fixed Test
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.

2 participants