Skip to content

Commit

Permalink
DP-10502: Adding ButtonFixedFeedback component (#274)
Browse files Browse the repository at this point in the history
* DP-10502: Adding ButtonFixedFeedback component

* DP-10502: changelog
  • Loading branch information
Mark Casias authored and avrilpearl committed Sep 27, 2018
1 parent d051230 commit 51fb461
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 0 deletions.
4 changes: 4 additions & 0 deletions changelogs/DP-10502.text
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
___DESCRIPTION___
Added
Minor
- (React) DP-10502: Adds ButtonFixedFeedback component.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -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(`<div>A fixed position feedback button</div>`)(() => {
const props = {
href: text('ButtonFixedFeedbackOptions.href', '#'),
text: text('ButtonFixedFeedbackOptions.text', 'Feedback')
};
return(
<ButtonFixedFeedback {...props} />
);
}));
24 changes: 24 additions & 0 deletions react/src/components/atoms/buttons/ButtonFixedFeedback/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import PropTypes from 'prop-types';

import './style.css';

const ButtonFixedFeedback = (props) => (
<div
className="ma__fixed-feedback-button"
>
<a href={props.href}>{props.text}</a>
</div>
);

ButtonFixedFeedback.propTypes = {
href: PropTypes.string,
text: PropTypes.string
}

ButtonFixedFeedback.defaultProps = {
href: '#',
text: 'Feedback',
}

export default ButtonFixedFeedback;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@import 'global';
@import '00-base/z-index';
@import "01-atoms/fixed-feedback-button";
1 change: 1 addition & 0 deletions react/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 51fb461

Please sign in to comment.