mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Canvas] Remove dark mode prop on editor menu component (#158968)
Closes #158967. We were checking dark mode to override icon colors in the editor menu. At some point these styles were removed because EUI auto handles the colors per light/dark mode for the icons properly now. I'm removing those classes and the dark mode prop for the EditorMenu component.
This commit is contained in:
parent
be244835e6
commit
a8ef21f968
3 changed files with 10 additions and 35 deletions
|
@ -85,23 +85,12 @@ const testVisTypeAliases: VisTypeAlias[] = [
|
|||
},
|
||||
];
|
||||
|
||||
storiesOf('components/WorkpadHeader/EditorMenu', module)
|
||||
.add('default', () => (
|
||||
<EditorMenu
|
||||
factories={testFactories}
|
||||
promotedVisTypes={testVisTypes}
|
||||
visTypeAliases={testVisTypeAliases}
|
||||
createNewVisType={() => action('createNewVisType')}
|
||||
createNewEmbeddable={() => action('createNewEmbeddable')}
|
||||
/>
|
||||
))
|
||||
.add('dark mode', () => (
|
||||
<EditorMenu
|
||||
factories={testFactories}
|
||||
isDarkThemeEnabled
|
||||
promotedVisTypes={testVisTypes}
|
||||
visTypeAliases={testVisTypeAliases}
|
||||
createNewVisType={() => action('createNewVisType')}
|
||||
createNewEmbeddable={() => action('createNewEmbeddable')}
|
||||
/>
|
||||
));
|
||||
storiesOf('components/WorkpadHeader/EditorMenu', module).add('default', () => (
|
||||
<EditorMenu
|
||||
factories={testFactories}
|
||||
promotedVisTypes={testVisTypes}
|
||||
visTypeAliases={testVisTypeAliases}
|
||||
createNewVisType={() => action('createNewVisType')}
|
||||
createNewEmbeddable={() => action('createNewEmbeddable')}
|
||||
/>
|
||||
));
|
||||
|
|
|
@ -33,7 +33,6 @@ interface FactoryGroup {
|
|||
|
||||
interface Props {
|
||||
factories: EmbeddableFactoryDefinition[];
|
||||
isDarkThemeEnabled?: boolean;
|
||||
promotedVisTypes: BaseVisType[];
|
||||
visTypeAliases: VisTypeAlias[];
|
||||
createNewVisType: (visType?: BaseVisType | VisTypeAlias) => () => void;
|
||||
|
@ -42,7 +41,6 @@ interface Props {
|
|||
|
||||
export const EditorMenu: FC<Props> = ({
|
||||
factories,
|
||||
isDarkThemeEnabled,
|
||||
promotedVisTypes,
|
||||
visTypeAliases,
|
||||
createNewVisType,
|
||||
|
@ -155,11 +153,6 @@ export const EditorMenu: FC<Props> = ({
|
|||
<EuiContextMenu
|
||||
initialPanelId={0}
|
||||
panels={editorMenuPanels}
|
||||
className={`canvasSolutionToolbar__editorContextMenu ${
|
||||
isDarkThemeEnabled
|
||||
? 'canvasSolutionToolbar__editorContextMenu--dark'
|
||||
: 'canvasSolutionToolbar__editorContextMenu--light'
|
||||
}`}
|
||||
data-test-subj="canvasEditorContextMenu"
|
||||
/>
|
||||
)}
|
||||
|
|
|
@ -14,11 +14,7 @@ import {
|
|||
EmbeddableInput,
|
||||
} from '@kbn/embeddable-plugin/public';
|
||||
import { trackCanvasUiMetric, METRIC_TYPE } from '../../../lib/ui_metric';
|
||||
import {
|
||||
useEmbeddablesService,
|
||||
usePlatformService,
|
||||
useVisualizationsService,
|
||||
} from '../../../services';
|
||||
import { useEmbeddablesService, useVisualizationsService } from '../../../services';
|
||||
import { CANVAS_APP } from '../../../../common/lib';
|
||||
import { encode } from '../../../../common/lib/embeddable_dataurl';
|
||||
import { ElementSpec } from '../../../../types';
|
||||
|
@ -39,10 +35,8 @@ interface UnwrappedEmbeddableFactory {
|
|||
export const EditorMenu: FC<Props> = ({ addElement }) => {
|
||||
const embeddablesService = useEmbeddablesService();
|
||||
const { pathname, search, hash } = useLocation();
|
||||
const platformService = usePlatformService();
|
||||
const stateTransferService = embeddablesService.getStateTransfer();
|
||||
const visualizationsService = useVisualizationsService();
|
||||
const IS_DARK_THEME = platformService.getUISetting('theme:darkMode');
|
||||
|
||||
const embeddableFactories = useMemo(
|
||||
() => (embeddablesService ? Array.from(embeddablesService.getEmbeddableFactories()) : []),
|
||||
|
@ -161,7 +155,6 @@ export const EditorMenu: FC<Props> = ({ addElement }) => {
|
|||
createNewVisType={createNewVisType}
|
||||
createNewEmbeddable={createNewEmbeddable}
|
||||
promotedVisTypes={promotedVisTypes}
|
||||
isDarkThemeEnabled={IS_DARK_THEME}
|
||||
factories={factories}
|
||||
visTypeAliases={visTypeAliases}
|
||||
/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue