From fc9b84166b9fc5c2d33a10876a372e5c3e41449e Mon Sep 17 00:00:00 2001 From: soupette Date: Tue, 24 Aug 2021 10:58:04 +0200 Subject: [PATCH] Migrated LoadingIndicatorPage component to new DS Signed-off-by: soupette --- .../core/helper-plugin/.storybook/preview.js | 12 ++++++++++ packages/core/helper-plugin/babel.config.js | 5 ++++- .../LoadingIndicatorPage.stories.mdx | 20 +++++++++++++++++ .../components/LoadingIndicatorPage/index.js | 22 +++++++++++++++++++ packages/core/helper-plugin/lib/src/index.js | 2 +- 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 packages/core/helper-plugin/lib/src/components/LoadingIndicatorPage/LoadingIndicatorPage.stories.mdx create mode 100644 packages/core/helper-plugin/lib/src/components/LoadingIndicatorPage/index.js diff --git a/packages/core/helper-plugin/.storybook/preview.js b/packages/core/helper-plugin/.storybook/preview.js index d3914580a7..9c7b3b6e85 100644 --- a/packages/core/helper-plugin/.storybook/preview.js +++ b/packages/core/helper-plugin/.storybook/preview.js @@ -1,3 +1,5 @@ +import { ThemeProvider, lightTheme } from '@strapi/parts'; + export const parameters = { actions: { argTypesRegex: '^on[A-Z].*' }, controls: { @@ -7,3 +9,13 @@ export const parameters = { }, }, }; + +export const decorators = [ + Story => ( + +
+ +
+
+ ), +]; diff --git a/packages/core/helper-plugin/babel.config.js b/packages/core/helper-plugin/babel.config.js index 41108a2482..3c7d26ca7a 100644 --- a/packages/core/helper-plugin/babel.config.js +++ b/packages/core/helper-plugin/babel.config.js @@ -3,6 +3,7 @@ const defaultPresets = [ '@babel/preset-env', { modules: 'commonjs', + loose: true, }, ], ]; @@ -10,7 +11,9 @@ const defaultPresets = [ module.exports = { presets: defaultPresets.concat(['@babel/preset-react', '@babel/preset-flow']), plugins: [ - '@babel/plugin-proposal-class-properties', + ['@babel/plugin-proposal-class-properties', { loose: true }], + ['@babel/plugin-proposal-private-property-in-object', { loose: true }], + ['@babel/plugin-proposal-private-methods', { loose: true }], '@babel/plugin-proposal-export-default-from', '@babel/plugin-proposal-export-namespace-from', '@babel/plugin-proposal-function-bind', diff --git a/packages/core/helper-plugin/lib/src/components/LoadingIndicatorPage/LoadingIndicatorPage.stories.mdx b/packages/core/helper-plugin/lib/src/components/LoadingIndicatorPage/LoadingIndicatorPage.stories.mdx new file mode 100644 index 0000000000..756befac33 --- /dev/null +++ b/packages/core/helper-plugin/lib/src/components/LoadingIndicatorPage/LoadingIndicatorPage.stories.mdx @@ -0,0 +1,20 @@ + + +import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks'; +import LoadingIndicatorPage from './index'; + + + +# LoadingIndicatorPage + +This is the doc of the `LoadingIndicatorPage` component + +## LoadingIndicatorPage + +Description... + + + + + + diff --git a/packages/core/helper-plugin/lib/src/components/LoadingIndicatorPage/index.js b/packages/core/helper-plugin/lib/src/components/LoadingIndicatorPage/index.js new file mode 100644 index 0000000000..df44046b0e --- /dev/null +++ b/packages/core/helper-plugin/lib/src/components/LoadingIndicatorPage/index.js @@ -0,0 +1,22 @@ +import React from 'react'; +import { Loader } from '@strapi/parts/Loader'; +import { Row } from '@strapi/parts/Row'; +import PropTypes from 'prop-types'; + +const LoadingIndicatorPage = ({ 'data-testid': dataTestId, ...rest }) => { + return ( + + Loading content. + + ); +}; + +LoadingIndicatorPage.defaultProps = { + 'data-testid': 'loader', +}; + +LoadingIndicatorPage.propTypes = { + 'data-testid': PropTypes.string, +}; + +export default LoadingIndicatorPage; diff --git a/packages/core/helper-plugin/lib/src/index.js b/packages/core/helper-plugin/lib/src/index.js index 9d7253999f..003c6d7128 100644 --- a/packages/core/helper-plugin/lib/src/index.js +++ b/packages/core/helper-plugin/lib/src/index.js @@ -67,7 +67,6 @@ export { default as ListTitle } from './old/components/ListTitle'; export { default as LoadingBar } from './old/components/LoadingBar'; export { default as LoadingIndicator } from './old/components/LoadingIndicator'; -export { default as LoadingIndicatorPage } from './old/components/LoadingIndicatorPage'; export { default as ModalConfirm } from './old/components/ModalConfirm'; export { default as Modal } from './old/components/Modal'; @@ -175,3 +174,4 @@ export { default as SearchIcon } from './old/svgs/Search'; export { default as CheckPagePermissions } from './components/CheckPagePermissions'; export { default as CheckPermissions } from './components/CheckPermissions'; export * from './components/InjectionZone'; +export { default as LoadingIndicatorPage } from './components/LoadingIndicatorPage';