@carbon/ibm-security
Version:
Carbon for Cloud & Cognitive IBM Security UI components
46 lines (45 loc) • 1.89 kB
JavaScript
/**
* @file ErrorPage section stories.
* @copyright IBM Security 2019
*/
import React from 'react';
import { storiesOf } from '@storybook/react';
import { text, select } from '@storybook/addon-knobs';
import { disableCenteredStories, patterns } from '../../../.storybook';
import { ErrorPage } from '../..';
import { InlineNotification, NotificationActionButton } from '../../';
import { Grid } from 'carbon-components-react';
var statusCodes = {
403: 403,
404: 404,
500: 500,
'Custom error': 'Custom'
};
var props = function props() {
return {
statusCode: select('Status codes (statusCode)', statusCodes, 403),
errorMessage: text('Error message (errorMessage)', ''),
errorName: text('Error name (errorName)', ''),
links: [{
id: text('Link id (links[0].id)', 'link-example-id'),
href: text('Link href (links[0].href)', '#'),
text: text('Link text (links[0].text)', 'Return to...')
}]
};
};
disableCenteredStories(storiesOf(patterns('ErrorPage#legacy'), module)).addDecorator(function (Story) {
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InlineNotification, {
className: "page-layouts__banner",
actions: /*#__PURE__*/React.createElement(NotificationActionButton, {
href: "https://v1-ibm-products.carbondesignsystem.com/?path=/story/ibm-products-patterns-http-errors-httperror403--with-all-props-set",
rel: "noopener noreferrer",
target: "_blank"
}, "View replacement"),
kind: "info",
subtitle: "Pattern no longer supported. The pattern will remain available, but plan to migrate to the pattern replacement.",
title: "",
hideCloseButton: true
}), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(Story, null)));
}).add('default', function () {
return /*#__PURE__*/React.createElement(ErrorPage, props());
});