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';
|
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="Firmware"
|
|
|
|
description="Firmware download for the Meshtastic project"
|
|
|
|
>
|
|
|
|
<main className="margin-vert--xl">
|
|
|
|
<div className="container">
|
|
|
|
<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>
|
|
|
|
</div>
|
|
|
|
</main>
|
|
|
|
</Layout>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Firmware;
|