mirror of
https://github.com/RoboSats/robosats.git
synced 2025-09-13 00:56:22 +00:00
Fix charts
This commit is contained in:
@ -46,14 +46,6 @@ const BookPage = (): React.JSX.Element => {
|
||||
const NavButtons = function (): React.JSX.Element {
|
||||
return (
|
||||
<ButtonGroup variant='contained' color='inherit'>
|
||||
<Button
|
||||
color='primary'
|
||||
onClick={() => {
|
||||
navigate('/create');
|
||||
}}
|
||||
>
|
||||
{t('Create')}
|
||||
</Button>
|
||||
{doubleView ? (
|
||||
<></>
|
||||
) : (
|
||||
@ -102,30 +94,30 @@ const BookPage = (): React.JSX.Element => {
|
||||
justifyContent='center'
|
||||
spacing={1}
|
||||
direction='row'
|
||||
style={{ width: `${windowSize.width}em` }}
|
||||
style={{ width: `${windowSize.width}em`, height: `${windowSize.height * 0.875}em` }}
|
||||
>
|
||||
<Grid item>
|
||||
<Grid>
|
||||
<BookTable
|
||||
maxWidth={maxBookTableWidth} // EM units
|
||||
maxHeight={windowSize.height * 0.825 - 5} // EM units
|
||||
maxHeight={windowSize.height * 0.8} // EM units
|
||||
fullWidth={windowSize.width} // EM units
|
||||
fullHeight={windowSize.height} // EM units
|
||||
defaultFullscreen={false}
|
||||
onOrderClicked={onOrderClicked}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item justifyContent='space-between'>
|
||||
<Grid item>
|
||||
<Grid>
|
||||
<Grid item style={{ marginBottom: 10 }}>
|
||||
<DepthChart
|
||||
maxWidth={chartWidthEm} // EM units
|
||||
maxHeight={(windowSize.height * 0.825 - 5) / 2} // EM units
|
||||
maxHeight={(windowSize.height * 0.82) / 2} // EM units
|
||||
onOrderClicked={onOrderClicked}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<MapChart
|
||||
maxWidth={chartWidthEm} // EM units
|
||||
maxHeight={(windowSize.height * 0.825 - 5) / 2} // EM units
|
||||
maxHeight={(windowSize.height * 0.82) / 2} // EM units
|
||||
onOrderClicked={onOrderClicked}
|
||||
/>
|
||||
</Grid>
|
||||
@ -134,13 +126,13 @@ const BookPage = (): React.JSX.Element => {
|
||||
) : view === 'depth' ? (
|
||||
<DepthChart
|
||||
maxWidth={windowSize.width * 0.8} // EM units
|
||||
maxHeight={windowSize.height * 0.825 - 5} // EM units
|
||||
maxHeight={windowSize.height * 0.835} // EM units
|
||||
onOrderClicked={onOrderClicked}
|
||||
/>
|
||||
) : view === 'map' ? (
|
||||
<MapChart
|
||||
maxWidth={windowSize.width * 0.8} // EM units
|
||||
maxHeight={windowSize.height * 0.825 - 5} // EM units
|
||||
maxHeight={windowSize.height * 0.82} // EM units
|
||||
onOrderClicked={onOrderClicked}
|
||||
/>
|
||||
) : (
|
||||
|
||||
@ -295,20 +295,18 @@ const DepthChart: React.FC<DepthChartProps> = ({
|
||||
<CircularProgress />
|
||||
</div>
|
||||
) : (
|
||||
<Grid container style={{ paddingTop: '1em' }}>
|
||||
<Grid container>
|
||||
<Grid
|
||||
container
|
||||
direction='row'
|
||||
justifyContent='space-around'
|
||||
alignItems='flex-start'
|
||||
style={{ position: 'absolute' }}
|
||||
justifyContent='space-between'
|
||||
alignItems='center'
|
||||
style={{ width: '100%' }}
|
||||
>
|
||||
<Grid
|
||||
container
|
||||
justifyContent='flex-start'
|
||||
alignItems='flex-start'
|
||||
style={{ paddingLeft: '1em' }}
|
||||
>
|
||||
<Grid container style={{ paddingLeft: '1em', paddingTop: 3 }}>
|
||||
<b>{t('Chart')}</b>
|
||||
</Grid>
|
||||
<Grid container style={{ paddingLeft: '1em' }}>
|
||||
<Select
|
||||
variant='standard'
|
||||
value={xType}
|
||||
@ -328,8 +326,6 @@ const DepthChart: React.FC<DepthChartProps> = ({
|
||||
</MenuItem>
|
||||
</Select>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container direction='row' justifyContent='center' alignItems='center'>
|
||||
<Grid container justifyContent='center' alignItems='center'>
|
||||
<Grid item>
|
||||
<IconButton
|
||||
@ -359,7 +355,10 @@ const DepthChart: React.FC<DepthChartProps> = ({
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Grid container style={{ height: `${height * 0.8}em`, padding: '1em' }}>
|
||||
<Grid
|
||||
container
|
||||
style={{ height: `${height * 0.825}em`, width: '100%', padding: '1em' }}
|
||||
>
|
||||
<ResponsiveLine
|
||||
data={series}
|
||||
enableArea={true}
|
||||
|
||||
@ -24,7 +24,7 @@ interface MapChartProps {
|
||||
maxHeight: number;
|
||||
fillContainer?: boolean;
|
||||
elevation?: number;
|
||||
onOrderClicked?: (id: number) => void;
|
||||
onOrderClicked?: (id: number, shortAlias: string) => void;
|
||||
}
|
||||
|
||||
const MapChart: React.FC<MapChartProps> = ({
|
||||
@ -90,7 +90,7 @@ const MapChart: React.FC<MapChartProps> = ({
|
||||
display: 'flex',
|
||||
justifyContent: 'center',
|
||||
paddingTop: `${(height - 3) / 2 - 1}em`,
|
||||
height: `${height}em`,
|
||||
height: `${height - 4}em`,
|
||||
}}
|
||||
>
|
||||
<CircularProgress />
|
||||
@ -101,11 +101,12 @@ const MapChart: React.FC<MapChartProps> = ({
|
||||
item
|
||||
style={{
|
||||
height: '3.1em',
|
||||
justifyContent: 'flex-end',
|
||||
justifyContent: 'space-between',
|
||||
display: 'flex',
|
||||
paddingTop: '0.8em',
|
||||
}}
|
||||
>
|
||||
<b style={{ paddingLeft: '1em' }}>{t('Map')}</b>
|
||||
<Tooltip enterTouchDelay={0} placement='top' title={t('Show tiles')}>
|
||||
<div
|
||||
style={{
|
||||
@ -129,7 +130,7 @@ const MapChart: React.FC<MapChartProps> = ({
|
||||
</div>
|
||||
</Tooltip>
|
||||
</Grid>
|
||||
<div style={{ height: `${height - 3.1}em` }}>
|
||||
<div style={{ height: `${height * 0.825}em` }}>
|
||||
<Map
|
||||
useTiles={useTiles}
|
||||
orders={Object.values(federation.book)}
|
||||
|
||||
@ -144,7 +144,7 @@ export interface UseAppStoreType {
|
||||
navbarHeight: number;
|
||||
open: OpenDialogs;
|
||||
setOpen: Dispatch<SetStateAction<OpenDialogs>>;
|
||||
windowSize?: WindowSize;
|
||||
windowSize: WindowSize;
|
||||
acknowledgedWarning: boolean;
|
||||
setAcknowledgedWarning: Dispatch<SetStateAction<boolean>>;
|
||||
clientVersion: {
|
||||
@ -212,8 +212,8 @@ export const AppContextProvider = ({ children }: AppContextProviderProps): React
|
||||
initialAppContext.slideDirection,
|
||||
);
|
||||
const [open, setOpen] = useState<OpenDialogs>(initialAppContext.open);
|
||||
const [windowSize, setWindowSize] = useState<WindowSize>(() =>
|
||||
getWindowSize(theme.typography.fontSize),
|
||||
const [windowSize, setWindowSize] = useState<WindowSize>(
|
||||
() => getWindowSize(theme.typography.fontSize) ?? { width: 0, height: 0 },
|
||||
);
|
||||
const [fav, setFav] = useState<Favorites>(initialAppContext.fav);
|
||||
const [acknowledgedWarning, setAcknowledgedWarning] = useState<boolean>(
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Utilitzant Bitcoin Testnet",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "Gràfic",
|
||||
"Create": "Crear",
|
||||
"List": "Taula",
|
||||
"Map": "Mapa",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "Informació de RoboSats",
|
||||
"client for nerds": "client per nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Crear",
|
||||
"Garage": "Garage",
|
||||
"More": "Més",
|
||||
"Offers": "Ofertes",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Using Testnet Bitcoin",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "Chart",
|
||||
"Create": "Create",
|
||||
"List": "List",
|
||||
"Map": "Map",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "RoboSats information",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Create",
|
||||
"Garage": "Garage",
|
||||
"More": "More",
|
||||
"Offers": "Offers",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Using Testnet Bitcoin",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "Chart",
|
||||
"Create": "Create",
|
||||
"List": "List",
|
||||
"Map": "Map",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "RoboSats information",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Create",
|
||||
"Garage": "Garage",
|
||||
"More": "More",
|
||||
"Offers": "Offers",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Using Testnet Bitcoin",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "Chart",
|
||||
"Create": "Create",
|
||||
"List": "List",
|
||||
"Map": "Map",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "RoboSats information",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Create",
|
||||
"Garage": "Garage",
|
||||
"More": "More",
|
||||
"Offers": "Offers",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Usando Bitcoin Testnet",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "Gráfico",
|
||||
"Create": "Crear",
|
||||
"List": "Tabla",
|
||||
"Map": "Mapa",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "Información RoboSats",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Crear",
|
||||
"Garage": "Garage",
|
||||
"More": "Más",
|
||||
"Offers": "Ofertas",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Using Testnet Bitcoin",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "Grafikoa",
|
||||
"Create": "Create",
|
||||
"List": "List",
|
||||
"Map": "Map",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "RoboSats information",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Create",
|
||||
"Garage": "Garage",
|
||||
"More": "More",
|
||||
"Offers": "Offers",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Utilisation Testnet Bitcoin",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "Graphique",
|
||||
"Create": "Créer",
|
||||
"List": "Lister",
|
||||
"Map": "Map",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "RoboSats information",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Créer",
|
||||
"Garage": "Garage",
|
||||
"More": "Plus",
|
||||
"Offers": "Offres",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Testnet Bitcoin in uso",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "Grafico",
|
||||
"Create": "Crea",
|
||||
"List": "Elenca",
|
||||
"Map": "Map",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "Informazioni su RoboSats",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Crea",
|
||||
"Garage": "Garage",
|
||||
"More": "Altro",
|
||||
"Offers": "Offerte",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Bitcoinテストネットを使用中",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "グラフ",
|
||||
"Create": "作成",
|
||||
"List": "リスト",
|
||||
"Map": "Map",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "RoboSats情報",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "作成",
|
||||
"Garage": "Garage",
|
||||
"More": "詳細",
|
||||
"Offers": "注文書",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Using Testnet Bitcoin",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "Chart",
|
||||
"Create": "Create",
|
||||
"List": "List",
|
||||
"Map": "Map",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "RoboSats information",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Create",
|
||||
"Garage": "Garage",
|
||||
"More": "More",
|
||||
"Offers": "Offers",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Usando Bitcoin Testnet",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "Gráfico",
|
||||
"Create": "Criar",
|
||||
"List": "Lista",
|
||||
"Map": "Mapa",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "Informações do RoboSats",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Criar",
|
||||
"Garage": "Garage",
|
||||
"More": "Mais",
|
||||
"Offers": "Ofertas",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Использование тестнет Биткойна",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "График",
|
||||
"Create": "Создать",
|
||||
"List": "Список",
|
||||
"Map": "Карта",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "Информация о RoboSats",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Создать",
|
||||
"Garage": "Garage",
|
||||
"More": "Больше",
|
||||
"Offers": "Оферы",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Using Testnet Bitcoin",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "Chart",
|
||||
"Create": "Create",
|
||||
"List": "List",
|
||||
"Map": "Map",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "RoboSats information",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Create",
|
||||
"Garage": "Garage",
|
||||
"More": "More",
|
||||
"Offers": "Offers",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Kutumia Testnet Bitcoin",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "Chatu",
|
||||
"Create": "Unda",
|
||||
"List": "Orodha",
|
||||
"Map": "Map",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "Taarifa za RoboSats",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Unda",
|
||||
"Garage": "Garage",
|
||||
"More": "Zaidi",
|
||||
"Offers": "Ofa",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "Using Testnet Bitcoin",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "Chart",
|
||||
"Create": "Create",
|
||||
"List": "List",
|
||||
"Map": "Map",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "RoboSats information",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "Create",
|
||||
"Garage": "Garage",
|
||||
"More": "More",
|
||||
"Offers": "Offers",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "正在使用测试网比特币",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "图表",
|
||||
"Create": "创建",
|
||||
"List": "列表",
|
||||
"Map": "Map",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "RoboSats 信息",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "创建",
|
||||
"Garage": "Garage",
|
||||
"More": "更多",
|
||||
"Offers": "报价",
|
||||
|
||||
@ -3,7 +3,6 @@
|
||||
"Using Testnet Bitcoin": "正在使用測試網比特幣",
|
||||
"#2": "Phrases in basic/BookPage/index.tsx",
|
||||
"Chart": "圖表",
|
||||
"Create": "創建",
|
||||
"List": "列表",
|
||||
"Map": "Map",
|
||||
"#3": "Phrases in basic/MakerPage/index.tsx",
|
||||
@ -15,6 +14,7 @@
|
||||
"RoboSats information": "RoboSats 信息",
|
||||
"client for nerds": "client for nerds",
|
||||
"#5": "Phrases in basic/NavBar/NavBar.tsx",
|
||||
"Create": "創建",
|
||||
"Garage": "Garage",
|
||||
"More": "更多",
|
||||
"Offers": "報價",
|
||||
|
||||
Reference in New Issue
Block a user