-
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
99bc5d0
commit c883fda
Showing
4 changed files
with
36 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { Text } from "rebass/styled-components"; | ||
|
||
function Paragraph ({ children, ...props }) { | ||
return ( | ||
<Text {...props} as="p" color="text" fontFamily="body" fontSize={[1,2,3]}> | ||
{children} | ||
</Text> | ||
); | ||
} | ||
|
||
export default Paragraph; |
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 Paragraph from "components/paragraph"; | ||
|
||
export default { | ||
title: 'Components/Paragraph', | ||
component: Paragraph, | ||
}; | ||
|
||
const ParagraphTemplate = (props) => <Paragraph {...props} /> | ||
|
||
export const ParagraphStory = ParagraphTemplate.bind({}); | ||
ParagraphStory.args = { | ||
children: "Lorem ipsum de lorum col a suld icus a puentus aleetum", | ||
}; |
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,9 @@ | ||
import Paragraph from "./index"; | ||
import { render } from "@testing-library/react"; | ||
|
||
describe("Paragraph", () => { | ||
test("render contents", () => { | ||
const { queryByText } = render(<Paragraph>Hello world</Paragraph>); | ||
expect(queryByText("Hello world")).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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import Paragraph from "./Paragraph"; | ||
export default Paragraph; |