Commit 09070dfc authored by Federico's avatar Federico
Browse files
parents 5b43f395 6fb426db
import React, { useRef } from 'react';
import React from 'react';
import { useSelector } from 'react-redux';
import { selectLoading } from './navbar/querySlice';
import LoadingOverlay from 'react-loading-overlay';
......
......@@ -23,9 +23,7 @@ export default function Query(props) {
if (!text.trim()) {
return;
}
dispatch(performQuery({ text })).then(() => {
setText('');
});
dispatch(performQuery({ text }));
};
return (
......
import React, { useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { closeModal, selectShowModal } from './searchSlice';
import { performQuery, selectError } from '../navbar/querySlice';
import { performQuery } from '../navbar/querySlice';
import Form from 'react-bootstrap/Form';
import Button from 'react-bootstrap/Button';
import Modal from 'react-bootstrap/Modal';
import Row from 'react-bootstrap/Row';
import Col from 'react-bootstrap/Col';
export default function SearchModal(props) {
export default function SearchModal() {
// Search fields
const [allData, setAllData] = useState('');
const [metadata, setMetadata] = useState('');
......@@ -26,7 +26,6 @@ export default function SearchModal(props) {
// Dispatch and selectors used in this component
const dispatch = useDispatch();
const showModal = useSelector(selectShowModal);
const error = useSelector(selectError);
// Function to close modal
const handleClose = () => dispatch(closeModal());
......
......@@ -11,7 +11,7 @@ export default function Tooltip() {
const hoverNode = resultsById[hoverSiteId] || null;
return (
<MouseTooltip visible={hoverNode !== null} offsetX={15} offsetY={10} style={{zIndex: 9999}}>
<MouseTooltip visible={hoverNode !== null} offsetX={15} offsetY={10} style={{ zIndex: 9999 }}>
<div>
{hoverNode && (
<Card style={{ width: '300px' }}>
......@@ -19,14 +19,19 @@ export default function Tooltip() {
<Card.Title as={'h6'} className={'text-truncate'}>
{hoverNode.title}
</Card.Title>
<Card.Subtitle className='mb-2 text-muted text-truncate'>
<Card.Subtitle className="mb-2 text-muted text-truncate">
{hoverNode.level}
</Card.Subtitle>
<Card.Subtitle className='text-muted text-truncate'>
<Card.Subtitle className="text-muted text-truncate">
{hoverNode.dateRangeText}
</Card.Subtitle>
</Card.Body>
<Card.Footer className='mt-2 text-muted'>💡 Press "i" to learn more</Card.Footer>
<Card.Footer className="mt-2 text-muted">
<span className="mr-sm-2" role="img" aria-label="Lamp emoji">
💡
</span>
<span>Press "i" to learn more</span>
</Card.Footer>
</Card>
)}
</div>
......
......@@ -13,13 +13,13 @@ export const yearRangeSlice = createSlice({
// which detects changes to a "draft state" and produces a brand new
// immutable state based off those changes
setStart: (state, action) => {
throw new Error('Not implemented');
state.start = action.payload;
},
setEnd: (state, action) => {
throw new Error('Not implemented');
state.end = action.payload;
},
setYears: (state, action) => {
throw new Error('Not implemented');
state.years = action.payload;
},
},
});
......
Supports Markdown
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