Skip to content

Commit

Permalink
Merge pull request #9198 from Expensify/Rory-CleanupInlineSystemMessage
Browse files Browse the repository at this point in the history
Add story for InlineSystemMessage
  • Loading branch information
Gonals authored May 27, 2022
2 parents fea507b + 17aaf24 commit 3780ccd
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/InlineSystemMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import React from 'react';
import {View} from 'react-native';
import PropTypes from 'prop-types';
import styles from '../styles/styles';
import theme from '../styles/themes/default';
import Text from './Text';
import * as Expensicons from './Icon/Expensicons';
import colors from '../styles/colors';
import Icon from './Icon';

const propTypes = {
Expand All @@ -18,7 +18,7 @@ const InlineSystemMessage = (props) => {
}
return (
<View style={[styles.flexRow, styles.alignItemsCenter]}>
<Icon src={Expensicons.Exclamation} fill={colors.red} />
<Icon src={Expensicons.Exclamation} fill={theme.badgeDangerBG} />
<Text style={[styles.inlineSystemMessage]}>{props.message}</Text>
</View>
);
Expand Down
27 changes: 27 additions & 0 deletions src/stories/InlineSystemMessage.stories.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React from 'react';
import InlineSystemMessage from '../components/InlineSystemMessage';

/**
* We use the Component Story Format for writing stories. Follow the docs here:
*
* https://storybook.js.org/docs/react/writing-stories/introduction#component-story-format
*/
const story = {
title: 'Components/InlineSystemMessage',
component: InlineSystemMessage,
};

// eslint-disable-next-line react/jsx-props-no-spreading
const Template = args => <InlineSystemMessage {...args} />;

// Arguments can be passed to the component by binding
// See: https://storybook.js.org/docs/react/writing-stories/introduction#using-args
const Default = Template.bind({});
Default.args = {
message: 'This is an error message',
};

export default story;
export {
Default,
};

0 comments on commit 3780ccd

Please sign in to comment.