Skip to content

Commit

Permalink
🔍️ Link store details page to store main page
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Dec 1, 2023
1 parent 2ee96d7 commit 594de43
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/asset-library/views/LibraryDetails/LibraryDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 4 additions & 2 deletions src/common/components/SubNavBar/SubNavBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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', {
Expand All @@ -19,7 +19,7 @@ function SubNavBar(props) {
const id = 'sub-navbar';
return (
<Container {...{ id, className, fluid }}>
<span className={titleClassName} onClick={props.onClickText}>{text}</span>
<a href={textHref} className={titleClassName} onClick={(e) => { e.preventDefault(); props.onClickText(e); }}>{text}</a>
{secondaryText && <span className="secondaryText">{`> ${secondaryText}`}</span>}
{icon && <FlatButton icon={icon} onClick={props.onClickIconButton} />}
</Container>
Expand All @@ -33,6 +33,7 @@ SubNavBar.propTypes = {
narrow: PropTypes.bool,
secondaryText: PropTypes.string,
text: PropTypes.string,
textHref: PropTypes.string,
onClickIconButton: PropTypes.func,
onClickText: PropTypes.func,
};
Expand All @@ -43,6 +44,7 @@ SubNavBar.defaultProps = {
icon: undefined,
narrow: false,
text: '',
textHref: '#',
};

export default SubNavBar;
7 changes: 5 additions & 2 deletions src/common/components/SubNavBar/SubNavBar.style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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;
}
}

Expand Down

0 comments on commit 594de43

Please sign in to comment.