mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-11 01:43:23 +01:00
Clean up logic
This commit is contained in:
parent
89f4a5137c
commit
61c4fd9889
@ -7,12 +7,13 @@ import AddSvg from '../../../images/add.svg';
|
|||||||
import MinusSvg from '../../../images/minus.svg';
|
import MinusSvg from '../../../images/minus.svg';
|
||||||
import CenterFocusSvg from '../../../images/center_focus.svg';
|
import CenterFocusSvg from '../../../images/center_focus.svg';
|
||||||
import ActionButton from '../action-button';
|
import ActionButton from '../action-button';
|
||||||
|
import { EditorRenderMode } from '@wisemapping/mindplot';
|
||||||
|
|
||||||
export type FooterPropsType = {
|
export type FooterPropsType = {
|
||||||
showTryPanel?: boolean;
|
editorMode: EditorRenderMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
const Footer = ({ showTryPanel }: FooterPropsType): React.ReactElement => {
|
const Footer = ({ editorMode }: FooterPropsType): React.ReactElement => {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -37,7 +38,7 @@ const Footer = ({ showTryPanel }: FooterPropsType): React.ReactElement => {
|
|||||||
</div>
|
</div>
|
||||||
<StyledLogo id="bottom-logo"></StyledLogo>
|
<StyledLogo id="bottom-logo"></StyledLogo>
|
||||||
<Notifier id="headerNotifier"></Notifier>
|
<Notifier id="headerNotifier"></Notifier>
|
||||||
{showTryPanel && (
|
{editorMode === 'showcase' && (
|
||||||
<div id="tryInfoPanel">
|
<div id="tryInfoPanel">
|
||||||
<p>{intl.formatMessage({ id: 'editor.try-welcome' })}</p>
|
<p>{intl.formatMessage({ id: 'editor.try-welcome' })}</p>
|
||||||
<p>{intl.formatMessage({ id: 'editor.try-welcome-description' })}</p>
|
<p>{intl.formatMessage({ id: 'editor.try-welcome-description' })}</p>
|
||||||
|
@ -28,16 +28,17 @@ import './global-styled.css';
|
|||||||
|
|
||||||
import { HeaderContainer, ToolbarButton, ToolbarButtonExt, ToolbarRightContainer } from './styled';
|
import { HeaderContainer, ToolbarButton, ToolbarButtonExt, ToolbarRightContainer } from './styled';
|
||||||
import ActionButton from '../action-button';
|
import ActionButton from '../action-button';
|
||||||
|
import { EditorRenderMode } from '@wisemapping/mindplot';
|
||||||
|
|
||||||
export type ToolbarActionType = 'export' | 'publish' | 'history' | 'print' | 'share';
|
export type ToolbarActionType = 'export' | 'publish' | 'history' | 'print' | 'share';
|
||||||
|
|
||||||
export type ToolbarPropsType = {
|
export type ToolbarPropsType = {
|
||||||
isTryMode: boolean;
|
editorMode: EditorRenderMode;
|
||||||
onAction: (action: ToolbarActionType) => void;
|
onAction: (action: ToolbarActionType) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function Toolbar({
|
export default function Toolbar({
|
||||||
isTryMode: isTryMode,
|
editorMode: editorMode,
|
||||||
onAction,
|
onAction,
|
||||||
}: ToolbarPropsType): React.ReactElement {
|
}: ToolbarPropsType): React.ReactElement {
|
||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
@ -47,7 +48,7 @@ export default function Toolbar({
|
|||||||
<div id="backToList">
|
<div id="backToList">
|
||||||
<img src={BackIconSvg} />
|
<img src={BackIconSvg} />
|
||||||
</div>
|
</div>
|
||||||
{!isTryMode && (
|
{editorMode === 'edition' && (
|
||||||
<div id="persist" className="buttonContainer">
|
<div id="persist" className="buttonContainer">
|
||||||
<ToolbarButton id="save" className="buttonOn">
|
<ToolbarButton id="save" className="buttonOn">
|
||||||
<img src={SaveSvg} />
|
<img src={SaveSvg} />
|
||||||
@ -111,7 +112,7 @@ export default function Toolbar({
|
|||||||
</ToolbarButton>
|
</ToolbarButton>
|
||||||
</div>
|
</div>
|
||||||
<div id="separator" className="buttonContainer"></div>
|
<div id="separator" className="buttonContainer"></div>
|
||||||
{!isTryMode && (
|
{editorMode === 'edition' && (
|
||||||
<ToolbarRightContainer>
|
<ToolbarRightContainer>
|
||||||
<ToolbarButton
|
<ToolbarButton
|
||||||
id="export"
|
id="export"
|
||||||
|
Loading…
Reference in New Issue
Block a user