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

Theming option tab not showing #68

Closed
RHeynsZa opened this issue Jun 2, 2022 · 5 comments
Closed

Theming option tab not showing #68

RHeynsZa opened this issue Jun 2, 2022 · 5 comments
Labels

Comments

@RHeynsZa
Copy link

RHeynsZa commented Jun 2, 2022

Was the theming option removed recently? Im having the same issue as #28

My setup looks like this:

import { createTheme, ThemeProvider } from '@material-ui/core';
import { withThemes  } from '@react-theming/storybook-addon';
import themes from '../src/themes';

import { red } from '@material-ui/core/colors';

export const parameters = {
  actions: { argTypesRegex: "^on[A-Z].*" },
  controls: {
    matchers: {
      color: /(background|color)$/i,
      date: /Date$/,
    },
  },
};


// A custom theme for this app
const theme = {
  palette: {
    primary: {
      main: '#556cd6',
    },
    secondary: {
      main: '#19857b',
    },
    error: {
      main: red.A400,
    },
    background: {
      default: '#fff',
    },
  },
};

const providerFn = ({ theme, children }) => {
  const muiTheme = createTheme(theme);
  return (
    <ThemeProvider theme={muiTheme}>{children}</ThemeProvider>
  );
};

const themingDecorator = withThemes(null, [ themes.new, theme ], { providerFn });

export const decorators = [
  themingDecorator,
];
@usulpro
Copy link
Member

usulpro commented Jun 13, 2022

Hey @RHeynsZa
Could you please clarify what exactly is missing in your storybook? Did you specify this addon in main.js -> addons section?

@morleytatro
Copy link

Seeing the same issue, where the theme option just doesn't show on the control panel. Strange because it was working before; no idea what changed.

Screen Shot 2022-06-17 at 9 41 02 AM

@morleytatro
Copy link

Really weird. After disabling all other addons but this one and then progressively bringing them back, everything's working again.

@usulpro
Copy link
Member

usulpro commented Jun 21, 2022

It loooks like this issue appears with React 18
At least I fased this after updating React major version

@stale
Copy link

stale bot commented Oct 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 19, 2022
@stale stale bot closed this as completed Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants