Skip to content

Commit

Permalink
Merge pull request #2407 from daostack/bugfix/CW-2400-empty-feed-plac…
Browse files Browse the repository at this point in the history
…eholder

Empty space feed placeholder #2400
  • Loading branch information
andreymikhadyuk authored Dec 19, 2023
2 parents 272d3dc + c285425 commit 25f94ae
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/pages/commonFeed/CommonFeed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {
selectCommonAction,
selectIsSearchingFeedItems,
selectRecentStreamId,
selectSearchValue,
selectSharedFeedItem,
} from "@/store/states";
import {
Expand Down Expand Up @@ -103,6 +104,7 @@ const CommonFeedComponent: FC<CommonFeedProps> = (props) => {
const userId = user?.uid;
const recentStreamId = useSelector(selectRecentStreamId);
const isSearchingFeedItems = useSelector(selectIsSearchingFeedItems);
const searchValue = useSelector(selectSearchValue);
const [feedLayoutRef, setFeedLayoutRef] = useState<FeedLayoutRef | null>(
null,
);
Expand Down Expand Up @@ -220,6 +222,11 @@ const CommonFeedComponent: FC<CommonFeedProps> = (props) => {
const firstItem = commonFeedItems?.[0];
const isDataFetched = isCommonDataFetched;
const hasPublicItems = commonData?.common.hasPublicItems ?? false;
const emptyText = hasMoreCommonFeedItems
? ""
: searchValue
? "Looks like there are no matches for your query."
: "No items here yet.";

const fetchData = () => {
fetchCommonData({
Expand Down Expand Up @@ -530,11 +537,7 @@ const CommonFeedComponent: FC<CommonFeedProps> = (props) => {
topFeedItems={topFeedItems}
feedItems={commonFeedItems}
loading={areCommonFeedItemsLoading || isSearchingFeedItems}
emptyText={
hasMoreCommonFeedItems
? ""
: "Looks like there are no matches for your query."
}
emptyText={emptyText}
batchNumber={batchNumber}
onFetchNext={fetchMoreCommonFeedItems}
renderFeedItemBaseContent={renderFeedItemBaseContent}
Expand Down

0 comments on commit 25f94ae

Please sign in to comment.