Skip to content

Commit

Permalink
Merge branch 'website-layout' of https://github.com/yoonieaj/memory-viz
Browse files Browse the repository at this point in the history
… into website-layout
  • Loading branch information
yoonieaj committed Aug 11, 2024
2 parents 743771e + 40e6d24 commit 6e8ed55
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 651 deletions.
69 changes: 29 additions & 40 deletions demo/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React, { useState } from "react";
import SvgDisplay from "./SvgDisplay";
import MemoryModelsUserInput from "./MemoryModelsUserInput";
import { configDataPropTypes } from "./UserInput";
import UserInput from "./UserInput";
import Header from "./Header";
import { Box } from "@mui/material";
import { ErrorBoundary } from "react-error-boundary";
import DownloadSVGButton from "./DownloadSVGButton";
import { Alert } from "@mui/material";
import { configDataPropTypes } from "./MemoryModelsUserInput";
import MemoryModelsSample from "./MemoryModelsSample";
import UserOutput from "./UserOutput";

export default function App() {
const [textData, setTextData] = useState("");
Expand Down Expand Up @@ -34,44 +33,34 @@ export default function App() {

return (
<>
{failureBanner && (
<Alert severity="error" data-testid="json-parse-alert">
{failureBanner}
</Alert>
)}
<MemoryModelsSample
setTextData={setTextData}
setConfigData={setConfigData}
onTextDataSubmit={onTextDataSubmit}
/>
<MemoryModelsUserInput
textData={textData}
setTextData={setTextData}
configData={configData}
setConfigData={setConfigData}
onTextDataSubmit={onTextDataSubmit}
setFailureBanner={setFailureBanner}
jsonResult={jsonResult}
/>
<section>
<h2>Output</h2>
<DownloadSVGButton svgResult={svgResult} />
<ErrorBoundary
fallback={
<p data-testid="svg-display-error-boundary">
This is valid JSON but not valid Memory Models JSON.
Please refer to the repo for more details.
</p>
}
key={jsonResult}
>
<SvgDisplay
<Header />
<Box
sx={{
display: "flex",
gap: "2rem",
}}
>
<Box sx={{ width: "40%" }}>
<UserInput
textData={textData}
setTextData={setTextData}
configData={configData}
setConfigData={setConfigData}
onTextDataSubmit={onTextDataSubmit}
setFailureBanner={setFailureBanner}
jsonResult={jsonResult}
/>
</Box>
<Box sx={{ width: "60%" }}>
<UserOutput
jsonResult={jsonResult}
configData={configData}
setConfigData={setConfigData}
svgResult={svgResult}
setSvgResult={setSvgResult}
/>
</ErrorBoundary>
</section>
</Box>
</Box>
</>
);
}
66 changes: 0 additions & 66 deletions demo/src/AppTwo.tsx

This file was deleted.

28 changes: 0 additions & 28 deletions demo/src/DownloadJSONButton.tsx

This file was deleted.

25 changes: 0 additions & 25 deletions demo/src/DownloadSVGButton.tsx

This file was deleted.

78 changes: 0 additions & 78 deletions demo/src/MemoryModelsSample.tsx

This file was deleted.

Loading

0 comments on commit 6e8ed55

Please sign in to comment.