Senior Software Engineer
at MicroMech
Webpack!
const typographyStyles = (): StyleRules => createStyles({...})
const TypographyComponent: React.FC<TypographyProps> = () => {...}
export const Typography = withStyles(typographyStyles)(TypographyComponent)
A component to add an empty space with controllable height based on default theme gutter value
| Name | Required | type | Default Value | Description |
| ---------------- | -------- | ------ | ------------- | ----------------------------------- |
| gutterMultiplier | - | number | 1 | Multiplier to default theme gutter |
| data-test-id | - | string | - | Custom data-test-id attribute value |
### Example:
```js
import { Spacer } from '@motokaptia/cotton';
<>
<SomeBlock />
<Spacer />
<SomeOtherBlock />
</>;
```
function createStyleContext() {
return {
sheetsManager: new Map(),
sheetsRegistry: new SheetsRegistry(),
generateClassName: createGenerateClassName()
};
}
export function getStyleContext() {
if (!process.browser) {
return createStyleContext();
}
if (!global.__INIT_MATERIAL_UI__) {
global.__INIT_MATERIAL_UI__ = createStyleContext();
}
return global.__INIT_MATERIAL_UI__;
}
jest.mock('@material-ui/core/styles/createGenerateClassName');
createGenerateClassName.mockImplementation(() => (rule, styleSheet) =>
`${styleSheet.options.classNamePrefix}-${rule.key}`
);