-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Make application layout background color conditional #248543
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
Changes from all commits
a6c062b
4e076cc
ac452f7
81e4d30
3574433
c731c56
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ | |
|
|
||
| import type { ReactNode } from 'react'; | ||
| import React, { createContext, useContext, useState, useCallback, useEffect } from 'react'; | ||
| import type { ChromeStyle } from '@kbn/core-chrome-browser'; | ||
| import type { LayoutDimensions } from './layout.types'; | ||
|
|
||
| /** | ||
|
|
@@ -26,7 +27,9 @@ export type LayoutConfig = Pick< | |
| | 'applicationBottomBarHeight' | ||
| | 'applicationMarginBottom' | ||
| | 'applicationMarginRight' | ||
| >; | ||
| > & { | ||
| chromeStyle?: ChromeStyle; | ||
| }; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc @Dosant |
||
|
|
||
| /** | ||
| * Context interface including both the config and an update function | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,7 @@ import { APP_FIXED_VIEWPORT_ID } from '../../app_fixed_viewport'; | |
|
|
||
| const layoutConfigs: { classic: ChromeLayoutConfig; project: ChromeLayoutConfig } = { | ||
| classic: { | ||
| chromeStyle: 'classic', | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Without this change, each component that needed to know the chrome style would have to:
Now it's just a one-liner hook call. So if other layout slots (header, navigation, sidebar, footer, etc.) or any nested components need style variations between classic and project mode in the future, the plumbing is already in place. |
||
| headerHeight: 96, | ||
| bannerHeight: 32, | ||
|
|
||
|
|
@@ -37,6 +38,7 @@ const layoutConfigs: { classic: ChromeLayoutConfig; project: ChromeLayoutConfig | |
| navigationWidth: 48, | ||
| }, | ||
| project: { | ||
| chromeStyle: 'project', | ||
| headerHeight: 48, | ||
| bannerHeight: 32, | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.