Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
scale height of creator custom header image in siteBanner
Browse files Browse the repository at this point in the history
This fixes vertical clipping of the header image when the browser is
very wide.

Resolves brave/brave-browser#2015.
  • Loading branch information
cg505 committed May 29, 2019
1 parent 14ca443 commit 5011793
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ exports[`List tests basic tests matches the snapshot 1`] = `
font-weight: 600;
line-height: 0.74;
color: #d1d1db;
height: 176px;
min-height: 176px;
background: url(test-file-stub) no-repeat top left,url(test-file-stub) no-repeat top right,#9e9fab;
}
Expand Down
3 changes: 2 additions & 1 deletion src/features/rewards/siteBanner/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
StyledDonation,
StyledContent,
StyledBanner,
StyledBannerFiller,
StyledBannerImage,
StyledClose,
StyledContentWrapper,
Expand Down Expand Up @@ -253,7 +254,7 @@ export default class SiteBanner extends React.PureComponent<Props, State> {
{
!bgImage
? this.getBannerImageContent(name, screenName, domain, provider)
: null
: <StyledBannerFiller />
}
</StyledBannerImage>
<StyledContentWrapper>
Expand Down
6 changes: 5 additions & 1 deletion src/features/rewards/siteBanner/style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,17 @@ export const StyledBannerImage = styled<Partial<Props>, 'div'>('div')`
font-weight: 600;
line-height: 0.74;
color: #d1d1db;
height: 176px;
min-height: 176px;
background: ${p => p.bgImage
? `url(${p.bgImage}) no-repeat top center / cover`
: `url(${bg1Url}) no-repeat top left, url(${bg2Url}) no-repeat top right, #9e9fab`
};
`

export const StyledBannerFiller = styled<{}, 'div'>('div')`
padding-top: 19.5555%;
`

export const StyledClose = styled<{}, 'button'>('button')`
top: 16px;
right: 16px;
Expand Down

0 comments on commit 5011793

Please sign in to comment.