Skip to content

Commit

Permalink
fix(react-experiments): tweak type errors exposed in ts 4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Hotell committed May 30, 2023
1 parent 1de8d6c commit b4c0273
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export class ThemeGeneratorPage extends React.Component<{}, IThemeGeneratorPageS
ThemeGenerator.insureSlots(themeRules, isDark(themeRules[BaseSlots[BaseSlots.backgroundColor]].color!));

this.state = {
themeRules: themeRules,
themeRules,
colorPickerSlotRule: null,
colorPickerElement: null,
colorPickerVisible: false,
Expand Down Expand Up @@ -227,7 +227,7 @@ export class ThemeGeneratorPage extends React.Component<{}, IThemeGeneratorPageS
true,
true,
);
this.setState({ themeRules: themeRules }, this._makeNewTheme);
this.setState({ themeRules }, this._makeNewTheme);
}, 20);
// 20ms is low enough that you can slowly drag to change color and see that theme,
// but high enough that quick changes don't get bogged down by a million changes in-between
Expand Down Expand Up @@ -289,6 +289,7 @@ export class ThemeGeneratorPage extends React.Component<{}, IThemeGeneratorPageS

const contrastRatio = getContrastRatio(bgc, fgc);
let contrastRatioString = String(contrastRatio);
// eslint-disable-next-line deprecation/deprecation
contrastRatioString = contrastRatioString.substr(0, contrastRatioString.indexOf('.') + 3);
if (contrastRatio < 4.5) {
contrastRatioString = '**' + contrastRatioString + '**';
Expand Down Expand Up @@ -413,7 +414,7 @@ export class ThemeGeneratorPage extends React.Component<{}, IThemeGeneratorPageS
// isInverted got swapped, so need to refresh slots with new shading rules
ThemeGenerator.insureSlots(themeRules, !currentIsDark);
}
this.setState({ themeRules: themeRules }, this._makeNewTheme);
this.setState({ themeRules }, this._makeNewTheme);
}, 20);
// 20ms is low enough that you can slowly drag to change color and see that theme,
// but high enough that quick changes don't get bogged down by a million changes in-between
Expand Down

0 comments on commit b4c0273

Please sign in to comment.