mirror of
https://github.com/mue/mue.git
synced 2026-07-23 16:57:25 +02:00
Modernize to 2025 standards: React 19, Vite 6, ESLint 9, @dnd-kit migration
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user