grafana/ui: Enable mdx imports in stories (#19937)

This commit is contained in:
Dominik Prokop 2019-10-22 09:05:14 +02:00 committed by GitHub
parent 80a6853fd4
commit 2a8762f6a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 3 deletions

View File

@ -73,7 +73,7 @@ module.exports = ({ config, mode }) => {
],
});
config.resolve.extensions.push('.ts', '.tsx');
config.resolve.extensions.push('.ts', '.tsx', '.mdx');
config.stats = {
warningsFilter: /export .* was not found in/,
};

View File

@ -0,0 +1,3 @@
# Switch
A basic docs for Switch component

View File

@ -1,14 +1,16 @@
import React, { useState } from 'react';
// import { storiesOf } from '@storybook/react';
// import { withCenteredStory } from '../../utils/storybook/withCenteredStory';
import { Switch } from './Switch';
import { text } from '@storybook/addon-knobs';
import mdx from './Switch.mdx';
const getStory = (title: string, component: any) => ({
title,
parameters: {
component,
docs: {
page: mdx,
},
},
});

View File

@ -0,0 +1,4 @@
declare module '*.mdx' {
let MDXComponent: (props: any) => JSX.Element;
export default MDXComponent;
}