Fixed text color on preview

This commit is contained in:
Liam 2022-10-10 19:50:02 +01:00
parent e703712bfb
commit cd406a3e74
2 changed files with 7 additions and 7 deletions

@ -65,7 +65,7 @@ export default class Home extends Component {
values += `&${value[0]}=${value[1]}`; values += `&${value[0]}=${value[1]}`;
}); });
return window.location.origin + "/overlay?id=" + this.state.steamId + values + (withTc ? "&tc=black" : ""); return window.location.origin + "/overlay?id=" + this.state.steamId + values + (withTc ? "&textColor=black" : "");
} }
updateValue(key, value) { updateValue(key, value) {

@ -23,7 +23,7 @@ export default class Overlay extends Component {
showPlayerStats: true, showPlayerStats: true,
showScore: false, showScore: false,
showSongInfo: false, showSongInfo: false,
backgroundColor: undefined, textColor: undefined,
socket: undefined, socket: undefined,
isVisible: false, isVisible: false,
@ -124,8 +124,8 @@ export default class Overlay extends Component {
} }
// Mainly used for the preview // Mainly used for the preview
if (params.withTc) { if (params.textColor) {
this.setState({ backgroundColor: params.withTc }); this.setState({ textColor: params.textColor });
} }
if (shouldConnectSocket) { if (shouldConnectSocket) {
@ -316,9 +316,9 @@ export default class Overlay extends Component {
body.style.backgroundColor = "#181a1b"; body.style.backgroundColor = "#181a1b";
} }
if (this.state.backgroundColor !== undefined) { if (this.state.textColor !== undefined) {
const body = document.body; const element = document.querySelector("." + styles.main);
body.style.color = "#" + this.state.backgroundColor; element.style.color = this.state.textColor
} }
return <div className={styles.main}> return <div className={styles.main}>