Skip to content

Commit

Permalink
Merge pull request #872 from stadtnavi/fix/public-poi-icon-alignment
Browse files Browse the repository at this point in the history
feat(poi-details): align poi icon on details page
  • Loading branch information
andreashelms authored Jan 8, 2025
2 parents 6f1b401 + a417c21 commit b23f450
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
11 changes: 9 additions & 2 deletions app/component/CardHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const CardHeader = (
showHeaderTitle,
headerPictureUrl,
showCardSubHeader = true,
isMobile,
},
{ config, intl },
) => {
Expand Down Expand Up @@ -65,8 +66,13 @@ const CardHeader = (
<div className="card-header-content">
{icon || dataURI ? (
<div
className="left"
style={{ fontSize: 32, paddingRight: 10, height: 32 }}
className="left card-header-icon-container"
style={{
fontSize: 32,
paddingRight: 10,
height: 32,
transform: !isMobile ? 'translateY(12px)' : 'initial',
}}
>
<Icon
img={icon}
Expand Down Expand Up @@ -139,6 +145,7 @@ CardHeader.propTypes = {
isTerminal: PropTypes.bool,
showHeaderTitle: PropTypes.bool,
showCardSubHeader: PropTypes.bool,
isMobile: PropTypes.bool,
};

CardHeader.defaultProps = {
Expand Down
5 changes: 4 additions & 1 deletion app/component/StopCardHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,19 +91,22 @@ class StopCardHeader extends React.Component {
return false;
}

const isMobile = breakpoint !== 'large';

return (
<CardHeader
className={className}
headingStyle={headingStyle}
description={this.getDescription()}
code={this.headerConfig.showStopCode && stop.code ? stop.code : null}
icons={icons}
showBackButton={breakpoint === 'large'}
showBackButton={!isMobile}
stop={stop}
headerConfig={this.headerConfig}
isTerminal={isTerminal}
showHeaderTitle
showCardSubHeader
isMobile={isMobile}
// TODO: Fix places geocoder api request to reimplement favorite button.
// https://github.com/stadtnavi/digitransit-ui/issues/481
/** favouriteContainer={
Expand Down
1 change: 1 addition & 0 deletions app/component/map/sidebar/SidebarContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ const SidebarContainer = (
description={description}
showCardSubHeader={Boolean(description)}
showBackButton={!isMobile}
isMobile={isMobile}
/>
{children}
{location && (
Expand Down

0 comments on commit b23f450

Please sign in to comment.