kopia lustrzana https://github.com/bugout-dev/moonstream
better wrapping
rodzic
46b1dda151
commit
93a57e6d17
|
@ -165,9 +165,16 @@ const Analytics = () => {
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
minH="100vh"
|
minH="100vh"
|
||||||
>
|
>
|
||||||
<Stack direction="row" w="100%" placeItems="center">
|
<Stack direction={["column", "row", null]} w="100%" placeItems="center">
|
||||||
<Heading as="h1" py={2} fontSize={["md", "xl"]}>
|
<Heading as="h1" py={2} fontSize={["md", "xl"]}>
|
||||||
{dashboardCache.data.data.resource_data.name}
|
{dashboardCache.data.data.resource_data.name}
|
||||||
|
<IconButton
|
||||||
|
icon={<BiTrash />}
|
||||||
|
variant="ghost"
|
||||||
|
colorScheme="red"
|
||||||
|
size="sm"
|
||||||
|
onClick={() => toggleAlert(() => deleteDashboard.mutate())}
|
||||||
|
/>
|
||||||
</Heading>
|
</Heading>
|
||||||
<Spacer />
|
<Spacer />
|
||||||
<RangeSelector
|
<RangeSelector
|
||||||
|
@ -178,13 +185,6 @@ const Analytics = () => {
|
||||||
setTimeRange(timeMap[e]);
|
setTimeRange(timeMap[e]);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<IconButton
|
|
||||||
icon={<BiTrash />}
|
|
||||||
variant="ghost"
|
|
||||||
colorScheme="red"
|
|
||||||
size="sm"
|
|
||||||
onClick={() => toggleAlert(() => deleteDashboard.mutate())}
|
|
||||||
/>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
|
|
||||||
<Flex w="100%" direction="row" flexWrap="wrap-reverse" id="container">
|
<Flex w="100%" direction="row" flexWrap="wrap-reverse" id="container">
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { usePresignedURL } from "../core/hooks";
|
import { usePresignedURL } from "../core/hooks";
|
||||||
import Report from "./Report";
|
import Report from "./Report";
|
||||||
import { Spinner, Flex, Heading, Text, Stack } from "@chakra-ui/react";
|
import { Spinner, Flex, Heading, Text } from "@chakra-ui/react";
|
||||||
import { v4 } from "uuid";
|
import { v4 } from "uuid";
|
||||||
|
|
||||||
const HOUR_KEY = "Hourly";
|
const HOUR_KEY = "Hourly";
|
||||||
|
@ -30,31 +30,34 @@ const SubscriptionReport = ({ timeRange, url, id, type, refetchLinks }) => {
|
||||||
flexBasis={plotMinW}
|
flexBasis={plotMinW}
|
||||||
direction="column"
|
direction="column"
|
||||||
>
|
>
|
||||||
<Stack
|
<Flex
|
||||||
bgColor="blue.50"
|
bgColor="blue.50"
|
||||||
direction={["column", "row", null]}
|
direction={["column", "row", null]}
|
||||||
spacing={4}
|
flexWrap="wrap"
|
||||||
flexGrow={1}
|
alignContent={["inherit", "flex-start", null]}
|
||||||
flexBasis={plotMinW}
|
|
||||||
m={1}
|
|
||||||
p={2}
|
|
||||||
>
|
>
|
||||||
{data?.web3_metric.map((metric) => {
|
{data?.web3_metric.map((metric) => {
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
flexGrow={1}
|
flexGrow={1}
|
||||||
flexBasis="75px"
|
flexBasis="100px"
|
||||||
placeSelf="center"
|
placeSelf="center"
|
||||||
p={2}
|
p={2}
|
||||||
|
m={1}
|
||||||
bgColor="blue.100"
|
bgColor="blue.100"
|
||||||
key={v4()}
|
key={v4()}
|
||||||
size="sm"
|
size="sm"
|
||||||
fontWeight="600"
|
fontWeight="600"
|
||||||
boxShadow="sm"
|
boxShadow="sm"
|
||||||
direction="column"
|
direction="column"
|
||||||
|
alignSelf="stretch"
|
||||||
>
|
>
|
||||||
<Text placeSelf="center">{metric.display_name}</Text>
|
<Text placeSelf="center">{metric.display_name}</Text>
|
||||||
<Text p={2} fontSize="42px" placeSelf="center">
|
<Text
|
||||||
|
p={2}
|
||||||
|
fontSize={["24px", "24px", "42px", null]}
|
||||||
|
placeSelf="center"
|
||||||
|
>
|
||||||
{metric.display_name == "Total weth earned"
|
{metric.display_name == "Total weth earned"
|
||||||
? Number.parseFloat(
|
? Number.parseFloat(
|
||||||
Number.parseFloat(metric.value) / 1e18
|
Number.parseFloat(metric.value) / 1e18
|
||||||
|
@ -64,7 +67,7 @@ const SubscriptionReport = ({ timeRange, url, id, type, refetchLinks }) => {
|
||||||
</Flex>
|
</Flex>
|
||||||
);
|
);
|
||||||
})}
|
})}
|
||||||
</Stack>
|
</Flex>
|
||||||
{data?.events && Object.keys(data?.events) && (
|
{data?.events && Object.keys(data?.events) && (
|
||||||
<Flex
|
<Flex
|
||||||
w="100%"
|
w="100%"
|
||||||
|
@ -73,7 +76,9 @@ const SubscriptionReport = ({ timeRange, url, id, type, refetchLinks }) => {
|
||||||
flexBasis={plotMinW}
|
flexBasis={plotMinW}
|
||||||
direction="column"
|
direction="column"
|
||||||
>
|
>
|
||||||
<Heading size="sm">Events</Heading>
|
<Heading size="md" pt={4}>
|
||||||
|
Events
|
||||||
|
</Heading>
|
||||||
{Object.keys(data.events).map((key) => {
|
{Object.keys(data.events).map((key) => {
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
|
@ -114,7 +119,9 @@ const SubscriptionReport = ({ timeRange, url, id, type, refetchLinks }) => {
|
||||||
flexBasis="420px"
|
flexBasis="420px"
|
||||||
direction="column"
|
direction="column"
|
||||||
>
|
>
|
||||||
<Heading size="sm">functions</Heading>
|
<Heading size="md" pt={4}>
|
||||||
|
functions
|
||||||
|
</Heading>
|
||||||
{Object.keys(data.functions).map((key) => {
|
{Object.keys(data.functions).map((key) => {
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
|
@ -155,7 +162,9 @@ const SubscriptionReport = ({ timeRange, url, id, type, refetchLinks }) => {
|
||||||
flexBasis="420px"
|
flexBasis="420px"
|
||||||
direction="column"
|
direction="column"
|
||||||
>
|
>
|
||||||
<Heading size="sm">Account generic</Heading>
|
<Heading size="md" pt={4}>
|
||||||
|
Account generic
|
||||||
|
</Heading>
|
||||||
{Object.keys(data.generic).map((key) => {
|
{Object.keys(data.generic).map((key) => {
|
||||||
return (
|
return (
|
||||||
<Flex
|
<Flex
|
||||||
|
|
Ładowanie…
Reference in New Issue