Commit 5c942916 authored by Aron Fiechter's avatar Aron Fiechter
Browse files

Add QueryResult on top of Voronoi

parent 6f89cc56
......@@ -4,7 +4,8 @@ import { selectLoading } from './navbar/querySlice';
import LoadingOverlay from 'react-loading-overlay';
import Voronoi from './voronoi/Voronoi';
import Spinner from './spinner/Spinner';
import YearRange from "./yearrange/YearRange";
import YearRange from './yearrange/YearRange';
import QueryResult from './queryResult/QueryResult';
export default function Main() {
const loading = useSelector(selectLoading);
......@@ -21,8 +22,9 @@ export default function Main() {
}),
}}
>
<Voronoi className='mt-sm-2' width={800} height={800} padding={5} />
<YearRange/>
<QueryResult />
<Voronoi width={800} height={800} padding={5} />
<YearRange />
</LoadingOverlay>
);
}
import React from 'react';
import { selectResult } from '../navbar/querySlice';
import Container from 'react-bootstrap/Container';
import { useSelector } from 'react-redux';
export default function QueryResult(props) {
const { nResults } = useSelector(selectResult);
const text =
nResults > 0 ? (
<h5 className="card-title text-sm-right">{nResults} results</h5>
) : (
<h5 className="card-title text-sm-right text-danger">No results!</h5>
);
return (
<div className="mt-sm-3 mb-sm-3">
<Container>{text}</Container>
</div>
);
}
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