Modernize to 2025 standards: React 19, Vite 6, ESLint 9, @dnd-kit migration

This commit is contained in:
alexsparkes
2025-10-27 23:19:35 +00:00
parent 7d432dc6f5
commit 04679ba1f6
12 changed files with 591 additions and 261 deletions

View File

@@ -96,17 +96,31 @@ class Favourite extends PureComponent {
}
}
componentDidMount() {
this.updateTooltip();
}
componentDidUpdate(prevProps, prevState) {
if (prevState.favourited !== this.state.favourited) {
this.updateTooltip();
}
}
updateTooltip() {
if (this.props.tooltipText) {
this.props.tooltipText(
localStorage.getItem('favourite')
? variables.getMessage('widgets.quote.unfavourite')
: variables.getMessage('widgets.quote.favourite'),
);
}
}
render() {
if (localStorage.getItem('backgroundType') === 'colour') {
return null;
}
this.props.tooltipText(
localStorage.getItem('favourite')
? variables.getMessage('widgets.quote.unfavourite')
: variables.getMessage('widgets.quote.favourite'),
);
return this.state.favourited;
}
}