diff --git a/src/shared/components/navbar.tsx b/src/shared/components/navbar.tsx
index 5eda9ee..674b48f 100644
--- a/src/shared/components/navbar.tsx
+++ b/src/shared/components/navbar.tsx
@@ -72,7 +72,11 @@ export const Navbar = ({ footer = false }) => (
>
-
+
@@ -111,13 +115,10 @@ export const Navbar = ({ footer = false }) => (
"dropdown-top": footer,
})}
>
-
diff --git a/src/shared/components/news-item.tsx b/src/shared/components/news-item.tsx
index 008317c..f1af46f 100644
--- a/src/shared/components/news-item.tsx
+++ b/src/shared/components/news-item.tsx
@@ -22,7 +22,7 @@ export class NewsItem extends Component
{
}
get markdown(): string {
- return news_md.find(v => v.title == this.title)?.markdown ?? "";
+ return news_md.find(v => v.title === this.title)?.markdown ?? "";
}
render() {
diff --git a/src/shared/components/news.tsx b/src/shared/components/news.tsx
index c65bbb1..32e13c2 100644
--- a/src/shared/components/news.tsx
+++ b/src/shared/components/news.tsx
@@ -18,7 +18,7 @@ interface NewsInfo {
function buildNewsInfoArray(): Array {
return news_reversed.map(n => {
- let split = n.title.split(" - ");
+ const split = n.title.split(" - ");
return {
dateStr: split[0],
@@ -48,7 +48,11 @@ const TitleBlock = () => (
);
diff --git a/src/shared/i18next.ts b/src/shared/i18next.ts
index db72852..0b2b64f 100644
--- a/src/shared/i18next.ts
+++ b/src/shared/i18next.ts
@@ -72,17 +72,11 @@ export const i18n = i18next as i18nTyped;
export { resources };
// https://gist.github.com/hunan-rostomyan/28e8702c1cecff41f7fe64345b76f2ca
-export function getLanguageFromCookie(cookies?: string): string | null {
- if (cookies == null) {
- return null;
- }
-
+export function getLanguageFromCookie(cookies?: string): string | undefined {
const key = "lang=";
- return (
- cookies
- .split(";")
- .map(c => c.trim())
- .filter(cookie => cookie.substring(0, key.length) === key)
- .map(cookie => cookie.substring(key.length))[0] || null
- );
+ return cookies
+ ?.split(";")
+ .map(c => c.trim())
+ .filter(cookie => cookie.substring(0, key.length) === key)
+ .map(cookie => cookie.substring(key.length))[0];
}
diff --git a/src/shared/utils.ts b/src/shared/utils.ts
index b109bea..3ea25b9 100644
--- a/src/shared/utils.ts
+++ b/src/shared/utils.ts
@@ -6,7 +6,7 @@ import markdown_it_ruby from "markdown-it-ruby";
import markdown_it_sub from "markdown-it-sub";
import markdown_it_sup from "markdown-it-sup";
-let SHORTNUM_SI_FORMAT = new Intl.NumberFormat("en-US", {
+const SHORTNUM_SI_FORMAT = new Intl.NumberFormat("en-US", {
maximumFractionDigits: 1,
//@ts-ignore
notation: "compact",