format src

This commit is contained in:
Sacha Weatherstone 2024-01-06 11:04:40 +10:00
parent 06e094c8f5
commit c9e67a8ec9
No known key found for this signature in database
10 changed files with 48 additions and 54 deletions

View file

@ -1,5 +1,4 @@
// class .markdown needs to be called or it is removed from the build // class .markdown needs to be called or it is removed from the build
import React from "react";
const BaseCSS = () => { const BaseCSS = () => {
return <div className="markdown">Shid Fard</div>; return <div className="markdown">Shid Fard</div>;

View file

@ -340,11 +340,11 @@ export const FrequencyCalculator = (): JSX.Element => {
<div className="flex gap-2"> <div className="flex gap-2">
<label className="font-semibold">Number of channels:</label> <label className="font-semibold">Number of channels:</label>
<input type="number" disabled value={numChannels} /> <input type="number" disabled={true} value={numChannels} />
</div> </div>
<div className="flex gap-2"> <div className="flex gap-2">
<label className="font-semibold">Channel Frequency:</label> <label className="font-semibold">Channel Frequency:</label>
<input type="number" disabled value={channelFrequency} /> <input type="number" disabled={true} value={channelFrequency} />
</div> </div>
</div> </div>
); );

View file

@ -1,6 +1,5 @@
import Link from "@docusaurus/Link"; import Link from "@docusaurus/Link";
import Layout from "@theme/Layout"; import Layout from "@theme/Layout";
import React from "react";
const Credits = (): JSX.Element => { const Credits = (): JSX.Element => {
return ( return (

View file

@ -1,5 +1,3 @@
import React from "react";
import { DeviceFirmwareResource } from "../../../utils/apiTypes"; import { DeviceFirmwareResource } from "../../../utils/apiTypes";
export interface releaseCardProps { export interface releaseCardProps {
@ -49,7 +47,7 @@ export const FirmwareCard = ({
) : ( ) : (
<button <button
type="button" type="button"
disabled disabled={true}
className="button button--secondary button--block" className="button button--secondary button--block"
> >
Loading... Loading...

View file

@ -1,7 +1,5 @@
import React from "react";
import { FaAndroid, FaApple } from "react-icons/fa"; import { FaAndroid, FaApple } from "react-icons/fa";
import useSWR from "swr"; import useSwr from "swr";
import { import {
ArrowTopRightOnSquareIcon, ArrowTopRightOnSquareIcon,
@ -20,7 +18,7 @@ import {
} from "./_components/FirmwareCard"; } from "./_components/FirmwareCard";
const Firmware = (): JSX.Element => { const Firmware = (): JSX.Element => {
const { data, error } = useSWR<FirmwareReleases>( const { data, error } = useSwr<FirmwareReleases>(
"https://api.meshtastic.org/github/firmware/list", "https://api.meshtastic.org/github/firmware/list",
fetcher, fetcher,
); );
@ -64,7 +62,8 @@ const Firmware = (): JSX.Element => {
</div> </div>
<div className="card__body"> <div className="card__body">
<p> <p>
Devices such as T-Echo, RAK4631, and RAK11300 are flashed via filesystem. Devices such as T-Echo, RAK4631, and RAK11300 are flashed via
filesystem.
</p> </p>
</div> </div>
<div className="card__footer mt-auto"> <div className="card__footer mt-auto">

View file

@ -1,5 +1,3 @@
import React from "react";
import Head from "@docusaurus/Head"; import Head from "@docusaurus/Head";
import Link from "@docusaurus/Link"; import Link from "@docusaurus/Link";
import useBaseUrl from "@docusaurus/useBaseUrl"; import useBaseUrl from "@docusaurus/useBaseUrl";

View file

@ -1,4 +1,4 @@
import React, { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { fromByteArray, toByteArray } from "base64-js"; import { fromByteArray, toByteArray } from "base64-js";

View file

@ -1,35 +1,37 @@
import React from 'react'; import Translate from "@docusaurus/Translate";
import clsx from 'clsx'; import Heading from "@theme/Heading";
import Translate from '@docusaurus/Translate'; import clsx from "clsx";
import Heading from '@theme/Heading'; export default function NotFoundContent({ className }) {
export default function NotFoundContent({className}) {
return ( return (
<main className={clsx('container margin-vert--xl', className)}> <main className={clsx("container margin-vert--xl", className)}>
<div className="row"> <div className="row">
<div className="col col--6 col--offset-3"> <div className="col col--6 col--offset-3">
<Heading as="h1" className="hero__title"> <Heading as="h1" className="hero__title">
<Translate <Translate
id="theme.NotFound.title" id="theme.NotFound.title"
description="The title of the 404 page"> description="The title of the 404 page"
>
Page Not Found Page Not Found
</Translate> </Translate>
</Heading> </Heading>
<p> <p>
<Translate <Translate
id="theme.NotFound.p1" id="theme.NotFound.p1"
description="The first paragraph of the 404 page"> description="The first paragraph of the 404 page"
>
We could not find what you were looking for. We could not find what you were looking for.
</Translate> </Translate>
</p> </p>
<p> <p>
<Translate <Translate
id="theme.NotFound.p2" id="theme.NotFound.p2"
description="The 2nd paragraph of the 404 page"> description="The 2nd paragraph of the 404 page"
>
Please contact the owner of the site that linked you to the Please contact the owner of the site that linked you to the
original URL and let them know their link is broken. original URL and let them know their link is broken.
</Translate> </Translate>
</p> </p>
<img src="/design/chirpy.png" alt='Chirpy' /> <img src="/design/chirpy.png" alt="Chirpy" />
</div> </div>
</div> </div>
</main> </main>

View file

@ -1,12 +1,11 @@
import React from 'react'; import { translate } from "@docusaurus/Translate";
import {translate} from '@docusaurus/Translate'; import { PageMetadata } from "@docusaurus/theme-common";
import {PageMetadata} from '@docusaurus/theme-common'; import Layout from "@theme/Layout";
import Layout from '@theme/Layout'; import NotFoundContent from "@theme/NotFound/Content";
import NotFoundContent from '@theme/NotFound/Content';
export default function Index() { export default function Index() {
const title = translate({ const title = translate({
id: 'theme.NotFound.title', id: "theme.NotFound.title",
message: 'Page Not Found', message: "Page Not Found",
}); });
return ( return (
<> <>

View file

@ -1,8 +1,8 @@
export default function calculateADC() { export default function calculateADC() {
//const variables //const variables
const BAT_MILLIVOLTS_FULL = 4.2; const batMillivoltsFull = 4.2;
const BAT_MILLIVOLTS_EMPTY = 3.27; const batMillivoltsEmpty = 3.27;
const BAT_FULL_PERCENT = 1; const batFullPercent = 1;
//variable //variable
const batteryChargePercent = const batteryChargePercent =
parseFloat( parseFloat(
@ -13,10 +13,10 @@ export default function calculateADC() {
); );
const result = const result =
(operativeAdcMultiplier * (operativeAdcMultiplier *
((BAT_FULL_PERCENT - 1) * BAT_MILLIVOLTS_EMPTY - ((batFullPercent - 1) * batMillivoltsEmpty -
BAT_FULL_PERCENT * BAT_MILLIVOLTS_FULL)) / batFullPercent * batMillivoltsFull)) /
((batteryChargePercent - 1) * BAT_MILLIVOLTS_EMPTY - ((batteryChargePercent - 1) * batMillivoltsEmpty -
batteryChargePercent * BAT_MILLIVOLTS_FULL); batteryChargePercent * batMillivoltsFull);
(<HTMLInputElement>( (<HTMLInputElement>(
document.getElementById("newOperativeAdcMultiplier") document.getElementById("newOperativeAdcMultiplier")
)).value = result.toFixed(4); )).value = result.toFixed(4);