From d8b77ca41cc8ecda1a712fde920eed632d17ea48 Mon Sep 17 00:00:00 2001 From: William Chong Date: Sat, 2 Dec 2023 02:55:54 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8D=EF=B8=8F=20Link=20store=20details?= =?UTF-8?q?=20page=20to=20store=20main=20page?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/LibraryDetails/LibraryDetails.jsx | 1 + src/common/components/SubNavBar/SubNavBar.jsx | 12 ++++++++++-- src/common/components/SubNavBar/SubNavBar.style.scss | 7 +++++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/asset-library/views/LibraryDetails/LibraryDetails.jsx b/src/asset-library/views/LibraryDetails/LibraryDetails.jsx index 05cd7013..f65c9c66 100644 --- a/src/asset-library/views/LibraryDetails/LibraryDetails.jsx +++ b/src/asset-library/views/LibraryDetails/LibraryDetails.jsx @@ -414,6 +414,7 @@ export default class LibraryDetails extends React.Component { t('MyLibraryDashboard:title') : t('AssetStore:title') } + textHref={this.props.route.isStore ? '/store' : '/asset'} fluid onClickIconButton={this.handleToggleCreateLibraryModal} onClickText={this.handleClickSubNavBarText} diff --git a/src/common/components/SubNavBar/SubNavBar.jsx b/src/common/components/SubNavBar/SubNavBar.jsx index 3deccb10..f1931f01 100644 --- a/src/common/components/SubNavBar/SubNavBar.jsx +++ b/src/common/components/SubNavBar/SubNavBar.jsx @@ -10,7 +10,7 @@ import './SubNavBar.style.scss'; function SubNavBar(props) { const { - fluid, icon, narrow, secondaryText, text, + fluid, icon, narrow, secondaryText, text, textHref, } = props; const className = classNames(props.className, { narrow }); const titleClassName = classNames('title', { @@ -19,7 +19,13 @@ function SubNavBar(props) { const id = 'sub-navbar'; return ( - {text} + { e.preventDefault(); if (props.onClickText) props.onClickText(e); }} + > + {text} + {secondaryText && {`> ${secondaryText}`}} {icon && } @@ -33,6 +39,7 @@ SubNavBar.propTypes = { narrow: PropTypes.bool, secondaryText: PropTypes.string, text: PropTypes.string, + textHref: PropTypes.string, onClickIconButton: PropTypes.func, onClickText: PropTypes.func, }; @@ -43,6 +50,7 @@ SubNavBar.defaultProps = { icon: undefined, narrow: false, text: '', + textHref: '#', }; export default SubNavBar; diff --git a/src/common/components/SubNavBar/SubNavBar.style.scss b/src/common/components/SubNavBar/SubNavBar.style.scss index e89bff8d..72abd251 100644 --- a/src/common/components/SubNavBar/SubNavBar.style.scss +++ b/src/common/components/SubNavBar/SubNavBar.style.scss @@ -15,13 +15,15 @@ $sub-navbar-narrow-height: 32px; border-bottom: 1px solid $light-grey-3; background-color: $pure-white; - span { + a, span { transition: font-size 0.15s ease-in-out; font-size: 32px; font-weight: 200; line-height: 50px; + text-decoration: inherit; + &.secondaryText { padding: 0 padding(1/3); } @@ -39,9 +41,10 @@ $sub-navbar-narrow-height: 32px; height: $sub-navbar-narrow-height; padding-top: #{$nav-bar-height + $sub-navbar-narrow-height}; - span { + a, span { font-size: 16px; line-height: $sub-navbar-narrow-height; + text-decoration: inherit; } }