Skip to content

added storybook example of themecontext.consumer #3612

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

Merged
merged 4 commits into from
Jan 21, 2020

Conversation

IanKBovard
Copy link
Contributor

What does this PR do?

Adds example for using themecontext.consumer to add theme properties to non grommet components

Where should the reviewer start?

src/js/contexts/ThemeContext/theme-context.stories.js

<div style={{ backgroundColor: theme.global.colors['neutral-3'] }}>
<p style={{ color: theme.global.colors['light-1'] }}>
{' '}
This is not a grommet component
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This is not a grommet component
This component is leveraging the grommet theme capabilities although it is not a grommet component

what do you think?

</Grommet>
);

storiesOf('Theme', module).add('Theme Context', () => <CustomDefaultProps />);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
storiesOf('Theme', module).add('Theme Context', () => <CustomDefaultProps />);
storiesOf('Theme', module).add('External components', () => <CustomDefaultProps />);

what do you think?

import { grommet } from 'grommet/themes';
import { Box, Text, ThemeContext, Grommet } from 'grommet';

const CustomDefaultProps = () => (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This component name doesn't make sense to me.
ExternalComponentWithTheme would make sense to me, feel free to make other suggestions.

changed name of component to ExternalComponentWithTheme
@ShimiSun ShimiSun merged commit 3809346 into grommet:master Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants