Skip to content

Commit

Permalink
fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
MiriamAparicio committed Dec 4, 2024
1 parent bd7a67a commit 30f592a
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React from 'react';
import { Chart, Metric, Settings } from '@elastic/charts';
import { EuiIcon, EuiPanel, UseEuiTheme, useEuiTheme } from '@elastic/eui';
import { EuiIcon, EuiPanel, type UseEuiTheme, useEuiTheme } from '@elastic/eui';
import type { PartialTheme, Theme } from '@elastic/charts';
import { i18n } from '@kbn/i18n';
import { COMPARATORS } from '@kbn/alerting-comparators';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { AppMountParameters, CoreStart } from '@kbn/core/public';
import React, { FC, PropsWithChildren } from 'react';
import { EuiThemeProvider } from '@elastic/eui';
import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render';
import { Storage } from '@kbn/kibana-utils-plugin/public';
Expand All @@ -34,11 +34,10 @@ export const CommonInfraProviders: FC<
}>
> = ({ children, triggersActionsUI, setHeaderActionMenu, appName, storage, theme$ }) => {
const darkMode = useIsDarkMode();
const colorMode = darkMode ? 'DARK' : 'LIGHT';

return (
<TriggersActionsProvider triggersActionsUI={triggersActionsUI}>
<EuiThemeProvider colorMode={colorMode}>
<EuiThemeProvider darkMode={darkMode}>
<DataUIProviders appName={appName} storage={storage}>
<HeaderActionMenuProvider setHeaderActionMenu={setHeaderActionMenu} theme$={theme$}>
<NavigationWarningPromptProvider>{children}</NavigationWarningPromptProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import { EuiIcon } from '@elastic/eui';
import styled from '@emotion/styled';
import { Theme } from '@emotion/react';
import type { Theme } from '@emotion/react';
import { QuerySuggestion, QuerySuggestionTypes } from '@kbn/unified-search-plugin/public';
import { transparentize } from 'polished';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,14 @@
* 2.0.
*/

import React from 'react';
import { EuiDatePicker, EuiDatePickerProps } from '@elastic/eui';
import styled from '@emotion/styled';
import React from 'react';
import styled, { type StyledComponent } from '@emotion/styled';

export const FixedDatePicker = styled(
// The return type of this component needs to be specified because the inferred
// return type depends on types that are not exported from EUI. You get a TS4023
// error if the return type is not specified.
export const FixedDatePicker: StyledComponent<EuiDatePickerProps> = styled(
({
className,
inputClassName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,29 @@
* 2.0.
*/

import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import styled from '@emotion/styled';
import { EuiFlexGroup, type EuiFlexGroupProps, EuiFlexItem, useEuiTheme } from '@elastic/eui';
import { css } from '@emotion/css';
import React from 'react';

export const LogStatusbar = styled(EuiFlexGroup)`
padding: ${(props) => props.theme.euiTheme.size.s};
border-top: ${(props) => props.theme.euiTheme.border.thin};
max-height: 48px;
min-height: 48px;
background-color: ${(props) => props.theme.euiTheme.colors.emptyShade};
flex-direction: row;
`;
export const LogStatusbar = (props: EuiFlexGroupProps) => {
const { euiTheme } = useEuiTheme();

LogStatusbar.defaultProps = { alignItems: 'center', gutterSize: 'none', justifyContent: 'flexEnd' };
return (
<EuiFlexGroup
alignItems="center"
gutterSize="none"
justifyContent="flexEnd"
css={css`
padding: ${euiTheme.size.s};
border-top: ${euiTheme.border.thin};
max-height: 48px;
min-height: 48px;
background-color: ${euiTheme.colors.emptyShade};
flex-direction: row;
`}
{...props}
/>
);
};

export const LogStatusbarItem = EuiFlexItem;
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import rt from 'io-ts';
import { PropsWithChildren } from 'react';
import { WithEuiThemeProps } from '@elastic/eui';
import type { WithEuiThemeProps } from '@elastic/eui';
import { InventoryFormatterTypeRT } from '@kbn/metrics-data-access-plugin/common';
import { MetricsTimeInput } from './hooks/use_metrics_time';
import { NodeDetailsMetricData } from '../../../../common/http_api/node_details_api';
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/observability_solution/infra/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"public/**/*",
"server/**/*",
"types/**/*",
// Emotion theme typing
"./emotion.d.ts"
],
"kbn_references": [
Expand Down

0 comments on commit 30f592a

Please sign in to comment.