Note if no epoch selected

This commit is contained in:
Ayaz Hafiz 2023-08-02 17:55:42 -05:00
parent 66b6b8b53d
commit 9cf9a0d0b3
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
2 changed files with 9 additions and 8 deletions

View file

@ -1,15 +1,10 @@
import React from "react";
import FileInput, { LoadedEvents } from "./components/FileInput";
import Ui from "./components/Ui";
import data from "./checkmate.json";
import { AllEvents } from "./schema";
import { BrowserRouter } from "react-router-dom";
export default function App() {
const [events, setEvents] = React.useState<LoadedEvents | null>({
kind: "ok",
events: data as AllEvents,
});
const [events, setEvents] = React.useState<LoadedEvents | null>(null);
return (
<BrowserRouter>

View file

@ -66,7 +66,14 @@ export default function Ui({ events }: UiProps): JSX.Element {
selectedEpochs={selectedEpochs}
/>
</div>
<div className="flex-1 min-h-[50%] h-full flex flex-col">
<div className="flex-1 min-h-[50%] h-full flex flex-col place-content-center shadow">
{selectedEpochs.length === 0 && (
<span className="text-center">
<span className="p-2 border rounded-md bg-gray-200 inline-block">
Select an event to view.
</span>
</span>
)}
{subsTop !== undefined && (
<VariablesGraphView
subs={subsTop}
@ -98,7 +105,6 @@ function VariablesGraphView({
graphEe,
eventListEe,
}: VariablesGraphViewProps): JSX.Element {
console.log("re-rendering...");
return (
<VariablesGraph subs={subs} graphEe={graphEe} eventListEe={eventListEe} />
);