Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lil5 committed Jul 5, 2024
1 parent 3ef6068 commit d8d3e52
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 30 deletions.
21 changes: 8 additions & 13 deletions app/src/components/RouteMap/RouteMapPopup.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Chain, UID } from "../../api/types";
import { RefObject, useContext, useRef, useState } from "react";
import { RefObject, useContext, useState } from "react";
import RouteMap from "./RouteMap";
import { useTranslation } from "react-i18next";
import {
Expand Down Expand Up @@ -55,21 +55,16 @@ export default function RouteMapPopup(props: {
</IonToolbar>
</IonHeader>
{props.isChainAdmin ? (
<IonItem
lines="full"
detail={false}
button
onClick={onToggleAllowMap}
>
<IonItem lines="full" detail={false} button onClick={onToggleAllowMap}>
<IonLabel className="ion-text-wrap">
<h3>{t("allowMapTitle")}</h3>
<p>
{t(
"allowMapBody",
)}
</p>
<p>{t("allowMapBody")}</p>
</IonLabel>
<IonToggle aria-label={t("allowMapTitle")} slot="end" checked={props.chain.allow_map || false} />
<IonToggle
aria-label={t("allowMapTitle")}
slot="end"
checked={props.chain.allow_map || false}
/>
</IonItem>
) : null}
<IonContent>
Expand Down
27 changes: 13 additions & 14 deletions frontend/src/components/react/components/RouteMap/RouteMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -261,18 +261,17 @@ interface SortedCoordinate extends RouteCoordinate {
route_index: number;
}

function getSortedCoordinates(chainUID: UID, route: UID[]) {
return routeCoordinates(chainUID).then((res) => {
const sortedCoords: SortedCoordinate[] = [];
for (let i = 0; i < route.length; i++) {
const user_uid = route[i];
const coord = res.data.find((c) => c.user_uid === user_uid);
if (!coord) continue;
sortedCoords.push({
...coord,
route_index: i,
});
}
return sortedCoords;
});
async function getSortedCoordinates(chainUID: UID, route: UID[]) {
const res = await routeCoordinates(chainUID);
const sortedCoords: SortedCoordinate[] = [];
for (let i = 0; i < route.length; i++) {
const user_uid = route[i];
const coord = res.data.find((c) => c.user_uid === user_uid);
if (!coord) continue;
sortedCoords.push({
...coord,
route_index: i,
});
}
return sortedCoords;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Chain, UID, User } from "../../../../api/types";
import type { Chain, UID } from "../../../../api/types";
import { useRef, type MouseEvent, useState } from "react";
import RouteMap from "./RouteMap";
import { useTranslation } from "react-i18next";
Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/react/pages/ChainMemberList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ export default function ChainMemberList() {
const [error, setError] = useState("");
const [selectedTable, setSelectedTable] = useState<SelectedTable>("route");
const addCopyAttributes = useToClipboard();
const refQrCode = useRef<HTMLCanvasElement>(null);
const refQrCodeDialog = useRef<HTMLDialogElement>(null);
const [openQrCode, setOpenQrCode] = useState(false);

Expand Down
1 change: 0 additions & 1 deletion frontend/src/components/react/pages/FindChain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
circleRadiusKm,
useMapZoom,
} from "../util/maps";
import { Categories, Sizes } from "../../../api/enums";
import { addToastError } from "../../../stores/toast";
import { useStore } from "@nanostores/react";
import { $chains } from "../../../stores/chains";
Expand Down

0 comments on commit d8d3e52

Please sign in to comment.