mirror of
https://github.com/xibyte/jsketcher
synced 2025-12-25 01:45:26 +01:00
documentation window toolbar
This commit is contained in:
parent
42c5ffa13a
commit
5493cd0edd
2 changed files with 23 additions and 0 deletions
|
|
@ -3,6 +3,8 @@ import {stream} from "lstream";
|
|||
import Window from "ui/components/Window";
|
||||
import {useStream} from "ui/effects";
|
||||
import marked from 'marked';
|
||||
import {AiOutlineHome} from "react-icons/ai";
|
||||
import {RiArrowGoBackLine} from "react-icons/ri";
|
||||
|
||||
export const DocumentationTopic$ = stream();
|
||||
export const DocumentationUIState$ = stream();
|
||||
|
|
@ -17,6 +19,7 @@ export function DocumentationWindow() {
|
|||
|
||||
const request: DocumentationRequest = useStream(DocumentationTopic$);
|
||||
const [content, setContent] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
window.__CAD_APP.DocumentationTopic$ = DocumentationTopic$;
|
||||
if (!request) {
|
||||
|
|
@ -64,6 +67,10 @@ export function DocumentationWindow() {
|
|||
enableResize={true}
|
||||
onClose={() => DocumentationTopic$.next(null)}
|
||||
onResize={el => DocumentationUIState$.next(el)}>
|
||||
<div className='documentation-toolbar'>
|
||||
<button onClick={() => DocumentationTopic$.next({topic: 'index'})}><AiOutlineHome /> </button>
|
||||
<button onClick={() => alert("men at work")}><RiArrowGoBackLine /></button>
|
||||
</div>
|
||||
<p className='documentation-content' dangerouslySetInnerHTML={{__html: content}} />
|
||||
</Window>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,4 +2,20 @@
|
|||
background: #323444;
|
||||
font-size: 13px;
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
.documentation-toolbar {
|
||||
display: flex;
|
||||
color: white;
|
||||
padding-left: 3px;
|
||||
|
||||
* > {
|
||||
padding: 3px;
|
||||
margin: 3px 3px 3px 0;
|
||||
}
|
||||
|
||||
svg {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue