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

Add story for InlineSystemMessage #9198

Merged
merged 2 commits into from
May 27, 2022
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: 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,
};