LMCreatePostTextInput
The LMCreatePostTextInput component renders a customizable text input field where users can enter the content of their posts.
It also utilizes the LMInputText component for input rendering and allows for custom styling of the input field. The placeholder text, input style, and other settings are configurable based on the current theme and the provided STYLES.
GitHub File:
Styling Customisations
These styling customisations can be applied by calling the setCreatePostStyles on the STYLES class
| Property | Type | Description |
|---|---|---|
inputTextStyle | any | Style for the text input field. |
placeholderText | string | Placeholder text shown when input is empty. |
placeholderTextColor | string | Color of the placeholder text. |
rightIcon | LMButtonProps | Props for the right-side button/icon. |
textValueStyle | TextStyle | Style for the text value being entered. |
mentionTextStyle | TextStyle | Style applied to mention text within input. |
multilineField | boolean | Whether the input field supports multiple lines. |
To see all the properties, visit CreatePostStyleProps.createPostTextInputStyle
Usage Example
import React, { useEffect } from "react";
import { View } from "react-native";
import {
STYLES,
LMCreatePostTextInput,
CreatePost
} from "@likeminds.community/feed-rn-core";
const CustomCreatePostScreen = () => {
// to customise ui
useEffect(() => {
STYLES.setCreatePostStyles({
createPostTextInputStyle: {
placeholderText: "Create a post",
placeholderTextColor: "pink",
},
});
}, []);
return (
<CreatePost>
<LMCreatePostTextInput />
</CreatePost>
);
};
export default CustomCreatePostScreen;
- Use the
LMCreatePostTextInputor your own custom component with all other create post components as a child of theCreatePostcomponent in the relevant screens: