Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet';
import aphroditeInterface from 'react-with-styles-interface-aphrodite';
import { StyleSheetTestUtils } from 'aphrodite';
import DefaultTheme from '../../src/theme/DefaultTheme';
ThemedStyleSheet.registerTheme(DefaultTheme);
ThemedStyleSheet.registerInterface(aphroditeInterface);
beforeEach(() => {
StyleSheetTestUtils.suppressStyleInjection();
});
afterEach(() => {
StyleSheetTestUtils.clearBufferAndResumeStyleInjection();
});
import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet';
import AphroditeInterface from 'react-with-styles-interface-aphrodite';
import DefaultTheme from '../../src/themes/DefaultTheme';
const { WITH_DOM } = process.env;
const MockInterface = {
create: () => ({}),
resolve: () => ({}),
flush: () => {},
};
const stylesInterface = WITH_DOM ? AphroditeInterface : MockInterface;
ThemedStyleSheet.registerTheme(DefaultTheme);
ThemedStyleSheet.registerInterface(stylesInterface);
beforeEach(() => {
StyleSheetTestUtils.suppressStyleInjection();
});
afterEach(() => new Promise((resolve) => {
StyleSheetTestUtils.clearBufferAndResumeStyleInjection();
return process.nextTick(resolve);
}));
import PropTypes from 'prop-types';
import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet';
import aphroditeInterface from 'react-with-styles-interface-aphrodite';
import { css, withStyles, ThemeProvider } from 'react-with-styles';
import DefaultTheme from './DefaultTheme';
ThemedStyleSheet.registerDefaultTheme(DefaultTheme);
ThemedStyleSheet.registerInterface(aphroditeInterface);
const withStylesPropTypes = {
styles: PropTypes.object.isRequired,
theme: PropTypes.object.isRequired,
};
export { css, ThemedStyleSheet, ThemeProvider, withStyles, withStylesPropTypes };
import ThemedStyleSheet from 'react-with-styles/lib/ThemedStyleSheet'
import aphroditeInterface from 'react-with-styles-interface-aphrodite'
import { css, withStyles } from 'react-with-styles'
import MyDefaultTheme from './defaultTheme'
ThemedStyleSheet.registerTheme(MyDefaultTheme)
ThemedStyleSheet.registerInterface(aphroditeInterface)
export { css, withStyles, ThemedStyleSheet }
export default function registerInterfaceWithDefaultTheme(reactWithStylesInterface) {
ThemedStyleSheet.registerInterface(reactWithStylesInterface);
ThemedStyleSheet.registerTheme(DefaultTheme);
}