-
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.
- Loading branch information
1 parent
8f57b8d
commit 3b2796b
Showing
8 changed files
with
51 additions
and
6 deletions.
There are no files selected for viewing
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
Empty file.
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,11 @@ | ||
import React from 'react'; | ||
|
||
import { ErrorNode } from './index.styles'; | ||
type PrimitivePPropTypes = React.ComponentPropsWithoutRef<'p'>; | ||
type ErrorTextElement = React.ElementRef<'p'>; | ||
|
||
export const ErrorText = React.forwardRef<ErrorTextElement, PrimitivePPropTypes>( | ||
function ErrorText(props, forwardedRef) { | ||
return <ErrorNode {...props} ref={forwardedRef} />; | ||
} | ||
); |
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,14 @@ | ||
import React from 'react'; | ||
|
||
import { StoryFn, Meta } from '@storybook/react'; | ||
|
||
import { ErrorText } from './index.component'; | ||
|
||
export default { | ||
title: 'Components/ErrorText', | ||
component: ErrorText, | ||
} as Meta<typeof ErrorText>; | ||
|
||
export const Primary: StoryFn<typeof ErrorText> = () => ( | ||
<ErrorText>Error connecting to the server</ErrorText> | ||
); |
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,7 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const ErrorNode = styled.p` | ||
color: ${(props) => props.theme.colors.error400}; | ||
font-weight: ${(props) => props.theme.typography.smallText.fontWeight}; | ||
font-size: ${(props) => props.theme.typography.smallText.fontSize}; | ||
`; |
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,11 @@ | ||
import { renderWithOptions, screen } from 'test'; | ||
|
||
import { ErrorText } from './index.component'; | ||
|
||
describe('<ErrorText/>', () => { | ||
it('should render the error text', () => { | ||
renderWithOptions(<ErrorText>error text</ErrorText>); | ||
|
||
expect(screen.getByText('error text')).toBeInTheDocument(); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -1,5 +1,6 @@ | ||
export * from './loader/index.component'; | ||
export * from './headings/index.component'; | ||
export * from './error-text/index.component'; | ||
export * from './error-boundary/index.component'; | ||
export * from './async-renderer/index.component'; | ||
export * from './internet-notifier/index.component'; |