Fulfill compliance with tslint.json

This commit is contained in:
Neek Sandhu
2017-07-17 23:03:38 -07:00
committed by GitHub
parent 1c3089e2a8
commit ed7bf7126e

View File

@@ -1,21 +1,21 @@
import styles from './main.css'
import * as classNames from 'classnames'
import styles from './main.sass';
import * as classNames from 'classnames';
class App {
private theme: string
private theme: string;
constructor(theme: string) {
this.theme = theme
this.theme = theme;
}
render() {
// as a style tag (using webpack's css-loader)
const tpl = `<div style="${styles.toString()}"></div>`
const tpl = `<div style="${styles.toString()}"></div>`;
// or as scoped unique classes, also latest typescript versions allow prop access using dot like styles.darkUI instead of styles['darkUI']
return `
<div class="${classNames((this.theme === 'dark')?
styles['darkUI'] :
styles['lightUI'].toString())}">
<div class="${classNames((this.theme === 'dark') ?
styles.darkUI :
styles.lightUI.toString())}">
</div>
`
`;
}
}