Skip to main content

How to hide topics view in feed and during post creation?

In certain scenarios, you may want to hide the topic associated with a post to streamline the user experience or to control what information is visible. Additionally, during the post creation process, you may want to hide the topic selection option to simplify the user interface or restrict posts to predefined categories.

This guide will walk you through how to:

  1. Hide the topic display in the post view for existing posts.
  2. Hide the topic selection option during the post creation process.

Hide Topics in Post View

You can hide the topics in Post view by following these steps.

Step 1: Create a new Topics Wrapper Component.

Create a new React Component CustomPostViewTopicsWrapper and return null from it.

export const CustomPostViewTopicsWrapper = () => {
return null;
};

Step 2: Pass the newly created wrapper to LMSocialFeed

<LMSocialFeed
// Other props
CustomComponents={{
CustomPostViewTopicsWrapper: <CustomPostViewTopicsWrapper />,
}}
></LMSocialFeed>
info

To get the list of all the required props, check out this guide.

Hide Topics in post creation screen.

The basic approach will be the same as previous one, you will be creating a custom TopicsDropdown component which returns null and pass it as a custom component.

Step 1: Create a new Topics Dropdown Component

Create a new React Component CustomTopicDropdown and return null from it.

export const CustomTopicDropdown = () => {
return null;
};

Step 2: Create a new CustomPostViewTopicsWrapper Component

Create a new React Component CustomPostViewTopicsWrapper and return null from it.

export const CustomPostViewTopicsWrapper = () => {
return null;
};

Step 3: Pass the newly created wrapper and CustomPostViewTopicsWrapper to LMSocialFeed

<LMSocialFeed
// Other props
CustomComponents={{
CustomTopicDropDown: <CustomTopicDropDown />,
CustomPostViewTopicsWrapper: <CustomPostViewTopicsWrapper />,
}}
></LMSocialFeed>
info

To get the list of all the required props, check out this guide.