mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 03:34:40 +00:00
feat: proper gramatical naming for news sources
This commit is contained in:
@@ -183,18 +183,19 @@
|
|||||||
props: {
|
props: {
|
||||||
state: $settingsState.newsSource,
|
state: $settingsState.newsSource,
|
||||||
onChange: (value: string) => settingsState.newsSource = value,
|
onChange: (value: string) => settingsState.newsSource = value,
|
||||||
options: [
|
options: [
|
||||||
{ value: "australia", label: "Australia" },
|
{ value: "australia", label: "Australia" },
|
||||||
{ value: "usa", label: "USA" },
|
{ value: "usa", label: "USA" },
|
||||||
{ value: "taiwan", label: "Taiwan" },
|
{ value: "uk", label: "UK" },
|
||||||
{ value: "hong_kong", label: "Hong Kong" },
|
{ value: "taiwan", label: "Taiwan" },
|
||||||
{ value: "panama", label: "Panama" },
|
{ value: "hong_kong", label: "Hong Kong" },
|
||||||
{ value: "canada", label: "Canada" },
|
{ value: "panama", label: "Panama" },
|
||||||
{ value: "singapore", label: "Singapore" },
|
{ value: "canada", label: "Canada" },
|
||||||
{ value: "uk", label: "UK" },
|
{ value: "singapore", label: "Singapore" },
|
||||||
{ value: "japan", label: "Japan" },
|
{ value: "japan", label: "Japan" },
|
||||||
{ value: "netherlands", label: "Netherlands" }
|
{ value: "netherlands", label: "Netherlands" }
|
||||||
]
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
] as option}
|
] as option}
|
||||||
|
|||||||
@@ -18,12 +18,27 @@ export async function SendNewsPage() {
|
|||||||
const main = document.getElementById("main");
|
const main = document.getElementById("main");
|
||||||
main!.innerHTML = "";
|
main!.innerHTML = "";
|
||||||
|
|
||||||
|
const displayCountry = (() => {
|
||||||
|
switch (settingsState.newsSource?.toLowerCase()) {
|
||||||
|
case "usa": return "the USA";
|
||||||
|
case "uk": return "the UK";
|
||||||
|
case "netherlands": return "the Netherlands";
|
||||||
|
default:
|
||||||
|
return settingsState.newsSource
|
||||||
|
? settingsState.newsSource
|
||||||
|
.split("_")
|
||||||
|
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
|
||||||
|
.join(" ")
|
||||||
|
: "Australia";
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
|
||||||
const html = stringToHTML(/* html */ `
|
const html = stringToHTML(/* html */ `
|
||||||
<div class="home-root">
|
<div class="home-root">
|
||||||
<div class="home-container" id="news-container">
|
<div class="home-container" id="news-container">
|
||||||
<h1 class="border">Latest Headlines in ${settingsState.newsSource ? settingsState.newsSource.charAt(0).toUpperCase() + settingsState.newsSource.slice(1) : "Australia"}</h1>
|
<h1 class="border">Latest Headlines in ${displayCountry}</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>`);
|
</div>`);
|
||||||
|
|
||||||
main!.append(html.firstChild!);
|
main!.append(html.firstChild!);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user