Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { StyleSheetTestUtils } from 'aphrodite';
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 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();
});
export default function registerInterfaceWithDefaultTheme(reactWithStylesInterface) {
ThemedStyleSheet.registerInterface(reactWithStylesInterface);
ThemedStyleSheet.registerTheme(DefaultTheme);
}
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 }