Skip to content

Commit ac8c656

Browse files
committed
rename Error to Notice
1 parent a1d9c5c commit ac8c656

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/components/Error/Error.jsx renamed to src/components/Notice/Notice.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import React, { useState } from 'react'
33
import PropTypes from 'prop-types'
44
import { Alert, Button, Container } from 'react-bootstrap'
55

6-
const Error = ({ alert, buttonProps, dismissible, withBackButton }) => {
6+
const Notice = ({ alert, buttonProps, dismissible, withBackButton }) => {
77
const [show, setShow] = useState(true)
88
const { title, body, variant } = alert
99
let onClick, text
@@ -38,7 +38,7 @@ const Error = ({ alert, buttonProps, dismissible, withBackButton }) => {
3838
)
3939
}
4040

41-
Error.propTypes = {
41+
Notice.propTypes = {
4242
alert: PropTypes.shape({
4343
body: PropTypes.arrayOf(PropTypes.string).isRequired,
4444
title: PropTypes.string,
@@ -52,12 +52,12 @@ Error.propTypes = {
5252
withBackButton: PropTypes.bool,
5353
}
5454

55-
Error.defaultProps = {
55+
Notice.defaultProps = {
5656
buttonProps: {
5757
text: 'Click to return to the previous page.'
5858
},
5959
dismissible: true,
6060
withBackButton: false,
6161
}
6262

63-
export default Error
63+
export default Notice

src/components/Error/Error.stories.jsx renamed to src/components/Notice/Notice.stories.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import React from 'react'
2-
import Error from './Error'
2+
import Notice from './Notice'
33

44
export default {
5-
title: 'Components/Error',
6-
component: Error,
5+
title: 'Components/Notice',
6+
component: Notice,
77
}
88

9-
const Template = (args) => <Error {...args} />
9+
const Template = (args) => <Notice {...args} />
1010

1111
export const Default = Template.bind({})
1212
Default.args = {
@@ -22,8 +22,8 @@ Default.args = {
2222
withBackButton: false,
2323
}
2424

25-
export const WithError = Template.bind({})
26-
WithError.args = {
25+
export const Error = Template.bind({})
26+
Error.args = {
2727
alert: {
2828
title: "We're sorry, something went wrong.",
2929
body: ['This is how an error would present in dev. There are instances where there may be several api errors on a single page. We would render them all.', 'This is a second error message.', 'This is a third error message.'],

src/components/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import AdditionalInfo from './AdditionalInfo/AdditionalInfo'
77
import BlankRequestForm from './BlankRequestForm/BlankRequestForm'
88
import Button from './Button/Button'
99
import CollapsibleSection from './CollapsibleSection/CollapsibleSection'
10-
import Error from './Error/Error'
1110
import Image from './Image/Image'
1211
import Link from './Link/Link'
1312
import Loading from './Loading/Loading'
13+
import Notice from './Notice/Notice'
1414
import SearchBar from './SearchBar/SearchBar'
1515
import ShippingDetails from './ShippingDetails/ShippingDetails'
1616
import SocialIcon from './SocialIcon/SocialIcon'
@@ -23,10 +23,10 @@ export {
2323
BlankRequestForm,
2424
Button,
2525
CollapsibleSection,
26-
Error,
2726
Image,
2827
Link,
2928
Loading,
29+
Notice,
3030
SearchBar,
3131
ShippingDetails,
3232
SocialIcon,

0 commit comments

Comments
 (0)