Skip to content

Commit

Permalink
Fix header image declarations
Browse files Browse the repository at this point in the history
  • Loading branch information
kpollich committed Jun 21, 2021
1 parent ff8dbcd commit fe2f2f3
Showing 1 changed file with 31 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
* 2.0.
*/
import React, { memo } from 'react';
import { EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiText } from '@elastic/eui';
import { EuiFlexGroup, EuiFlexItem, EuiImage, EuiSpacer, EuiText } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';

import { useLink } from '../../../hooks';
import { i18n } from '@kbn/i18n';

import styled from 'styled-components';

import { useLink, useStartServices } from '../../../hooks';
import type { Section } from '../sections';

import { HeroImage } from '../sections/epm/screens/home/header';
import { useLinks } from '../hooks';

import { WithHeaderLayout } from './';

Expand All @@ -20,6 +24,30 @@ interface Props {
children?: React.ReactNode;
}

const Illustration = styled(EuiImage)`
margin-bottom: -68px;
width: 80%;
`;

const HeroImage = memo(() => {
const { toAssets } = useLinks();
const { uiSettings } = useStartServices();
const IS_DARK_THEME = uiSettings.get('theme:darkMode');

return (
<Illustration
alt={i18n.translate('xpack.fleet.epm.illustrationAltText', {
defaultMessage: 'Illustration of an integration',
})}
url={
IS_DARK_THEME
? toAssets('illustration_integrations_darkmode.svg')
: toAssets('illustration_integrations_lightmode.svg')
}
/>
);
});

export const DefaultLayout: React.FunctionComponent<Props> = memo(({ section, children }) => {
const { getHref } = useLink();

Expand Down

0 comments on commit fe2f2f3

Please sign in to comment.