From ba3bf2bb36f518a45d2ceb3203e06cf34fc9de40 Mon Sep 17 00:00:00 2001 From: Foster Irwin Date: Thu, 3 Feb 2022 16:24:25 -0700 Subject: [PATCH] added cards --- .../downloads/_components/DownloadCard.tsx | 145 ++++++++++++++++++ src/pages/downloads/index.tsx | 40 ++++- 2 files changed, 184 insertions(+), 1 deletion(-) create mode 100644 src/pages/downloads/_components/DownloadCard.tsx diff --git a/src/pages/downloads/_components/DownloadCard.tsx b/src/pages/downloads/_components/DownloadCard.tsx new file mode 100644 index 00000000..da981822 --- /dev/null +++ b/src/pages/downloads/_components/DownloadCard.tsx @@ -0,0 +1,145 @@ +import React from 'react'; + +export interface releaseCardProps { + client: string; + imgUrl: string; + url: string; + notes: string; + buttonText: string; +} + +export const DownloadCard = ({ + client, + imgUrl, + url, + notes, + buttonText, +}: releaseCardProps): JSX.Element => { + + const button = React.createElement( + 'a', + {href: url, className: "button button--secondary button--block"}, + buttonText + ) + const img = React.createElement( + 'img', + {style: {height: '4rem'}, src: imgUrl, href: url}, + null + ) + + const anchorImg = {buttonText ? null : img} + + return ( +
+
+

{client}

+
+
+ {buttonText ? button : anchorImg} +
+
+ {notes ? notes : null} +
+
+ ); +}; + +export const PlaceholderFirmwareCard = (): JSX.Element => { + return ( +
+
+
+
+
+
+   +
+
+
+
+
+
+ ); +}; diff --git a/src/pages/downloads/index.tsx b/src/pages/downloads/index.tsx index 4c4e3e4f..52e69cf6 100644 --- a/src/pages/downloads/index.tsx +++ b/src/pages/downloads/index.tsx @@ -4,6 +4,7 @@ import useSWR from 'swr'; // import { Endpoints } from '@octokit/types'; import Layout from '@theme/Layout'; +import CodeBlock from '@theme/CodeBlock'; import { Release } from '../../utils/github'; import { fetcher } from '../../utils/swr'; @@ -12,6 +13,7 @@ import { PlaceholderFirmwareCard, } from './_components/FirmwareCard'; import { HeaderText } from './_components/HeaderText' +import { DownloadCard } from './_components/DownloadCard' const Firmware = (): JSX.Element => { const { data, error } = useSWR( @@ -38,7 +40,21 @@ const Firmware = (): JSX.Element => { + pip, " use the following:", + + {"pip install meshtastic-flasher"} + , + + {"meshtastic-flasher"} + , + ]} />
@@ -47,6 +63,28 @@ const Firmware = (): JSX.Element => { text="Mobile Downloads" link="mobile-downloads" /> +
    + download the latest .apk," from Github", ]} + /> + +