-
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.
Merge pull request #49 from manh-t/feature/8-integrate-sign-in-feature
[#8] [Integrate] As a user, I can see the Sign In page
- Loading branch information
Showing
31 changed files
with
888 additions
and
25 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,19 @@ | ||
import React from 'react'; | ||
|
||
import { render, screen } from '@testing-library/react'; | ||
|
||
import Alert from '.'; | ||
|
||
describe('Alert', () => { | ||
const errors = ['Error 1']; | ||
const dataTestId = 'alert'; | ||
|
||
it('renders an alert and its component', () => { | ||
render(<Alert errors={errors} data-test-id={dataTestId} />); | ||
|
||
const alert = screen.getByTestId(dataTestId); | ||
|
||
expect(alert).toBeVisible(); | ||
expect(alert).toHaveTextContent('Error 1'); | ||
}); | ||
}); |
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,25 @@ | ||
import React from 'react'; | ||
|
||
import { ReactComponent as AlertIcon } from 'assets/images/icons/alert.svg'; | ||
|
||
interface AlertProps { | ||
errors: string[]; | ||
'data-test-id'?: string; | ||
} | ||
const Alert = ({ errors, ...rest }: AlertProps): JSX.Element => ( | ||
<div role="alert" {...rest}> | ||
<div className="bg-black-raisin bg-opacity-60 rounded-xl px-4 py-4 flex flex-row"> | ||
<AlertIcon className="mr-[19px] text-white" /> | ||
<div> | ||
<p className="text-small text-white font-extrabold mb-2">Error</p> | ||
<ul className="list-disc list-inside text-white opacity-60 text-xSmall"> | ||
{errors.map((error, index) => ( | ||
<li key={`${index}${error}`}>{error}</li> | ||
))} | ||
</ul> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
|
||
export default Alert; |
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,17 @@ | ||
import React from 'react'; | ||
|
||
import { render, screen } from '@testing-library/react'; | ||
|
||
import LoadingDialog from '.'; | ||
|
||
describe('LoadingDialog', () => { | ||
const dataTestId = 'loading-dialog'; | ||
|
||
it('renders a loading dialog component', () => { | ||
render(<LoadingDialog data-test-id={dataTestId} />); | ||
|
||
const loadingDialog = screen.getByTestId(dataTestId); | ||
|
||
expect(loadingDialog).toBeVisible(); | ||
}); | ||
}); |
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,22 @@ | ||
import React from 'react'; | ||
|
||
interface LoadingDialogProps { | ||
'data-test-id'?: string; | ||
} | ||
|
||
const LoadingDialog = (htmlAttributes: LoadingDialogProps): JSX.Element => { | ||
return ( | ||
<div className="w-full h-full bg-black bg-opacity-60 fixed top-0 right-0" {...htmlAttributes}> | ||
<div | ||
className="inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-white absolute z-[1000] left-1/2 top-1/2 border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]" | ||
role="status" | ||
> | ||
<span className="absolute -m-px h-px w-px overflow-hidden whitespace-nowrap border-0 p-0 [clip:rect(0,0,0,0)]"> | ||
Loading... | ||
</span> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default LoadingDialog; |
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
Oops, something went wrong.