Skip to content

Commit

Permalink
[Playground] EuiBeacon (#3900)
Browse files Browse the repository at this point in the history
  • Loading branch information
anishagg17 authored Aug 12, 2020
1 parent 38c2319 commit 80012da
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src-docs/src/views/beacon/beacon_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { GuideSectionTypes } from '../../components';

import { EuiBeacon, EuiText } from '../../../../src/components';

import { beaconConfig } from './playground';

import Beacon from './beacon';
const beaconSource = require('!!raw-loader!./beacon');
const beaconHtml = renderToHtml(Beacon);
Expand Down Expand Up @@ -38,4 +40,5 @@ export const BeaconExample = {
demo: <Beacon />,
},
],
playground: beaconConfig,
};
31 changes: 31 additions & 0 deletions src-docs/src/views/beacon/playground.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { PropTypes } from 'react-view';
import { EuiBeacon } from '../../../../src/components/';
import { propUtilityForPlayground } from '../../services/playground';

export const beaconConfig = () => {
const docgenInfo = Array.isArray(EuiBeacon.__docgenInfo)
? EuiBeacon.__docgenInfo[0]
: EuiBeacon.__docgenInfo;
const propsToUse = propUtilityForPlayground(docgenInfo.props);

propsToUse.size = {
...propsToUse.size,
type: PropTypes.Number,
defaultValue: 12,
};

return {
config: {
componentName: 'EuiBeacon',
props: propsToUse,
scope: {
EuiBeacon,
},
imports: {
'@elastic/eui': {
named: ['EuiBeacon'],
},
},
},
};
};

0 comments on commit 80012da

Please sign in to comment.