generated from GovAlta/ui-components-react-template
-
Notifications
You must be signed in to change notification settings - Fork 10
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 #18 from vanessatran-ddi/feat/list-component-page
feat: Add list page- Code review needed
- Loading branch information
Showing
2 changed files
with
211 additions
and
1 deletion.
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
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,207 @@ | ||
import {Category, ComponentHeader} from "@components/component-header/ComponentHeader.tsx"; | ||
import {GoABadge, GoABlock, GoAContainer, GoATab, GoATabs} from "@abgov/react-components"; | ||
import {CodeSnippet} from "@components/code-snippet/CodeSnippet.tsx"; | ||
import {useContext} from "react"; | ||
import {LanguageContext} from "@components/sandbox"; | ||
|
||
export default function ListPage() { | ||
const language = useContext(LanguageContext); | ||
|
||
return ( | ||
<> | ||
<ComponentHeader | ||
name="List" | ||
category={Category.CONTENT_AND_LAYOUT} | ||
description="Chunk information into short succinct ideas." | ||
/> | ||
<GoATabs> | ||
<GoATab heading="Code examples"> | ||
{/*We don't use sandbox because it isn't starting with "GoA" components*/} | ||
<GoAContainer> | ||
<ol className="goa-ordered-list"> | ||
<li> | ||
An ordered item | ||
<ul> | ||
<li>An unordered item</li> | ||
<li> | ||
A longer item that wraps to a second line | ||
<ul> | ||
<li>An item on a 3rd level</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
<li> | ||
An ordered item | ||
<ul> | ||
<li> | ||
An unordered item | ||
<ul> | ||
<li>An item on a third level</li> | ||
<li> | ||
A second item on a 3rd level | ||
<ul> | ||
<li>An item on a 4th level</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
</ol> | ||
</GoAContainer> | ||
|
||
{language === "react" && ( | ||
<CodeSnippet | ||
lang="typescript" | ||
tags="react" | ||
allowCopy={true} | ||
code={` | ||
<ol className="goa-ordered-list"> | ||
<li> | ||
An ordered item | ||
<ul> | ||
<li>An unordered item</li> | ||
<li> | ||
A longer item that wraps to a second line | ||
<ul> | ||
<li>An item on a 3rd level</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
<li> | ||
An ordered item | ||
<ul> | ||
<li> | ||
An unordered item | ||
<ul> | ||
<li>An item on a third level</li> | ||
<li> | ||
A second item on a 3rd level | ||
<ul> | ||
<li>An item on a 4th level</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
</ol> | ||
`} | ||
/> | ||
)} | ||
|
||
{language === "angular" && ( | ||
<CodeSnippet | ||
lang="typescript" | ||
tags="angular" | ||
allowCopy={true} | ||
code={` | ||
<ol class="goa-ordered-list"> | ||
<li> | ||
An ordered item | ||
<ul> | ||
<li>An unordered item</li> | ||
<li> | ||
A longer item that wraps to a second line | ||
<ul> | ||
<li>An item on a 3rd level</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
<li> | ||
An ordered item | ||
<ul> | ||
<li> | ||
An unordered item | ||
<ul> | ||
<li>An item on a third level</li> | ||
<li> | ||
A second item on a 3rd level | ||
<ul> | ||
<li>An item on a 4th level</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</li> | ||
</ol> | ||
`} | ||
/> | ||
)} | ||
|
||
<GoABlock gap="xs" direction="column" mt="2xl" mb="3xl"> | ||
<a href="#unordered-list">Unordered list</a> | ||
</GoABlock> | ||
|
||
<h3 id="unordered-list">Unordered list</h3> | ||
<GoAContainer> | ||
<ul className="goa-unordered-list"> | ||
<li>Milk</li> | ||
<li> | ||
Cheese | ||
<ul className="goa-unordered-list"> | ||
<li>Blue cheese</li> | ||
<li>Feta</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
</GoAContainer> | ||
|
||
{language === "react" && ( | ||
<CodeSnippet | ||
lang="typescript" | ||
tags="react" | ||
allowCopy={true} | ||
code={` | ||
<ul className="goa-unordered-list"> | ||
<li>Milk</li> | ||
<li> | ||
Cheese | ||
<ul className="goa-unordered-list"> | ||
<li>Blue cheese</li> | ||
<li>Feta</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
`} | ||
/> | ||
)} | ||
|
||
{language === "angular" && ( | ||
<CodeSnippet | ||
lang="typescript" | ||
tags="angular" | ||
allowCopy={true} | ||
code={` | ||
<ul class="goa-unordered-list"> | ||
<li>Milk</li> | ||
<li> | ||
Cheese | ||
<ul class="goa-unordered-list"> | ||
<li>Blue cheese</li> | ||
<li>Feta</li> | ||
</ul> | ||
</li> | ||
</ul> | ||
`} | ||
/> | ||
)} | ||
</GoATab> | ||
|
||
<GoATab | ||
heading={ | ||
<> | ||
Design guidelines | ||
<GoABadge type="information" content="In progress" /> | ||
</> | ||
}> | ||
<p>Coming Soon</p> | ||
</GoATab> | ||
</GoATabs> | ||
</> | ||
); | ||
} |