|
1 | 1 | //@flow |
2 | 2 | import React from 'react'; |
3 | 3 | import PropTypes from 'prop-types'; |
| 4 | +import {Sidebar, Gutter, Header, Content, Context} from './components'; |
4 | 5 | import pjson from '../package.json'; |
5 | | -import {Sidebar, Gutter, Content, Context} from './components'; |
6 | 6 | import Stores from './Stores'; |
7 | 7 | import {observer} from 'mobx-react-lite'; |
8 | | -import {AnchorButton, Icon, Tag} from '@blueprintjs/core'; |
9 | 8 |
|
10 | 9 | const Designer = observer(() => { |
11 | 10 | const stores = React.useContext(Context.StoresContext); |
| 11 | + const {activeView, views, fullscreen} = stores.uiStore; |
| 12 | + const shouldShowSidebar = |
| 13 | + fullscreen === false && activeView !== views.preview; |
12 | 14 | return ( |
13 | 15 | <div className="dark bp3-dark"> |
14 | 16 | <div className={'OasContainer h-screen w-full'}> |
15 | 17 | <div className={'Studio h-full flex flex-1 flex-col'}> |
16 | 18 | {stores.uiStore.fullscreen === false && ( |
17 | | - <div |
18 | | - className="grid py-4 px-5 w-100 bg-canvas border-b" |
19 | | - style={{gridTemplateColumns: '1fr auto 1fr'}}> |
20 | | - <div className="flex justify-start items-center"> |
21 | | - <Tag large minimal icon="git-commit"> |
22 | | - {pjson.version} |
23 | | - </Tag> |
24 | | - </div> |
25 | | - <div className="flex items-center"> |
26 | | - <div className="text-base overflow-hidden mx-2"> |
27 | | - <a |
28 | | - href={pjson.repository.url} |
29 | | - target="_blank" |
30 | | - rel="noreferrer"> |
31 | | - Openapi Designer |
32 | | - </a> |
33 | | - </div> |
34 | | - </div> |
35 | | - <div className="flex justify-end items-center"> |
36 | | - <AnchorButton |
37 | | - icon={<Icon size={12} icon="git-repo" />} |
38 | | - href={pjson.repository.url} |
39 | | - target="_blank" |
40 | | - text="View on Github" |
41 | | - /> |
42 | | - </div> |
43 | | - </div> |
| 19 | + <Header repoUrl={pjson.repository.url} version={pjson.version}> |
| 20 | + Openapi Designer |
| 21 | + </Header> |
44 | 22 | )} |
45 | 23 | <div className={'flex flex-1'}> |
46 | | - {stores.uiStore.fullscreen === false && ( |
| 24 | + {shouldShowSidebar && ( |
47 | 25 | <Sidebar |
48 | 26 | fullscreen={stores.uiStore.fullscreen} |
49 | 27 | style={{ |
|
0 commit comments