meshtastic/src/pages/downloads/index.tsx

148 lines
5.3 KiB
TypeScript
Raw Normal View History

2021-12-02 18:09:13 -08:00
import React from 'react';
2021-12-07 20:25:21 -08:00
import useSWR from 'swr';
// import { Endpoints } from '@octokit/types';
2021-12-02 18:09:13 -08:00
import Layout from '@theme/Layout';
2021-12-07 20:25:21 -08:00
import { Release } from '../../utils/github';
2021-12-22 06:42:57 -08:00
import { fetcher } from '../../utils/swr';
2021-12-28 01:46:50 -08:00
import {
FirmwareCard,
PlaceholderFirmwareCard,
} from './_components/FirmwareCard';
import { HeaderText } from './_components/HeaderText'
2022-02-03 15:24:25 -08:00
import { DownloadCard } from './_components/DownloadCard'
2021-12-07 03:47:01 -08:00
2021-12-02 18:09:13 -08:00
const Firmware = (): JSX.Element => {
2021-12-07 20:25:21 -08:00
const { data, error } = useSWR<Release[]>(
"https://api.github.com/repos/meshtastic/meshtastic-device/releases",
fetcher
);
2021-12-07 03:47:01 -08:00
2021-12-07 20:25:21 -08:00
const beta = data?.filter((release) => release.prerelease === false);
2021-12-07 03:47:01 -08:00
2021-12-07 20:25:21 -08:00
const alpha = data?.filter((release) => release.prerelease === true);
2021-12-02 18:09:13 -08:00
return (
<Layout
title="Downloads"
description="Downloads for the Meshtastic project"
2021-12-02 18:09:13 -08:00
>
<main className="margin-vert--xl">
<div className="container">
2022-02-03 10:31:46 -08:00
<HeaderText
type="h1"
text="Downloads"
/>
</div>
<div className="container">
2022-02-03 10:31:46 -08:00
<HeaderText
type="h2"
text="Install Meshtastic"
2022-02-03 15:24:25 -08:00
link="install-meshtastic"
/>
<DownloadCard
client="Meshtastic Flasher"
buttonText="Download Meshtastic Flasher"
url="https://github.com/meshtastic/Meshtastic-gui-installer/releases/latest"
notes={[
"To download using ", <code>pip</code>, " follow ",<a href="https://meshtastic.org/docs/getting-started/meshtastic-flasher#install-using-pip">these instructions</a>,"."
2022-02-03 15:24:25 -08:00
]}
2022-02-03 10:31:46 -08:00
/>
</div>
<div className="container">
2022-02-03 10:31:46 -08:00
<HeaderText
type="h2"
text="Mobile Downloads"
link="mobile-downloads"
/>
2022-02-03 15:24:25 -08:00
<ul
style={{
position: "relative",
display: "grid",
gap: "1.5rem",
gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))",
paddingLeft: "0",
}}
>
<DownloadCard
client="Android"
imgUrl="https://play.google.com/intl/en_us/badges/static/images/badges/en_badge_web_generic.png"
url="https://play.google.com/store/apps/details?id=com.geeksville.mesh&referrer=utm_source=downloads-page"
notes={["To sideload, ",<a href="https://github.com/meshtastic/Meshtastic-Android/releases/latest" rel="noreferrer" target="_blank">download the latest .apk</a>," from Github", ]}
/>
<DownloadCard
client="iOS"
url="https://testflight.apple.com/join/c8nNl8q1"
buttonText="Download on TestFlight"
notes="Currently only available in TestFlight"
/>
</ul>
</div>
<div className="container">
2022-02-03 10:31:46 -08:00
<HeaderText
type="h2"
text="Firmware Downloads"
link="firmware-downloads"
/>
2021-12-02 18:09:13 -08:00
<ul
style={{
position: "relative",
display: "grid",
gap: "1.5rem",
gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))",
paddingLeft: "0",
}}
>
2021-12-28 01:46:50 -08:00
{data && !error ? (
<>
<FirmwareCard
variant="Beta"
description="Tested feature set. For those who want stability."
release={beta}
/>
<FirmwareCard
variant="Alpha"
2021-12-30 13:27:55 -08:00
description="Upcoming changes for testing. For those who want new features."
2021-12-28 01:46:50 -08:00
release={alpha}
/>
<div className="card">
<div className="card__header">
<h3>Bleeding</h3>
</div>
<div className="card__body">
<p>
Latest successful CI build. For those who want to break
things.
</p>
</div>
<div className="card__footer" style={{ marginTop: "1rem" }}>
<a
href="https://nightly.link/meshtastic/meshtastic-device/workflows/main/master/built.zip"
className="button button--secondary button--block"
>
Download
</a>
</div>
</div>
</>
) : (
<>
<PlaceholderFirmwareCard />
<PlaceholderFirmwareCard />
<PlaceholderFirmwareCard />
</>
)}
2021-12-02 18:09:13 -08:00
</ul>
2022-02-03 15:36:44 -08:00
Once downloaded, follow the flashing instructions for <a href="https://meshtastic.org/docs/getting-started/flashing-esp32" rel="noreferrer" target="_blank">ESP32 chipsets</a>, <a href="https://meshtastic.org/docs/getting-started/flashing-nrf52" rel="noreferrer" target="_blank">NRF52 chipsets</a>, or the <a href="https://meshtastic.org/docs/getting-started/meshtastic-flasher" rel="noreferrer" target="_blank">GUI instructions for Meshtastic Flasher</a>.
2021-12-02 18:09:13 -08:00
</div>
<div className="container">
<i>Google Play and the Google Play logo are trademarks of Google LLC.</i>
</div>
2021-12-02 18:09:13 -08:00
</main>
</Layout>
);
};
export default Firmware;