Commit 14b1bd8f authored by tom's avatar tom

fixes for safari

parent e119c4d4
...@@ -25,7 +25,7 @@ const AddressCoinBalanceChart = ({ addressHash }: Props) => { ...@@ -25,7 +25,7 @@ const AddressCoinBalanceChart = ({ addressHash }: Props) => {
title="Balances" title="Balances"
items={ items } items={ items }
isLoading={ isLoading } isLoading={ isLoading }
chartHeight="250px" h="250px"
/> />
); );
}; };
......
import { import {
Box, Box,
Center, Center,
chakra,
Flex, Flex,
Grid, Grid,
Icon, Icon,
...@@ -37,13 +38,13 @@ type Props = { ...@@ -37,13 +38,13 @@ type Props = {
title: string; title: string;
description?: string; description?: string;
isLoading: boolean; isLoading: boolean;
chartHeight?: string; className?: string;
isError: boolean; isError: boolean;
} }
const DOWNLOAD_IMAGE_SCALE = 5; const DOWNLOAD_IMAGE_SCALE = 5;
const ChartWidget = ({ items, title, description, isLoading, chartHeight, isError }: Props) => { const ChartWidget = ({ items, title, description, isLoading, className, isError }: Props) => {
const ref = useRef<HTMLDivElement>(null); const ref = useRef<HTMLDivElement>(null);
const [ isFullscreen, setIsFullscreen ] = useState(false); const [ isFullscreen, setIsFullscreen ] = useState(false);
const [ isZoomResetInitial, setIsZoomResetInitial ] = React.useState(true); const [ isZoomResetInitial, setIsZoomResetInitial ] = React.useState(true);
...@@ -144,7 +145,7 @@ const ChartWidget = ({ items, title, description, isLoading, chartHeight, isErro ...@@ -144,7 +145,7 @@ const ChartWidget = ({ items, title, description, isLoading, chartHeight, isErro
} }
return ( return (
<Box h={ chartHeight || 'auto' } maxW="100%"> <Box h="100%" maxW="100%">
<ChartWidgetGraph <ChartWidgetGraph
items={ items } items={ items }
onZoom={ handleZoom } onZoom={ handleZoom }
...@@ -158,7 +159,7 @@ const ChartWidget = ({ items, title, description, isLoading, chartHeight, isErro ...@@ -158,7 +159,7 @@ const ChartWidget = ({ items, title, description, isLoading, chartHeight, isErro
return ( return (
<> <>
<Box <Box
height={ chartHeight } height="100%"
display="flex" display="flex"
flexDirection="column" flexDirection="column"
ref={ ref } ref={ ref }
...@@ -166,6 +167,7 @@ const ChartWidget = ({ items, title, description, isLoading, chartHeight, isErro ...@@ -166,6 +167,7 @@ const ChartWidget = ({ items, title, description, isLoading, chartHeight, isErro
borderRadius="md" borderRadius="md"
border="1px" border="1px"
borderColor={ borderColor } borderColor={ borderColor }
className={ className }
> >
<Grid <Grid
gridTemplateColumns="auto auto 36px" gridTemplateColumns="auto auto 36px"
...@@ -276,4 +278,4 @@ const ChartWidget = ({ items, title, description, isLoading, chartHeight, isErro ...@@ -276,4 +278,4 @@ const ChartWidget = ({ items, title, description, isLoading, chartHeight, isErro
); );
}; };
export default React.memo(ChartWidget); export default React.memo(chakra(ChartWidget));
...@@ -3,10 +3,9 @@ import React from 'react'; ...@@ -3,10 +3,9 @@ import React from 'react';
interface Props { interface Props {
hasDescription: boolean; hasDescription: boolean;
chartHeight?: string;
} }
const ChartWidgetSkeleton = ({ hasDescription, chartHeight }: Props) => { const ChartWidgetSkeleton = ({ hasDescription }: Props) => {
return ( return (
<Box <Box
height="235px" height="235px"
...@@ -15,7 +14,7 @@ const ChartWidgetSkeleton = ({ hasDescription, chartHeight }: Props) => { ...@@ -15,7 +14,7 @@ const ChartWidgetSkeleton = ({ hasDescription, chartHeight }: Props) => {
<Skeleton w="75%" h="24px"/> <Skeleton w="75%" h="24px"/>
{ hasDescription && <Skeleton w="50%" h="18px" mt={ 1 }/> } { hasDescription && <Skeleton w="50%" h="18px" mt={ 1 }/> }
<Skeleton w="100%" h={ chartHeight || '150px' } mt={ 5 }/> <Skeleton w="100%" h="150px" mt={ 5 }/>
</Box> </Box>
); );
}; };
......
...@@ -45,7 +45,6 @@ const ChartWidgetContainer = ({ id, title, description, interval, onLoadingError ...@@ -45,7 +45,6 @@ const ChartWidgetContainer = ({ id, title, description, interval, onLoadingError
return ( return (
<ChartWidget <ChartWidget
chartHeight="100%"
isError={ isError } isError={ isError }
items={ items } items={ items }
title={ title } title={ title }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment