From cea6cd9186c40e3b00d7834c8e4d004cc4f6fc3f Mon Sep 17 00:00:00 2001 From: deme Date: Fri, 21 Apr 2023 14:55:19 -0300 Subject: [PATCH] Revert "[website,#778][s]: remove components page and references to it" This reverts commit ee38b125bfcf9d6eb7787e4debc3b9517dc66863. --- README.md | 1 + site/content/config.js | 2 +- site/content/docs/components.md | 589 ++++++++++++++++++++++++++++++++ site/content/docs/index.md | 5 + 4 files changed, 596 insertions(+), 1 deletion(-) create mode 100644 site/content/docs/components.md diff --git a/README.md b/README.md index b40659ac..8e95ba41 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ Access the Portal.JS documentation at: https://portaljs.org/docs +- [Components](https://portaljs.org/docs/components) - [Examples](https://portaljs.org/docs#examples) # Community diff --git a/site/content/config.js b/site/content/config.js index cae55547..09ab5486 100644 --- a/site/content/config.js +++ b/site/content/config.js @@ -17,7 +17,7 @@ const config = { }, navLinks: [ { name: "Docs", href: "/docs" }, - // { name: "Components", href: "/docs/components" }, + { name: "Components", href: "/docs/components" }, { name: "Blog", href: "/blog" }, // { name: "Gallery", href: "/gallery" }, // { name: "Data Literate", href: "/data-literate" }, diff --git a/site/content/docs/components.md b/site/content/docs/components.md new file mode 100644 index 00000000..ba142e7a --- /dev/null +++ b/site/content/docs/components.md @@ -0,0 +1,589 @@ +# Components Reference + +Portal.js supports many components that can help you build amazing data portals similar to [this](https://catalog-portal-js.vercel.app/) and [this](https://portal-js.vercel.app/). + +In this section, we'll cover all supported components in depth, and help you understand their use as well as the expected properties. + +Components are grouped under the following sections: +* [UI](https://github.com/datopian/portal.js/tree/main/src/components/ui): Components like Nav bar, Footer, e.t.c +* [Dataset](https://github.com/datopian/portal.js/tree/main/src/components/dataset): Components used for displaying a Frictionless dataset and resources +* [Search](https://github.com/datopian/portal.js/tree/main/src/components/search): Components used for building a search interface for datasets +* [Blog](https://github.com/datopian/portal.js/tree/main/src/components/blog): Components for building a simple blog for datasets +* [Views](https://github.com/datopian/portal.js/tree/main/src/components/views): Components like charts, tables, maps for generating data views +* [Misc](https://github.com/datopian/portal.js/tree/main/src/components/misc): Miscellaneos components like errors, custom links, etc used for extra design. + +### UI Components + +In the UI we group all components that can be used for building generic page sections. These are components for building sections like the Navigation bar, Footer, Side pane, Recent datasets, e.t.c. + +#### [Nav Component](https://github.com/datopian/portal.js/blob/main/src/components/ui/Nav.js) + +To build a navigation bar, you can use the `Nav` component as demonstrated below: + +```javascript +import { Nav } from 'portal' + +export default function Home(){ + + const navMenu = [{ title: 'Blog', path: '/blog' }, + { title: 'Search', path: '/search' }] + + return ( + <> +