-
Notifications
You must be signed in to change notification settings - Fork 1
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
Login in page #468
Conversation
test/FormProviderFixture.jsx
Outdated
const FormProviderFixture = ({ children }) => { | ||
const methods = useForm() | ||
|
||
return <FormProvider {...methods}>{children} </FormProvider> |
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.
nit
return <FormProvider {...methods}>{children} </FormProvider> | |
return <FormProvider {...methods}>{children}</FormProvider> |
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.
views/components/Hero/Hero.css
Outdated
@@ -0,0 +1,20 @@ | |||
.HeroCard_container { |
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.
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
.
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.
@@ -1,23 +1,23 @@ | |||
import React, { useState, useContext } from 'react' |
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.
should these files be nested in a SignInPage
directory like the other component directories?
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.
views/layouts/HeroLayout.css
Outdated
.HeroLayout_container { | ||
display: flex; | ||
flex-direction: column; | ||
height: 897px; |
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.
why are we specifying a pixel height? Should the layout take up at least the screen height?
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.
views/layouts/HeroLayout.css
Outdated
align-items: center; | ||
justify-content: space-around; | ||
flex-direction: row; | ||
height: 100%; |
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.
should this be a minimum height?
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.
align-items: center; | ||
} | ||
.footer_actions { | ||
width: 1018px; |
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 shouldn't need this.
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.
const { container } = wrapper | ||
|
||
const Footer = container.firstChild | ||
|
||
expect(Footer).toBeInTheDocument() |
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.
let's use the screen
import instead of defining a wrapper. Also, do we need this test if we have the others?
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.
test('renders the form', () => { | ||
const { container } = wrapper | ||
const form = container.firstChild | ||
|
||
expect(form).toBeInTheDocument() | ||
}) |
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.
same comment re: using screen and this test may not be valuable given the others.
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.
views/forms/LoginForm/LoginForm.css
Outdated
@@ -0,0 +1,7 @@ | |||
.SignInButton_container { |
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.
consistent block name (LoginForm_submitBtnContainer
)
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 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.
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.
views/pages/SignInPage.css
Outdated
@@ -0,0 +1,29 @@ | |||
.LoginForm_container { |
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.
consistent block names
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.
5a47080
to
11a691a
Compare
width: 565px; | ||
height: 270px; | ||
} | ||
.HeroCard_image { | ||
height: 106px; | ||
width: 476px; |
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 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.
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's not used anywhere else besides this layout. The right container of this layout is the different forms, but otherwise this stays the same.
3ecc044
to
ae0b517
Compare
5dc9d5a
to
b125c60
Compare
ae0b517
to
9930666
Compare
4ed9b1e
to
9f58ff5
Compare
* Login Page * Added Login Page UI designs 3Fixed Test
9f58ff5
to
13f795d
Compare
|
||
const TextInput = (props) => { | ||
const { name, control, onChange, ...rest } = props | ||
const { name, onChange, ...rest } = props | ||
const { control } = useFormContext() |
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.
@Elkrival this change broke the admin page when a user logs in. I think we need the control from props.
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.