Skip to content

Commit

Permalink
feat(Alert): Add question alert option
Browse files Browse the repository at this point in the history
close #98
  • Loading branch information
allyssonsantos committed Jul 13, 2019
1 parent 9aad7de commit e1a8422
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
10 changes: 8 additions & 2 deletions components/Alert/Alert.jsx
Expand Up @@ -3,7 +3,12 @@ import PropTypes from 'prop-types';
import styled from 'styled-components';
import Modal from '../Modal';

import { dialogError, dialogInfo, dialogWarning } from './alertImages';
import {
dialogError,
dialogInfo,
dialogQuestion,
dialogWarning,
} from './alertImages';

const Dialog = styled.div`
display: flex;
Expand All @@ -14,6 +19,7 @@ function imageDialog({ type }) {
const images = {
error: dialogError,
info: dialogInfo,
question: dialogQuestion,
warning: dialogWarning,
};

Expand Down Expand Up @@ -66,7 +72,7 @@ Alert.displayName = 'Alert';
Alert.propTypes = {
title: PropTypes.string.isRequired,
message: PropTypes.string.isRequired,
type: PropTypes.oneOf(['info', 'error', 'warning']),
type: PropTypes.oneOf(['info', 'error', 'question', 'warning']),
closeAlert: PropTypes.func,
};

Expand Down
3 changes: 2 additions & 1 deletion components/Alert/alertImages.js
@@ -1,5 +1,6 @@
import dialogError from '../shared/assets/pattern/dialog-error.png';
import dialogInfo from '../shared/assets/pattern/dialog-info.png';
import dialogQuestion from '../shared/assets/pattern/dialog-question.png';
import dialogWarning from '../shared/assets/pattern/dialog-warning.png';

export { dialogError, dialogInfo, dialogWarning };
export { dialogError, dialogInfo, dialogQuestion, dialogWarning };
2 changes: 2 additions & 0 deletions components/Icon/icons.js
Expand Up @@ -73,6 +73,7 @@ import printer from '../shared/assets/icons/printer.ico';
import printer_calendar from '../shared/assets/icons/printer_calendar.ico';
import printer_drive from '../shared/assets/icons/printer_drive.ico';
import printer_shared from '../shared/assets/icons/printer_shared.ico';
import question_bubble from '../shared/assets/icons/question_bubble.ico';
import reader_cd from '../shared/assets/icons/reader_cd.ico';
import reader_cd_2 from '../shared/assets/icons/reader_cd_2.ico';
import reader_closed from '../shared/assets/icons/reader_closed.ico';
Expand Down Expand Up @@ -232,6 +233,7 @@ const path = {
printer_calendar,
printer_drive,
printer_shared,
question_bubble,
reader_cd,
reader_cd_2,
reader_closed,
Expand Down
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion stories/alert.stories.js
Expand Up @@ -31,7 +31,7 @@ class AlertStory extends React.Component {
<div style={{ marginBottom: 10 }}>
Alert Type:{' '}
<Dropdown
options={['error', 'info', 'warning']}
options={['error', 'info', 'question', 'warning']}
onChange={this.onImageChange}
/>
</div>
Expand Down

0 comments on commit e1a8422

Please sign in to comment.