mirror of
https://github.com/mue/mue.git
synced 2026-07-16 13:34:03 +02:00
fix: stats localisation, marketplace title
This commit is contained in:
@@ -15,15 +15,19 @@ export default function AuthorInfoLegacy({
|
||||
<>
|
||||
<div>
|
||||
<h1 className="quoteauthor">
|
||||
<a
|
||||
href={authorlink}
|
||||
className="quoteAuthorLink"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
aria-label="Learn about the author of the quote."
|
||||
>
|
||||
{author}
|
||||
</a>
|
||||
{authorlink ? (
|
||||
<a
|
||||
href={authorlink}
|
||||
className="quoteAuthorLink"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
aria-label="Learn about the author of the quote."
|
||||
>
|
||||
{author}
|
||||
</a>
|
||||
) : (
|
||||
<span>{author}</span>
|
||||
)}
|
||||
</h1>
|
||||
</div>
|
||||
<div style={{ display: 'flex', justifyContent: 'center', gap: '20px' }}>
|
||||
|
||||
@@ -137,15 +137,17 @@ export function useQuoteLoader(updateQuote) {
|
||||
.flatMap(item => item.quotes.map(quote => ({
|
||||
...quote,
|
||||
fallbackauthorimg: item.icon_url,
|
||||
packName: item.display_name || item.name,
|
||||
})));
|
||||
|
||||
if (quotePack.length === 0) return doOffline();
|
||||
|
||||
const data = quotePack[Math.floor(Math.random() * quotePack.length)];
|
||||
const hasAuthor = data.author && data.author.trim() !== '';
|
||||
return updateQuote({
|
||||
quote: `"${data.quote}"`,
|
||||
author: data.author,
|
||||
authorlink: getAuthorLink(data.author),
|
||||
author: hasAuthor ? data.author : data.packName,
|
||||
authorlink: hasAuthor ? getAuthorLink(data.author) : null,
|
||||
authorimg: data.fallbackauthorimg,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -14,9 +14,6 @@ import {
|
||||
import { Checkbox, Dropdown } from 'components/Form/Settings';
|
||||
import { Button } from 'components/Elements';
|
||||
|
||||
import { toast } from 'react-toastify';
|
||||
import EventBus from 'utils/eventbus';
|
||||
|
||||
const QuoteOptions = () => {
|
||||
const getCustom = () => {
|
||||
let data = JSON.parse(localStorage.getItem('customQuote'));
|
||||
@@ -30,13 +27,6 @@ const QuoteOptions = () => {
|
||||
const [customQuote, setCustomQuote] = useState(getCustom());
|
||||
const [sourceSection, setSourceSection] = useState(false);
|
||||
|
||||
const resetCustom = () => {
|
||||
localStorage.setItem('customQuote', '[{"quote": "", "author": ""}]');
|
||||
setCustomQuote([{ quote: '', author: '' }]);
|
||||
toast(variables.getMessage('toasts.reset'));
|
||||
EventBus.emit('refresh', 'background');
|
||||
};
|
||||
|
||||
const handleCustomQuote = (e, text, index, type) => {
|
||||
const result = text === true ? e.target.value : e.target.result;
|
||||
|
||||
@@ -102,7 +92,7 @@ const QuoteOptions = () => {
|
||||
items={[
|
||||
localStorage.getItem('quote_packs') && {
|
||||
value: 'quote_pack',
|
||||
text: variables.getMessage('modals.main.navbar.marketplace'),
|
||||
text: variables.getMessage('modals.main.marketplace.title'),
|
||||
},
|
||||
{
|
||||
value: 'api',
|
||||
|
||||
Reference in New Issue
Block a user