diff --git a/front_end/src/app/(main)/questions/[id]/components/sidebar/index.tsx b/front_end/src/app/(main)/questions/[id]/components/sidebar/index.tsx index 0082ac8685..588d045d75 100644 --- a/front_end/src/app/(main)/questions/[id]/components/sidebar/index.tsx +++ b/front_end/src/app/(main)/questions/[id]/components/sidebar/index.tsx @@ -25,7 +25,7 @@ const Sidebar: FC = ({ }) => { if (layout === "mobile") { return ( -
+
= ({ -
+
); } return ( -
+
@@ -81,7 +81,7 @@ const Sidebar: FC = ({ -
+
); }; diff --git a/front_end/src/app/(main)/questions/[id]/components/sidebar/news_match/index.tsx b/front_end/src/app/(main)/questions/[id]/components/sidebar/news_match/index.tsx index 57b7c35812..a0cb9abb55 100644 --- a/front_end/src/app/(main)/questions/[id]/components/sidebar/news_match/index.tsx +++ b/front_end/src/app/(main)/questions/[id]/components/sidebar/news_match/index.tsx @@ -16,7 +16,9 @@ const fetchArticles = async (postId: number) => { const NewsMatch: FC = async ({ questionId }) => { const articles = await fetchArticles(questionId); - return ; + if (articles.length > 0) { + return ; + } }; export default NewsMatch; diff --git a/front_end/src/app/(main)/questions/[id]/components/sidebar/news_match/news_match_drawer.tsx b/front_end/src/app/(main)/questions/[id]/components/sidebar/news_match/news_match_drawer.tsx index 3aec0c66e3..03caff52d7 100644 --- a/front_end/src/app/(main)/questions/[id]/components/sidebar/news_match/news_match_drawer.tsx +++ b/front_end/src/app/(main)/questions/[id]/components/sidebar/news_match/news_match_drawer.tsx @@ -30,7 +30,7 @@ const NewsMatchDrawer: FC = ({ questionId, articles }) => { /> ))}
- {articles.length > articleDisplayLimit ? ( + {articles.length > articleDisplayLimit && ( - ) : ( -
)} -
+
{t.rich("learnMoreAboutNewsMatch", { link: (chunks) => ( = ({ )*/} {isEditing && ( -
+
= ({ )} {!isEditing && } -
+
{ @@ -144,9 +144,9 @@ const CommentEditor: FC = ({
{!!errorMessage && ( -

+

{errorMessage} -

+
)} ); diff --git a/front_end/src/components/comment_feed/index.tsx b/front_end/src/components/comment_feed/index.tsx index 0c4a028ad6..83c2ffaa85 100644 --- a/front_end/src/components/comment_feed/index.tsx +++ b/front_end/src/components/comment_feed/index.tsx @@ -1,4 +1,5 @@ "use client"; + import { faChevronDown } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import Link from "next/link"; @@ -72,6 +73,26 @@ type Props = { profileId?: number; }; +function shouldIncludeForecast(postData: PostWithForecasts | undefined) { + if (postData === undefined) return false; + + // disable forecasts for notebooks + if (postData.notebook !== undefined) { + return false; + } + + // we can link forecast only for date, binary and numeric questions + if (postData.question) { + if (postData.question.type === QuestionType.MultipleChoice) { + return false; + } + + return !!postData.question.my_forecasts?.history.length; + } + + return false; +} + const COMMENTS_PER_PAGE = 10; const CommentFeed: FC = ({ postData, postPermissions, profileId }) => { @@ -240,7 +261,7 @@ const CommentFeed: FC = ({ postData, postPermissions, profileId }) => { > {t("comments")} - {profileId && ( + {!profileId && user && ( = ({ postData, postPermissions, profileId }) => { ); }; -function shouldIncludeForecast(postData: PostWithForecasts | undefined) { - if (postData === undefined) return false; - - // disable forecasts for notebooks - if (postData.notebook !== undefined) { - return false; - } - - // we can link forecast only for date, binary and numeric questions - if (postData.question) { - if (postData.question.type === QuestionType.MultipleChoice) { - return false; - } - - return !!postData.question.my_forecasts?.history.length; - } - - return false; -} - export default CommentFeed;