-
Notifications
You must be signed in to change notification settings - Fork 1
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 #17 from bigcommerce/feature/advanced-filters
feat(pattern): optimize filter samples code
- Loading branch information
Showing
17 changed files
with
1,220 additions
and
2,011 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
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,59 @@ | ||
import React, { FunctionComponent } from "react"; | ||
import { Flex, FlexItem, Panel } from "@bigcommerce/big-design"; | ||
import { Header, Page } from "@bigcommerce/big-design-patterns"; | ||
import { useNavigate } from "react-router"; | ||
import { theme } from "@bigcommerce/big-design-theme"; | ||
|
||
/** | ||
* PageList component - Displays a page with a list of items in a table. | ||
*/ | ||
|
||
export interface ProductPageProps { | ||
headerTitle: string; | ||
headerDescription: string; | ||
filters: React.ReactNode; | ||
products: React.ReactNode; | ||
} | ||
|
||
const ProductsPage: FunctionComponent<ProductPageProps> = ({ | ||
headerTitle, | ||
headerDescription, | ||
filters, | ||
products, | ||
}) => { | ||
// NAVIGATION | ||
const navigate = useNavigate(); | ||
|
||
return ( | ||
<> | ||
<Page | ||
header={ | ||
<Header | ||
description={headerDescription} | ||
title={headerTitle} | ||
backLink={{ | ||
text: "Back to patterns", | ||
onClick: () => navigate("/"), | ||
href: "#", | ||
}} | ||
/> | ||
} | ||
> | ||
<Flex flexDirection="column" flexGap={theme.spacing.xLarge}> | ||
<FlexItem> | ||
{ | ||
//The most common way of organizing information within the BigDesign patterns is with the use of panels. | ||
//In this case we only have one panel, but you can have multiple panels within a page. | ||
} | ||
<Panel header="Items list"> | ||
{filters} | ||
{products} | ||
</Panel> | ||
</FlexItem> | ||
</Flex> | ||
</Page> | ||
</> | ||
); | ||
}; | ||
|
||
export default ProductsPage; |
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
Oops, something went wrong.