-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOP-5132: Support image-less banners and add TypeScript support #1318
Conversation
✅ Deploy Preview for docs-frontend-stg ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…seamless-banner
✅ Deploy Preview for docs-frontend-dotcomprd ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for docs-frontend-dotcomstg ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
src/components/Banner/SiteBanner.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was effectively replaced with src/components/SiteBanner/index.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced by tests/unit/__snapshots__/SiteBanner.test.tsx.snap
. If anyone knows how to get GH to cooperate with these name changes and git mv
commands, please let me know 🙃
@@ -34,6 +40,8 @@ | |||
"jest-environment-jsdom": "^29.5.0", | |||
"lint-staged": "^10.5.4", | |||
"prettier": "^2.2.1", | |||
"ts-jest": "^29.2.5", | |||
"typescript": "<5.4.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Limiting the typescript
version due to a bunch of incompatibility warnings and issues from babel-eslint
and required TS linting parser/plugin. I tried to make config changes as minimal as possible for now, but we should have more flexibility on this once we get the chance to upgrade our linter (DOP-5057)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohhh this is very exciting about Typescript. Also, the banner looks great!
|
||
@media ${theme.screenSize.upToMedium} { | ||
background-image: url(${getBannerSource(bannerContent.tabletImgPath)}); | ||
gap: 104px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just curious on why tablet size has such a large gap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Figma design showed a gap of 104px, but thinking about it now, seems like the intention is to just have the brand shape and pill be on the righthand side. I've updated the CSS to ensure the flex container has space-between
instead to make it more flexible. Thanks for bringing this up and let me know what you think!
try { | ||
const res: SiteBannerContent = await fetchBanner(snootyEnv); | ||
// Guard against missing banner content | ||
if (res && (res.imgPath || res.text)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I'm wondering if we also want to guard against res.url
not existing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! Added!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comments below but overall looks great! TS is very exciting! 🙌
max-height: 40px; | ||
|
||
@media ${theme.screenSize.upToMedium} { | ||
max-width: 543px; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need these max widths? the flexbox + gap should handle the width of the text box
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think keeping the max width around would help make the max width guidelines included in the design more explicit vs. relying solely on flexbox/gap. Would it be preferable to remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor preference, but don't feel too strongly about it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Stories/Links:
DOP-5132
Current Behavior:
Atlas prod
Landing prod
Staging Links:
Atlas staging
Landing staging
Notes:
banner-dev
value on Atlas App Services has been updated with the new fields.npm ci
and things should build as it does currently. If it is preferred to split this into a separate PR, please let me know!README updates