diff --git a/changelogs/DP-10502.text b/changelogs/DP-10502.text new file mode 100644 index 0000000000..2a242625e0 --- /dev/null +++ b/changelogs/DP-10502.text @@ -0,0 +1,4 @@ +___DESCRIPTION___ +Added +Minor +- (React) DP-10502: Adds ButtonFixedFeedback component. diff --git a/react/backstop/data/bitmaps_reference/vrt_atoms_buttons_ButtonFixedFeedback_0_document_0_small_atom.png b/react/backstop/data/bitmaps_reference/vrt_atoms_buttons_ButtonFixedFeedback_0_document_0_small_atom.png new file mode 100644 index 0000000000..543a319f46 Binary files /dev/null and b/react/backstop/data/bitmaps_reference/vrt_atoms_buttons_ButtonFixedFeedback_0_document_0_small_atom.png differ diff --git a/react/src/components/atoms/buttons/ButtonFixedFeedback/ButtonFixedFeedback.stories.js b/react/src/components/atoms/buttons/ButtonFixedFeedback/ButtonFixedFeedback.stories.js new file mode 100644 index 0000000000..8d6d16f958 --- /dev/null +++ b/react/src/components/atoms/buttons/ButtonFixedFeedback/ButtonFixedFeedback.stories.js @@ -0,0 +1,19 @@ +import React from 'react'; + +import { storiesOf } from '@storybook/react'; +import { withInfo } from '@storybook/addon-info'; +import { withKnobs, text } from '@storybook/addon-knobs/react'; + +import ButtonFixedFeedback from './index'; + +storiesOf('atoms/buttons', module) + .addDecorator(withKnobs) + .add('ButtonFixedFeedback', withInfo(`
A fixed position feedback button
`)(() => { + const props = { + href: text('ButtonFixedFeedbackOptions.href', '#'), + text: text('ButtonFixedFeedbackOptions.text', 'Feedback') + }; + return( + + ); + })); diff --git a/react/src/components/atoms/buttons/ButtonFixedFeedback/index.js b/react/src/components/atoms/buttons/ButtonFixedFeedback/index.js new file mode 100644 index 0000000000..ba5d3735bf --- /dev/null +++ b/react/src/components/atoms/buttons/ButtonFixedFeedback/index.js @@ -0,0 +1,24 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +import './style.css'; + +const ButtonFixedFeedback = (props) => ( +
+ {props.text} +
+); + +ButtonFixedFeedback.propTypes = { + href: PropTypes.string, + text: PropTypes.string +} + +ButtonFixedFeedback.defaultProps = { + href: '#', + text: 'Feedback', +} + +export default ButtonFixedFeedback; diff --git a/react/src/components/atoms/buttons/ButtonFixedFeedback/style.scss b/react/src/components/atoms/buttons/ButtonFixedFeedback/style.scss new file mode 100644 index 0000000000..fbe134b91d --- /dev/null +++ b/react/src/components/atoms/buttons/ButtonFixedFeedback/style.scss @@ -0,0 +1,3 @@ +@import 'global'; +@import '00-base/z-index'; +@import "01-atoms/fixed-feedback-button"; diff --git a/react/src/index.js b/react/src/index.js index f716fe7a9b..75c5ef5b7d 100644 --- a/react/src/index.js +++ b/react/src/index.js @@ -13,6 +13,7 @@ export Button from './components/atoms/buttons/Button'; export ButtonSort from './components/atoms/buttons/ButtonSort'; export ButtonToggle from './components/atoms/buttons/ButtonToggle'; export ButtonWithIcon from './components/atoms/buttons/ButtonWithIcon'; +export ButtonFixedFeedback from './components/atoms/buttons/ButtonFixedFeedback'; // @atoms/@forms export HelperText from './components/atoms/forms/HelperText'; export ErrorMessage from './components/atoms/forms/ErrorMessage';