-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Refactor & convert PageTitle
to SCSS
#17139
Conversation
9191f02
to
e883c58
Compare
PageTitle
to SCSSPageTitle
to SCSS
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.
package-lock.json
Outdated
"lockfileVersion": 2, | ||
"requires": true, | ||
"packages": {} | ||
} |
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 looks to have been generated in error and should be removed.
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!
<MainContainer withLine={withLine}> | ||
<TitleBlock>{title}</TitleBlock> | ||
<div className={classNames(styles.container)} data-withLine={withLine}> | ||
<H3 |
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 H3 is deprecated.
/** @deprecated Use `<Text as="h1 | h2 | h3 | h4 | h5" size="md" />` */
{middleTitleBlock ? ( | ||
<MiddleTitleBlock>{middleTitleBlock}</MiddleTitleBlock> | ||
<Text as="h3" size="md" className={classNames(styles.middleTitleBlock)}> |
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.
Because this is the page title, we should use "h1" instead of "h3"
overflow: hidden; | ||
text-overflow: ellipsis; | ||
`; | ||
|
||
const PageTitle: React.FC<PageTitleProps> = ({ title, withLine, middleComponent, middleTitleBlock, endComponent }) => ( |
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 component should be named PageHeader
and moved to src/components/ui/
Can you also add a storybook file?
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.
@edmundito added a storybook file with a Primary
story. I wasn't sure of the best way to implement the 'middle' component in a story as it needs to hold state, if that needs to be included in this PR - happy to do it, but need more direction :)
import PageHeader from "./PageHeader"; | ||
|
||
export default PageHeader; | ||
export { PageHeader }; |
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.
import PageHeader from "./PageHeader"; | |
export default PageHeader; | |
export { PageHeader }; | |
export * from "./PageHeader"; |
title: React.ReactNode; | ||
} | ||
|
||
const PageHeader: React.FC<PageHeaderProps> = ({ |
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.
const PageHeader: React.FC<PageHeaderProps> = ({ | |
export const PageHeader: React.FC<PageHeaderProps> = ({ |
</div> | ||
); | ||
|
||
export default PageHeader; |
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 codebase is moving away from using the default export
export default PageHeader; |
@krishnaglick I compared just to make sure, looks the same to me at this point: |
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.
One last comment then LGTM
import { PageHeader } from "./PageHeader"; | ||
|
||
export default PageHeader; | ||
export { PageHeader }; |
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.
import { PageHeader } from "./PageHeader"; | |
export default PageHeader; | |
export { PageHeader }; | |
export * from "./PageHeader"; |
…ations * master: (75 commits) source-sentry: migrate to per-stream states (#17466) Greg/clickhouse polishing (#17483) upgrade debezium version to 1.9.6 (#17459) 🐛 Source Twilio: Lookback_window config (#17478) hide S3 source connector from catalog (#17472) 🪟 Migrate styles for Connection-related Components (#17339) Added new title (#17480) Refactor & convert `PageTitle` to SCSS (#17139) updated releaseStage for zendesk-talk (#17477) [low-code] Apply log level to stream loggers (#17284) 🐛 Source Salesforce: filter out objects not supported by the Bulk API (#17453) Source Marketo: certify GA (#17445) Update greenhouse paginator (#17429) Add some services start validation to acceptance_tests.sh (#17425) 📖 Removes $ from terminal commands to allow direct copying. (#17467) migrate source GA connectors to per-stream states (2) (#17410) Source Klaviyo: bump CDK dependency (#17422) Source Pinterest: change releaseStage to GA (#17045) Source Pinterest: Set start_date dynamically based on API restrictions for lookup (#17387) updated releaseStage to generally_available (#17374) ...
* master: source-sentry: migrate to per-stream states (#17466) Greg/clickhouse polishing (#17483) upgrade debezium version to 1.9.6 (#17459) 🐛 Source Twilio: Lookback_window config (#17478) hide S3 source connector from catalog (#17472) 🪟 Migrate styles for Connection-related Components (#17339) Added new title (#17480) Refactor & convert `PageTitle` to SCSS (#17139) updated releaseStage for zendesk-talk (#17477) [low-code] Apply log level to stream loggers (#17284) 🐛 Source Salesforce: filter out objects not supported by the Bulk API (#17453) Source Marketo: certify GA (#17445) Update greenhouse paginator (#17429) Add some services start validation to acceptance_tests.sh (#17425) 📖 Removes $ from terminal commands to allow direct copying. (#17467)
* Converts PageTitle from styled components to SCSS. * Delete package-lock.json * Swapped deprecated H3 for Text base component. * Renames and moves the PageTitle component. * Adds primary story. * Removes PageTitle component. * Regenerates failing snapshot tests. * Requested changes.
What
Closes #1569
How
PageTitle
from styled components to SCSS.PageTitle
component is below (Destinations & New Destination button):Recommended reading order
airbyte-webapp/src/components/PageTitle/PageTitle.tsx
airbyte-webapp/src/components/PageTitle/PageTitle.module.scss