ELECTRON-1346 - Fix notification text color (#717)

This commit is contained in:
Kiran Niranjan
2019-07-11 17:26:31 +05:30
committed by Vishwas Shashidhar
parent bcf649e63b
commit 313fe5fc46

View File

@@ -53,8 +53,8 @@ export default class NotificationComp extends React.Component<{}, IState> {
*/
public render(): JSX.Element {
const { title, company, body, image, icon, id, color } = this.state;
const colorHex = color ? '#' + color : undefined;
const isLightTheme = colorHex ? colorHex.match(whiteColorRegExp) : true;
const colorHex = (color && !color.startsWith('#')) ? '#' + color : color;
const isLightTheme = (colorHex && colorHex.match(whiteColorRegExp)) || true;
const theme = classNames({ light: isLightTheme, dark: !isLightTheme });
const bgColor = { backgroundColor: colorHex || '#ffffff' };