From 653d2bc6db56b7ddd00186cc191fe6320121b6ff Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 23 Mar 2024 00:40:26 +0000 Subject: [PATCH] Built new View All page --- web/src/components/form/FontAwesome.svelte | 5 + web/src/components/things/ServiceCard.astro | 187 ++++++++++++++++++++ web/src/pages/all.astro | 149 +++++++++++----- web/src/pages/api/line-numbers.json.ts | 6 +- web/src/pages/browse.astro | 2 +- 5 files changed, 300 insertions(+), 49 deletions(-) create mode 100644 web/src/components/things/ServiceCard.astro diff --git a/web/src/components/form/FontAwesome.svelte b/web/src/components/form/FontAwesome.svelte index 9344883..4d31895 100644 --- a/web/src/components/form/FontAwesome.svelte +++ b/web/src/components/form/FontAwesome.svelte @@ -70,6 +70,11 @@ email: solidIcons.faEnvelope, copy: solidIcons.faCopy, print: solidIcons.faPrint, + + // Service link types + website: solidIcons.faGlobe, + sourceCode: solidIcons.faCodeBranch, + viewReport: solidIcons.faShieldHalved, }; export let iconName: string; diff --git a/web/src/components/things/ServiceCard.astro b/web/src/components/things/ServiceCard.astro new file mode 100644 index 0000000..97645d6 --- /dev/null +++ b/web/src/components/things/ServiceCard.astro @@ -0,0 +1,187 @@ +--- + +import Button from '@components/form/Button.astro'; +import { parseMarkdown, formatLink } from '@utils/parse-markdown'; +import type { Service } from 'src/types/Service'; +import FontAwesome from '@components/form/FontAwesome.svelte'; +import DeleteListing from '@components/things/DeleteListing.svelte'; +import { slugify } from '@utils/fetch-data'; + +import GitHubMetrics from '@components/things/ItemGitHubMetrics.astro'; + +interface Props { + service: Service; + categoryName: string; + sectionName: string; +} + +const { + service, + sectionName, + categoryName, +} = Astro.props; + +--- + + + + + +
+ +
+ +

{service.name}

+
+ {service.followWith && } +
+ +
+ {`${service.name} +
+

+
+
+ + +
+ + + diff --git a/web/src/pages/all.astro b/web/src/pages/all.astro index 8ec79d0..6afdf60 100644 --- a/web/src/pages/all.astro +++ b/web/src/pages/all.astro @@ -2,8 +2,8 @@ import Layout from '@layouts/Layout.astro'; -import ServiceList from '@components/things/ServiceList.astro'; -import type { AwesomePrivacy, Section } from '../types/Service'; +import ServiceCard from '@components/things/ServiceCard.astro'; +import type { AwesomePrivacy, Section, Service } from '../types/Service'; import { fetchData, slugify } from '@utils/fetch-data'; import FontAwesome from '@components/form/FontAwesome.svelte'; @@ -14,10 +14,10 @@ const categories = (await fetchData() as AwesomePrivacy)?.categories || [];