Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 13 additions & 21 deletions front_end/src/app/(main)/questions/components/question_topics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@ import {
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { sendGAEvent } from "@next/third-parties/google";
import classNames from "classnames";
import clsx from "clsx";
import { useTranslations } from "next-intl";
import { useFeatureFlagEnabled } from "posthog-js/react";
import { FC, useMemo, useState } from "react";

import clsx from "clsx";

import useFeed from "@/app/(main)/questions/hooks/use_feed";
import { useContentTranslatedBannerProvider } from "@/app/providers";
import Button from "@/components/ui/button";
import {
FeedType,
Expand All @@ -26,7 +25,6 @@ import useSearchParams from "@/hooks/use_search_params";
import { Topic } from "@/types/projects";

import TopicItem from "./topic_item";
import { useContentTranslatedBannerProvider } from "@/app/providers";

const EXPAND_THRESHOLD = 2;

Expand Down Expand Up @@ -60,10 +58,6 @@ const QuestionTopics: FC<Props> = ({ topics }) => {
hotTopics.length + hotCategories.length > EXPAND_THRESHOLD;
const [isMobileExpanded, setIsMobileExpanded] = useState(false);

const isCommunitiesDiscoveryEnabled = useFeatureFlagEnabled(
"communitiesDiscovery"
);

const { bannerIsVissible: isTranslationBannerVisible } =
useContentTranslatedBannerProvider();

Expand Down Expand Up @@ -154,19 +148,17 @@ const QuestionTopics: FC<Props> = ({ topics }) => {
/>
</>
)}
{isCommunitiesDiscoveryEnabled && (
<TopicItem
emoji="👥"
text={t("communities")}
onClick={() => {
sendGAEvent("event", "sidebarClick", {
event_category: "Communities",
});
switchFeed(FeedType.COMMUNITIES);
}}
isActive={currentFeed === FeedType.COMMUNITIES}
/>
)}
<TopicItem
emoji="👥"
text={t("communities")}
onClick={() => {
sendGAEvent("event", "sidebarClick", {
event_category: "Communities",
});
switchFeed(FeedType.COMMUNITIES);
}}
isActive={currentFeed === FeedType.COMMUNITIES}
/>
<TopicItem
isActive={false}
emoji="🤖🔭"
Expand Down