Skip to content

Commit

Permalink
[ML] Fix Data Visualizer responsive layout (elastic#56372)
Browse files Browse the repository at this point in the history
* [ML] replace Example component with EuiListGroup

* [ML] center alignment
  • Loading branch information
darnautov committed Jan 31, 2020
1 parent 01368c8 commit 7d78fe3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 36 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@

import React, { FC } from 'react';

import { EuiSpacer, EuiText } from '@elastic/eui';
import { EuiListGroup, EuiListGroupItem, EuiSpacer, EuiText } from '@elastic/eui';

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

import { Example } from './example';

interface Props {
examples: Array<string | object>;
}
Expand All @@ -22,7 +20,14 @@ export const ExamplesList: FC<Props> = ({ examples }) => {
}

const examplesContent = examples.map((example, i) => {
return <Example key={`example_${i}`} example={example} />;
return (
<EuiListGroupItem
style={{ padding: 0, justifyContent: 'center' }}
size="xs"
key={`example_${i}`}
label={typeof example === 'string' ? example : JSON.stringify(example)}
/>
);
});

return (
Expand All @@ -39,7 +44,9 @@ export const ExamplesList: FC<Props> = ({ examples }) => {
</h6>
</EuiText>
<EuiSpacer size="s" />
{examplesContent}
<EuiListGroup flush={true} showToolTips={true}>
{examplesContent}
</EuiListGroup>
</div>
);
};

0 comments on commit 7d78fe3

Please sign in to comment.