Skip to content

Commit

Permalink
Use theme hook for dark mode setting
Browse files Browse the repository at this point in the history
  • Loading branch information
kpollich committed Jun 21, 2021
1 parent fe2f2f3 commit ec83c54
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ import { FormattedMessage } from '@kbn/i18n/react';

import { i18n } from '@kbn/i18n';

import styled from 'styled-components';
import styled, { useTheme } from 'styled-components';

import { useLink, useStartServices } from '../../../hooks';
import type { EuiTheme } from 'src/plugins/kibana_react/common';

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

import { useLinks } from '../hooks';
Expand All @@ -31,8 +33,8 @@ const Illustration = styled(EuiImage)`

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

return (
<Illustration
Expand Down

0 comments on commit ec83c54

Please sign in to comment.