-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
fix: added margin top to the onboarding flow if banner visible #31497
Conversation
WalkthroughThe recent modification in the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
const SectionWrapper = styled.div<{ isBannerVisible: boolean }>` | ||
display: flex; | ||
flex-direction: column; | ||
padding: 0 var(--ads-v2-spaces-7) var(--ads-v2-spaces-7); | ||
${(props) => ` | ||
margin-top: ${props.theme.homePage.header}px; | ||
margin-top: ${ | ||
props.theme.homePage.header + (props.isBannerVisible ? 40 : 0) | ||
}px; |
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 dynamic adjustment of the SectionWrapper
component's styling based on the isBannerVisible
state is well-implemented. Using a styled component to conditionally apply the additional top margin ensures that the layout adapts seamlessly to the presence of the license banner. This approach maintains the separation of concerns by keeping styling logic within the styled component definition. However, consider extracting the calculation of the top margin into a separate function for better readability and maintainability.
+ const calculateTopMargin = (isBannerVisible: boolean) => props.theme.homePage.header + (isBannerVisible ? 40 : 0) + 'px';
- margin-top: ${props.theme.homePage.header + (props.isBannerVisible ? 40 : 0)}px;
+ margin-top: ${calculateTopMargin(props.isBannerVisible)};
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
const SectionWrapper = styled.div<{ isBannerVisible: boolean }>` | |
display: flex; | |
flex-direction: column; | |
padding: 0 var(--ads-v2-spaces-7) var(--ads-v2-spaces-7); | |
${(props) => ` | |
margin-top: ${props.theme.homePage.header}px; | |
margin-top: ${ | |
props.theme.homePage.header + (props.isBannerVisible ? 40 : 0) | |
}px; | |
const SectionWrapper = styled.div<{ isBannerVisible: boolean }>` | |
display: flex; | |
flex-direction: column; | |
padding: 0 var(--ads-v2-spaces-7) var(--ads-v2-spaces-7); | |
${(props) => ` | |
+ const calculateTopMargin = (isBannerVisible: boolean) => props.theme.homePage.header + (isBannerVisible ? 40 : 0) + 'px'; | |
- margin-top: ${props.theme.homePage.header + (props.isBannerVisible ? 40 : 0)}px; | |
+ margin-top: ${calculateTopMargin(props.isBannerVisible)}; |
/ok-to-test tags="@tag.Datasource" |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/8160920269. |
Find the deployed preview for testing on : https://github.com/appsmithorg/appsmith-ee/pull/3657 |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/8160920269. |
/build-deploy-preview skip-tests=true |
Deploying Your Preview: https://github.com/appsmithorg/appsmith/actions/runs/8167026085. |
Deploy-Preview-URL: https://ce-31497.dp.appsmith.com |
Tested both CE and EE DPs, everything looks good!! @AmanAgarwal041 |
…953-skip-option-visibility
…953-skip-option-visibility
/ok-to-test tags="@tag.Datasource" |
Tests running at: https://github.com/appsmithorg/appsmith/actions/runs/8172596147. |
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/8172596147. |
Description
Earlier the since the license banner had fixed position which was making the skip section gets hidden. Hence as the page header is positioned 40px below the banner if it is visible. We are doing the same for the onboarding flow.
PR fixes following issue(s)
Fixes #30953
Media
Screen.Recording.2024-03-06.at.6.35.34.PM.mov
Type of change
Testing
How Has This Been Tested?
Test Plan
Issues raised during DP testing
Checklist:
Dev activity
QA activity:
Test Plan Approved
label after Cypress tests were reviewedTest Plan Approved
label after JUnit tests were reviewedSummary by CodeRabbit