From 7002b5669cbcbc4b5a64474304444bee65534d9b Mon Sep 17 00:00:00 2001 From: deme Date: Mon, 24 Apr 2023 15:50:45 -0300 Subject: [PATCH] [#796,site][xl]: add links to docs and source code on gallery items --- site/components/Gallery.tsx | 7 +++ site/components/GalleryItem.tsx | 82 +++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) diff --git a/site/components/Gallery.tsx b/site/components/Gallery.tsx index 17800db1..697494f4 100644 --- a/site/components/Gallery.tsx +++ b/site/components/Gallery.tsx @@ -19,6 +19,7 @@ const items = [ href: 'https://opendata.fcsc.gov.ae/', image: '/images/showcases/uae.png', description: 'Government Open Data Portal', + sourceUrl: 'https://github.com/FCSCOpendata/frontend', }, { title: 'Brazil Open Data', @@ -37,12 +38,18 @@ const items = [ href: 'https://example.portaljs.org/', image: '/images/showcases/example-simple-catalog.png', description: 'Simple data catalog', + sourceUrl: + 'https://github.com/datopian/portaljs/tree/main/examples/simple-example', + docsUrl: '/docs/example-data-catalog', }, { title: 'Example: Portal with CKAN', href: 'https://ckan-example.portaljs.org/', image: '/images/showcases/example-ckan.png', description: 'Simple portal with data coming from CKAN', + sourceUrl: + 'https://github.com/datopian/portaljs/tree/main/examples/ckan-example', + docsUrl: '/docs/example-ckan', }, ]; diff --git a/site/components/GalleryItem.tsx b/site/components/GalleryItem.tsx index 5afc2c6f..12ffe210 100644 --- a/site/components/GalleryItem.tsx +++ b/site/components/GalleryItem.tsx @@ -1,3 +1,65 @@ +const IconBeaker = () => ( + + + +); + +const IconDocs = () => ( + + + +); + +const IconCode = () => ( + + + +); + +const ActionButton = ({ title, Icon, href, className = '' }) => ( + + + +); + export default function GalleryItem({ item }) { return ( {item.title}

{item.description}

+
+ + {item.docsUrl && ( + + )} + {item.sourceUrl && ( + + )} + + {/* Maybe: Blog post */} +