Skip to content

Commit

Permalink
Note if no epoch selected
Browse files Browse the repository at this point in the history
  • Loading branch information
ayazhafiz committed Aug 2, 2023
1 parent 66b6b8b commit 9cf9a0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
7 changes: 1 addition & 6 deletions crates/compiler/checkmate/www/src/App.tsx
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
10 changes: 8 additions & 2 deletions crates/compiler/checkmate/www/src/components/Ui.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -98,7 +105,6 @@ function VariablesGraphView({
graphEe,
eventListEe,
}: VariablesGraphViewProps): JSX.Element {
console.log("re-rendering...");
return (
<VariablesGraph subs={subs} graphEe={graphEe} eventListEe={eventListEe} />
);
Expand Down

0 comments on commit 9cf9a0d

Please sign in to comment.