Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DP-10502: Adding ButtonFixedFeedback component #274

Merged
merged 2 commits into from
Sep 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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