mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-05 19:24:39 +00:00
feat: proper gramatical naming for news sources
This commit is contained in:
@@ -183,18 +183,19 @@
|
||||
props: {
|
||||
state: $settingsState.newsSource,
|
||||
onChange: (value: string) => settingsState.newsSource = value,
|
||||
options: [
|
||||
{ value: "australia", label: "Australia" },
|
||||
{ value: "usa", label: "USA" },
|
||||
{ value: "taiwan", label: "Taiwan" },
|
||||
{ value: "hong_kong", label: "Hong Kong" },
|
||||
{ value: "panama", label: "Panama" },
|
||||
{ value: "canada", label: "Canada" },
|
||||
{ value: "singapore", label: "Singapore" },
|
||||
{ value: "uk", label: "UK" },
|
||||
{ value: "japan", label: "Japan" },
|
||||
{ value: "netherlands", label: "Netherlands" }
|
||||
options: [
|
||||
{ value: "australia", label: "Australia" },
|
||||
{ value: "usa", label: "USA" },
|
||||
{ value: "uk", label: "UK" },
|
||||
{ value: "taiwan", label: "Taiwan" },
|
||||
{ value: "hong_kong", label: "Hong Kong" },
|
||||
{ value: "panama", label: "Panama" },
|
||||
{ value: "canada", label: "Canada" },
|
||||
{ value: "singapore", label: "Singapore" },
|
||||
{ value: "japan", label: "Japan" },
|
||||
{ value: "netherlands", label: "Netherlands" }
|
||||
]
|
||||
|
||||
}
|
||||
}
|
||||
] as option}
|
||||
|
||||
@@ -18,12 +18,27 @@ export async function SendNewsPage() {
|
||||
const main = document.getElementById("main");
|
||||
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 */ `
|
||||
<div class="home-root">
|
||||
<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>
|
||||
</div>
|
||||
</div>`);
|
||||
<div class="home-root">
|
||||
<div class="home-container" id="news-container">
|
||||
<h1 class="border">Latest Headlines in ${displayCountry}</h1>
|
||||
</div>
|
||||
</div>`);
|
||||
|
||||
main!.append(html.firstChild!);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user