fix: stats localisation, marketplace title

This commit is contained in:
David Ralph
2026-01-24 15:33:19 +00:00
parent f58ad986da
commit 8beda77a76
72 changed files with 145 additions and 79 deletions

View File

@@ -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' }}>

View File

@@ -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,
});
}

View File

@@ -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',