Remove join address pie from frontend

This commit is contained in:
Aurora Lahtela 2024-04-06 10:47:12 +03:00
parent 45d6b1f127
commit 69a3dd96f2
2 changed files with 0 additions and 52 deletions

View File

@ -1,32 +0,0 @@
import React from 'react';
import {useTranslation} from "react-i18next";
import {useDataRequest} from "../../../../hooks/dataFetchHook";
import {fetchJoinAddressPie} from "../../../../service/serverService";
import {ErrorViewCard} from "../../../../views/ErrorView";
import {CardLoader} from "../../../navigation/Loader";
import {Card} from "react-bootstrap";
import {FontAwesomeIcon as Fa} from "@fortawesome/react-fontawesome";
import {faLocationArrow} from "@fortawesome/free-solid-svg-icons";
import GroupVisualizer from "../../../graphs/GroupVisualizer";
const JoinAddressGroupCard = ({identifier}) => {
const {t} = useTranslation();
const {data, loadingError} = useDataRequest(fetchJoinAddressPie, [identifier]);
if (loadingError) return <ErrorViewCard error={loadingError}/>
if (!data) return <CardLoader/>;
return (
<Card id={'join-address-groups'}>
<Card.Header>
<h6 className="col-black" style={{width: '100%'}}>
<Fa icon={faLocationArrow} className="col-amber"/> {t('html.label.latestJoinAddresses')}
</h6>
</Card.Header>
<GroupVisualizer groups={data.slices} colors={data.colors}/>
</Card>
)
};
export default JoinAddressGroupCard

View File

@ -261,26 +261,6 @@ export const fetchPingGraph = async (timestamp, identifier) => {
return doGetRequest(url, timestamp);
}
export const fetchJoinAddressPie = async (timestamp, identifier) => {
if (identifier) {
return await fetchJoinAddressPieServer(timestamp, identifier);
} else {
return await fetchJoinAddressPieNetwork(timestamp);
}
}
const fetchJoinAddressPieServer = async (timestamp, identifier) => {
let url = `/v1/graph?type=joinAddressPie&server=${identifier}`;
if (staticSite) url = `/data/graph-joinAddressPie_${identifier}.json`;
return doGetRequest(url, timestamp);
}
const fetchJoinAddressPieNetwork = async (timestamp) => {
let url = `/v1/graph?type=joinAddressPie`;
if (staticSite) url = `/data/graph-joinAddressPie.json`;
return doGetRequest(url, timestamp);
}
export const fetchJoinAddressByDay = async (timestamp, addresses, identifier) => {
if (identifier) {
return await fetchJoinAddressByDayServer(timestamp, addresses, identifier);