From a39a1a0db1ec3f02a9abf47ba9d3d538a55bc0fe Mon Sep 17 00:00:00 2001 From: dmt0 Date: Wed, 6 Dec 2023 00:13:19 +0100 Subject: [PATCH] Support link in logo --- src/DefaultEditor.js | 5 +++-- src/components/widgets/Logo.js | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/DefaultEditor.js b/src/DefaultEditor.js index fc7ae29c..2a927a57 100644 --- a/src/DefaultEditor.js +++ b/src/DefaultEditor.js @@ -21,7 +21,7 @@ import Logo from './components/widgets/Logo'; import {TRANSFORMABLE_TRACES, TRACE_TO_AXIS} from './lib/constants'; const DefaultEditor = ( - {logoSrc, children, menuPanelOrder}, + {logoSrc, logoLinkUrl, children, menuPanelOrder}, {fullData, fullLayout, layout, localize: _} ) => { const hasTransforms = () => fullData.some((d) => TRANSFORMABLE_TRACES.includes(d.type)); @@ -51,7 +51,7 @@ const DefaultEditor = ( return ( - {Boolean(logoSrc) && } + {Boolean(logoSrc) && } {hasTransforms() && } @@ -74,6 +74,7 @@ const DefaultEditor = ( DefaultEditor.propTypes = { children: PropTypes.node, logoSrc: PropTypes.string, + logoLinkUrl: PropTypes.string, menuPanelOrder: PropTypes.array, }; diff --git a/src/components/widgets/Logo.js b/src/components/widgets/Logo.js index 7ab1dee5..707b8be1 100644 --- a/src/components/widgets/Logo.js +++ b/src/components/widgets/Logo.js @@ -1,11 +1,15 @@ import PropTypes from 'prop-types'; -const Logo = ({src}) => ; +const Logo = ({link, src}) => { + const image = ; + return link ? {image} : image; +}; export default Logo; Logo.plotly_editor_traits = {sidebar_element: true}; Logo.propTypes = { + link: PropTypes.string, src: PropTypes.string, };