feed, reactions list scrollbar

This commit is contained in:
Martti Malmi 2023-08-08 15:33:22 +03:00
parent 48c5cbb8dd
commit 10f9d794e9
5 changed files with 25 additions and 6 deletions

View File

@ -91,7 +91,7 @@ const ReactionsList = ({ event }) => {
<div className="flex items-center justify-between mb-4">
<h2 className="text-xl font-bold">{modalTitle}</h2>
</div>
<div className="flex flex-col gap-4 overflow-y-scroll max-h-[50vh] w-96">
<div className="flex flex-col gap-4 overflow-y-auto max-h-[50vh]">
{modalReactions.map((data) => (
<Reaction key={data.pubkey} data={data} />
))}

View File

@ -48,7 +48,7 @@ const useSubscribe = (ops: {
// Subscribe with the new filter and store the returned unsubscribe function
const unsubscribe = PubSub.subscribe(newFilter, handleEvent, false, false);
setLoadMoreUnsubscribe(unsubscribe);
}, [filter, loadMoreUnsubscribe, sortedEvents]); // Dependencies for the useCallback
}, [ops, sortedEvents]); // Dependencies for the useCallback
return { events, loadMore };
};

View File

@ -83,10 +83,10 @@ const Search = (props: any) => {
route('/' + key);
}}
/>
<div className="max-h-[50vh] overflow-y-scroll">
<div className="max-h-[50vh] overflow-y-auto">
<SmallFeed events={trendingPosts} />
</div>
<div className="max-h-[50vh] overflow-y-scroll">
<div className="max-h-[50vh] overflow-y-auto">
<FollowSuggestionsAPI />
</div>
</div>

View File

@ -1,6 +1,7 @@
import FeedComponent from '@/components/feed/Feed';
import OnboardingNotification from '@/components/OnboardingNotification';
import PublicMessageForm from '@/components/PublicMessageForm';
import Events from '@/nostr/Events';
import { translate as t } from '@/translations/Translation.mjs';
import View from '../View';
@ -25,7 +26,19 @@ class Feed extends View {
<div className="hidden md:block px-4">
<PublicMessageForm autofocus={false} placeholder={t('whats_on_your_mind')} />
</div>
<FeedComponent filterOptions={[{ name: 'Global', filter: { kinds: [1], limit: 50 } }]} />
<FeedComponent
filterOptions={[
{
name: t('posts'),
filter: { kinds: [1] },
filterFn: (event) => !Events.getEventReplyingTo(event),
},
{
name: t('posts_and_replies'),
filter: { kinds: [1], authors: this.state.followedUsers },
},
]}
/>
</div>
</div>
);

View File

@ -2,6 +2,7 @@ import FeedComponent from '@/components/feed/Feed';
import Show from '@/components/helpers/Show';
import OnboardingNotification from '@/components/OnboardingNotification';
import PublicMessageForm from '@/components/PublicMessageForm';
import Events from '@/nostr/Events';
import Key from '@/nostr/Key';
import { Unsubscribe } from '@/nostr/PubSub';
import { ID, PUB } from '@/nostr/UserIds';
@ -49,7 +50,12 @@ class Feed extends View {
<FeedComponent
filterOptions={[
{
name: 'Followed users',
name: t('posts'),
filter: { kinds: [1], authors: this.state.followedUsers, limit: 100 },
filterFn: (event) => !Events.getEventReplyingTo(event),
},
{
name: t('posts_and_replies'),
filter: { kinds: [1], authors: this.state.followedUsers, limit: 100 },
},
]}