cleanup code a bit more
This commit is contained in:
parent
07b51dd2f2
commit
1f72542234
25 changed files with 146 additions and 122 deletions
39
src/App/BottomPanel/BottomPanel.tsx
Normal file
39
src/App/BottomPanel/BottomPanel.tsx
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
import { useEffect, useState } from "react";
|
||||
import { TraceableError } from "../../statecharts/parser";
|
||||
|
||||
import "./BottomPanel.css";
|
||||
|
||||
import logo from "../../../artwork/logo-playful.svg";
|
||||
import { PersistentDetailsLocalStorage } from "../PersistentDetails";
|
||||
|
||||
export function BottomPanel(props: {errors: TraceableError[]}) {
|
||||
const [greeting, setGreeting] = useState(
|
||||
<div style={{textAlign:'center'}}>
|
||||
<span style={{fontSize: 18, fontStyle: 'italic'}}>
|
||||
Welcome to <img src={logo} style={{maxWidth:'100%'}}/>
|
||||
</span>
|
||||
</div>);
|
||||
|
||||
useEffect(() => {
|
||||
setTimeout(() => {
|
||||
setGreeting(<></>);
|
||||
}, 2000);
|
||||
}, []);
|
||||
|
||||
return <div className="toolbar bottom">
|
||||
{greeting}
|
||||
{props.errors.length > 0 &&
|
||||
<div className="errorStatus">
|
||||
<PersistentDetailsLocalStorage initiallyOpen={false} localStorageKey="errorsExpanded">
|
||||
<summary>{props.errors.length} errors</summary>
|
||||
<div style={{maxHeight: '25vh', overflow: 'auto'}}>
|
||||
{props.errors.map(({message, shapeUid})=>
|
||||
<div>
|
||||
{shapeUid}: {message}
|
||||
</div>)}
|
||||
</div>
|
||||
</PersistentDetailsLocalStorage>
|
||||
</div>
|
||||
}
|
||||
</div>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue