LMUserProfileSection
LMUserProfileSection
is a React component designed to display the user's profile section within the context of creating or editing a post. It showcases the user's profile picture (or initials as a fallback) and the user's name, leveraging styles and data from the context.
Customisations with Styles
Prop | Type | Description |
---|---|---|
postHeaderStyle | object | Custom styles for the post header. |
userNameTextStyle | TextStyle | Custom styles for the user name. |
To see all the properties, visit PostListStyleProps.header & CreatePostStyleProps.userNameTextStyle
Usage Example
import React, { useEffect } from "react";
import { View } from "react-native";
import {
STYLES,
LMUserProfileSection,
} from "@likeminds.community/feed-rn-core";
const CreatePostScreen = () => {
// to customise ui
useEffect(() => {
STYLES.setPostListStyles({
header: {
profilePicture: {
size: 10,
fallbackTextBoxStyle: {
backgroundColor: "pink",
},
},
},
});
}, []);
return (
<View style={{ flex: 1 }}>
<LMUserProfileSection />
</View>
);
};
export default CreatePostScreen;
- Use the
CreatePostScreen
component with all other create post components as a child of theCreatePost
component in the relevant screens: