diff --git a/src/shared/components/news-item.tsx b/src/shared/components/news-item.tsx index c52621b..008317c 100644 --- a/src/shared/components/news-item.tsx +++ b/src/shared/components/news-item.tsx @@ -1,12 +1,9 @@ import { Component } from "inferno"; import { Helmet } from "inferno-helmet"; -import { i18n } from "../i18next"; import { news_md } from "../translations/news"; import { isBrowser, mdToHtml } from "../utils"; import { BottomSpacer } from "./common"; -const title = i18n.t("news"); - export class NewsItem extends Component { constructor(props: any, context: any) { super(props, context); @@ -18,17 +15,21 @@ export class NewsItem extends Component { } } - get markdown(): string { + get title(): string { let title = decodeURIComponent(this.props.match.params.title); title = title.replace(/_/g, " "); - return news_md.find(v => v.title == title)?.markdown ?? ""; + return title; + } + + get markdown(): string { + return news_md.find(v => v.title == this.title)?.markdown ?? ""; } render() { return (
- - + +
diff --git a/src/shared/components/news.tsx b/src/shared/components/news.tsx index b16b530..486ae21 100644 --- a/src/shared/components/news.tsx +++ b/src/shared/components/news.tsx @@ -58,7 +58,7 @@ const NewsCard = ({ news }: NewsProps) => (
- {title} + {news.title}
{news.dateStr}