Skip to content
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { View, Text, TouchableOpacity, Image } from "react-native";
import React from "react";
import { styles } from "../../screens/universalFeed/styles";
import { styles } from "../../screens/feed/styles";
import { LMFeedAnalytics } from "../../analytics/LMFeedAnalytics";
import { Events } from "../../enums/Events";
import {
CLEAR_SELECTED_TOPICS,
CLEAR_SELECTED_TOPICS_FOR_CREATE_POST_SCREEN,
} from "../../store/types/types";
import {
UniversalFeedContextValues,
useUniversalFeedContext,
useUniversalFeedCustomisableMethodsContext,
FeedContextValues,
useFeedContext,
useFeedCustomisableMethodsContext,
} from "../../context";
import { useAppDispatch } from "../../store/store";
import STYLES from "../../constants/Styles";
Expand All @@ -20,11 +20,11 @@ import { WordAction } from "../../enums/Variables";

const LMCreatePostButton = ({ customText }: { customText?: string }) => {
const dispatch = useAppDispatch();
const { showCreatePost, newPostButtonClick }: UniversalFeedContextValues =
useUniversalFeedContext();
const universalFeedStyle = STYLES.$UNIVERSAL_FEED_STYLE;
const { showCreatePost, newPostButtonClick }: FeedContextValues =
useFeedContext();
const feedStyle = STYLES.$FEED_STYLE;
const { newPostButtonClickProps } =
useUniversalFeedCustomisableMethodsContext();
useFeedCustomisableMethodsContext();
return (
<TouchableOpacity
activeOpacity={0.8}
Expand All @@ -33,7 +33,7 @@ const LMCreatePostButton = ({ customText }: { customText?: string }) => {
showCreatePost
? styles.newPostButtonEnable
: styles.newPostButtonDisable,
universalFeedStyle?.newPostButtonStyle,
feedStyle?.newPostButtonStyle,
]}
// handles post uploading status and member rights to create post
onPress={() => {
Expand All @@ -50,9 +50,9 @@ const LMCreatePostButton = ({ customText }: { customText?: string }) => {
source={require("../../assets/images/add_post_icon3x.png")}
resizeMode={"contain"}
style={styles.newPostButtonIcon}
{...universalFeedStyle?.newPostIcon}
{...feedStyle?.newPostIcon}
/>
<Text style={[styles.newPostText, universalFeedStyle?.newPostButtonText]}>
<Text style={[styles.newPostText, feedStyle?.newPostButtonText]}>
{customText ? customText : `NEW ${pluralizeOrCapitalize((CommunityConfigs?.getCommunityConfigs("feed_metadata"))?.value?.post ?? "post",WordAction.allCapitalSingular)}`}
</Text>
</TouchableOpacity>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { View, Text, TouchableOpacity, Image, SafeAreaView } from "react-native"
import React, { useState } from "react";
import LMHeader from "../LMHeader";
import {
UniversalFeedContextValues,
useUniversalFeedContext,
useUniversalFeedCustomisableMethodsContext,
FeedContextValues,
useFeedContext,
useFeedCustomisableMethodsContext,
} from "../../context";
import { LMFeedAnalytics } from "../../analytics/LMFeedAnalytics";
import { Events } from "../../enums/Events";
Expand All @@ -17,18 +17,18 @@ import { nameInitials } from "../../utils";
import { LMProfilePicture } from "../../uiComponents";
import { useLMFeed } from "../../lmFeedProvider";

const LMUniversalFeedHeader = () => {
const LMFeedHeader = () => {
const {
unreadNotificationCount,
onTapNotificationBell,
memberData
}: UniversalFeedContextValues = useUniversalFeedContext();
}: FeedContextValues = useFeedContext();
const {isUserOnboardingRequired} = useLMFeed()
const navigation = useNavigation();
const universalFeedStyle = STYLES.$UNIVERSAL_FEED_STYLE;
const feedStyle = STYLES.$FEED_STYLE;
const postHeaderStyle = STYLES.$POST_LIST_STYLE.header
const { onTapNotificationBellProp } =
useUniversalFeedCustomisableMethodsContext();
useFeedCustomisableMethodsContext();

return (
<SafeAreaView
Expand Down Expand Up @@ -114,10 +114,10 @@ const LMUniversalFeedHeader = () => {
</TouchableOpacity>
</View>
}
{...universalFeedStyle?.screenHeader}
{...feedStyle?.screenHeader}
/>
</SafeAreaView>
);
};

export default LMUniversalFeedHeader;
export default LMFeedHeader;
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ import React, { useEffect, useState } from "react";
import { Client } from "../../client";
import { useAppDispatch, useAppSelector } from "../../store/store";
import {
UniversalFeedContextValues,
useUniversalFeedContext,
FeedContextValues,
useFeedContext,
} from "../../context";
import {
CLEAR_SELECTED_TOPICS_FROM_UNIVERSAL_FEED_SCREEN,
MAPPED_TOPICS_FROM_UNIVERSAL_FEED_SCREEN,
SELECTED_TOPICS_FOR_UNIVERSAL_FEED_SCREEN,
SELECTED_TOPICS_FROM_UNIVERSAL_FEED_SCREEN,
CLEAR_SELECTED_TOPICS_FROM_FEED_SCREEN,
MAPPED_TOPICS_FROM_FEED_SCREEN,
SELECTED_TOPICS_FOR_FEED_SCREEN,
SELECTED_TOPICS_FROM_FEED_SCREEN,
SET_TOPICS,
} from "../../store/types/types";
import Layout from "../../constants/Layout";
import STYLES from "../../constants/Styles";
import { styles } from "../../screens/universalFeed/styles";
import { styles } from "../../screens/feed/styles";
import { TOPIC_FEED } from "../../constants/screenNames";
import { CommunityConfigs } from "../../communityConfigs";
import { WordAction } from "../../enums/Variables";
Expand All @@ -32,14 +32,14 @@ const LMFilterTopics = () => {
setIsAnyMatchingPost,
setFeedPageNumber,
setIsPaginationStopped
}: UniversalFeedContextValues = useUniversalFeedContext();
}: FeedContextValues = useFeedContext();
const myClient = Client.myClient;
const [showTopics, setShowTopics] = useState(false);
const topicsStyle = STYLES.$TOPICS_STYLE;
const [topicsPage, setTopicsPage] = useState(1);

const selectedTopics = useAppSelector(
(state) => state.feed.selectedTopicsForUniversalFeedScreen
(state) => state.feed.selectedTopicsForFeedScreen
);
const topics = useAppSelector((state) => state.feed.topics);
const mappedTopics = useAppSelector((state) => state.feed.mappedTopics);
Expand All @@ -61,15 +61,15 @@ const LMFilterTopics = () => {
name: topics[topicId]?.name || "Unknown", // Use optional chaining and provide a default name if not found
}));
dispatch({
type: MAPPED_TOPICS_FROM_UNIVERSAL_FEED_SCREEN,
type: MAPPED_TOPICS_FROM_FEED_SCREEN,
body: { topics: filteredTopicArray },
});
getUnreadCount();
}, [selectedTopics, topics]);

const handleAllTopicPress = () => {
dispatch({
type: CLEAR_SELECTED_TOPICS_FROM_UNIVERSAL_FEED_SCREEN,
type: CLEAR_SELECTED_TOPICS_FROM_FEED_SCREEN,
});
/* @ts-ignore */
return navigation.navigate(TOPIC_FEED);
Expand All @@ -78,7 +78,7 @@ const LMFilterTopics = () => {
const handleIndividualTopicsPress = () => {
const arrayOfIds = mappedTopics.map((obj) => obj.id);
dispatch({
type: SELECTED_TOPICS_FROM_UNIVERSAL_FEED_SCREEN,
type: SELECTED_TOPICS_FROM_FEED_SCREEN,
body: { topics: arrayOfIds },
});
/* @ts-ignore */
Expand All @@ -90,11 +90,11 @@ const LMFilterTopics = () => {
const filteredTopics = selectedTopics?.filter(topic => topic != (newItems[index])?.id);
newItems.splice(index, 1); // Remove the item at the specified index
dispatch({
type: MAPPED_TOPICS_FROM_UNIVERSAL_FEED_SCREEN,
type: MAPPED_TOPICS_FROM_FEED_SCREEN,
body: { topics: newItems },
}); // Update the state with the new array
dispatch({
type: SELECTED_TOPICS_FOR_UNIVERSAL_FEED_SCREEN,
type: SELECTED_TOPICS_FOR_FEED_SCREEN,
body: { topics: filteredTopics },
}); // Update the state with the new array
setFeedPageNumber(1);
Expand Down Expand Up @@ -279,11 +279,11 @@ const LMFilterTopics = () => {
<TouchableOpacity
onPress={async () => {
dispatch({
type: MAPPED_TOPICS_FROM_UNIVERSAL_FEED_SCREEN,
type: MAPPED_TOPICS_FROM_FEED_SCREEN,
body: { topics: [] },
});
dispatch({
type: SELECTED_TOPICS_FOR_UNIVERSAL_FEED_SCREEN,
type: SELECTED_TOPICS_FOR_FEED_SCREEN,
body: { topics: [] },
});
setFeedPageNumber(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
import {
CREATE_POST,
POST_DETAIL,
UNIVERSAL_FEED,
FEED,
} from "../../../constants/screenNames";
import RNVideo from "../../../optionalDependencies/Video";
import { useLMFeed } from "../../../lmFeedProvider";
Expand Down Expand Up @@ -177,7 +177,7 @@ import {
: flowToCreatePostScreen
? true
: pauseStatus === true &&
previousRoute?.name === UNIVERSAL_FEED &&
previousRoute?.name === FEED &&
currentRoute?.name !== CREATE_POST
? pauseStatus
: videoInFeed
Expand Down Expand Up @@ -214,7 +214,7 @@ import {
: flowToCreatePostScreen
? true
: pauseStatus === true &&
previousRoute?.name === UNIVERSAL_FEED &&
previousRoute?.name === FEED &&
currentRoute?.name !== CREATE_POST
? pauseStatus
: videoInFeed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { StackNavigationProp } from "@react-navigation/stack";
import {
CREATE_POST,
POST_DETAIL,
UNIVERSAL_FEED,
FEED,
} from "../../../constants/screenNames";
import RNVideo from "../../../optionalDependencies/Video";
import { useLMFeed } from "../../../lmFeedProvider";
Expand Down Expand Up @@ -180,7 +180,7 @@ const LMVideo = React.memo(
: flowToCreatePostScreen
? true
: pauseStatus === true &&
previousRoute?.name === UNIVERSAL_FEED &&
previousRoute?.name === FEED &&
currentRoute?.name !== CREATE_POST
? pauseStatus
: videoInFeed
Expand Down Expand Up @@ -218,7 +218,7 @@ const LMVideo = React.memo(
: flowToCreatePostScreen
? true
: pauseStatus === true &&
previousRoute?.name === UNIVERSAL_FEED &&
previousRoute?.name === FEED &&
currentRoute?.name !== CREATE_POST
? pauseStatus
: videoInFeed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import LMPostPollText from "../../LMPost/LMPostPollText";
import { decode } from "../../../utils";
import { LMText } from "../../../uiComponents";
import { PollType } from "../../../enums/Poll";
import { useUniversalFeedCustomisableMethodsContext } from "../../../context";
import { useFeedCustomisableMethodsContext } from "../../../context";
import { usePollCustomisableMethodsContext } from "../../../context/pollCustomisableCallback";

const LMPostPollUI = ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { POLL_RESULT } from "../../../constants/screenNames";
import { PollMultiSelectState, PollType } from "../../../enums/Poll";
import { GetPostRequest } from "@likeminds.community/feed-rn";
import { getPost } from "../../../store/actions/postDetail";
import { useUniversalFeedContext } from "../../../context";
import { useFeedContext } from "../../../context";

const LMPostPollView = ({
item,
Expand All @@ -35,7 +35,7 @@ const LMPostPollView = ({
editPollAttachment,
}: any) => {
const { navigation, setSelectedPollOptions, addPollOption, submitPoll } =
useUniversalFeedContext();
useFeedContext();

const [selectedPolls, setSelectedPolls] = useState<number[]>([]);
const [showSelected, setShowSelected] = useState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from "../../../store/types/types";
import {
CAROUSEL_SCREEN,
UNIVERSAL_FEED,
FEED,
} from "../../../constants/screenNames";
import STYLES from "../../../constants/Styles";
import LMPostPollView from "../../LMPoll/LMPostPollView";
Expand Down Expand Up @@ -105,7 +105,7 @@ const LMPostMedia = React.memo(() => {
}
// videoInFeed={mediaProps?.videoProps?.videoInFeed}
videoInFeed={
previousRoute?.name === UNIVERSAL_FEED ? false : true
previousRoute?.name === FEED ? false : true
}
videoInCarousel={false}
showMuteUnmute={true}
Expand Down Expand Up @@ -194,7 +194,7 @@ const LMPostMedia = React.memo(() => {
? mediaProps?.videoProps?.autoPlay
: true,
videoInFeed:
previousRoute?.name === UNIVERSAL_FEED ? false : true,
previousRoute?.name === FEED ? false : true,
postId: post?.id,
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,22 @@ import { View, Text, Platform } from "react-native";
import React from "react";
import LMLoader from "../LMLoader";
import STYLES from "../../constants/Styles";
import { styles } from "../../screens/universalFeed/styles";
import { styles } from "../../screens/feed/styles";
import { POST_UPLOADING } from "../../constants/Strings";
import {
UniversalFeedContextValues,
useUniversalFeedContext,
FeedContextValues,
useFeedContext,
} from "../../context";

const LMPostUploadIndicator = () => {
const { postUploading }: UniversalFeedContextValues =
useUniversalFeedContext();
const { postUploading }: FeedContextValues =
useFeedContext();
return (
<View>
{/* post uploading section */}
{postUploading && (
<View style={styles.postUploadingView}>
<View style={styles.uploadingPostContentView}>
{/* post uploading media preview */}
{/* {uploadingMediaAttachmentType === IMAGE_ATTACHMENT_TYPE && (
<LMImage
imageUrl={uploadingMediaAttachment}
imageStyle={styles.uploadingImageStyle}
boxStyle={styles.uploadingImageVideoBox}
width={styles.uploadingImageVideoBox.width}
height={styles.uploadingImageVideoBox.height}
/>
)}
{uploadingMediaAttachmentType === VIDEO_ATTACHMENT_TYPE && (
<LMVideo
videoUrl={uploadingMediaAttachment}
videoStyle={styles.uploadingVideoStyle}
boxStyle={styles.uploadingImageVideoBox}
width={styles.uploadingImageVideoBox.width}
height={styles.uploadingImageVideoBox.height}
showControls={false}
boxFit="contain"
autoPlay={false}
/>
)}
{uploadingMediaAttachmentType === DOCUMENT_ATTACHMENT_TYPE && (
<LMIcon
assetPath={require("../../assets/images/pdf_icon3x.png")}
iconStyle={styles.uploadingDocumentStyle}
height={styles.uploadingPdfIconSize.height}
width={styles.uploadingPdfIconSize.width}
/>
)} */}
<Text style={styles.postUploadingText}>{POST_UPLOADING}</Text>
</View>
{/* progress loader */}
Expand Down
Loading