Skip to content

Commit

Permalink
modal vid & img min width, sort follower by distance
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalmi committed Dec 7, 2023
1 parent 8e6d11f commit f5e84c3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/app/src/Element/Spotlight/SpotlightMedia.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@ export function SpotlightMedia(props: SpotlightMediaProps) {
autoPlay={true}
loop={true}
controls={true}
className="max-h-screen max-w-full"
className="max-h-screen max-w-full min-w-[600px]"
/>
);
} else {
return <ProxyImg src={image} className="max-h-screen max-w-full" />;
return <ProxyImg src={image} className="max-h-screen max-w-full min-w-[600px]" />;
}
}, [image, isVideo]);

Expand Down
6 changes: 4 additions & 2 deletions packages/app/src/Feed/FollowersFeed.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from "react";
import { HexKey, EventKind, NoteCollection, RequestBuilder } from "@snort/system";
import { HexKey, EventKind, NoteCollection, RequestBuilder, socialGraphInstance } from "@snort/system";
import { useRequestBuilder } from "@snort/system-react";

export default function useFollowersFeed(pubkey?: HexKey) {
Expand All @@ -16,7 +16,9 @@ export default function useFollowersFeed(pubkey?: HexKey) {
const contactLists = followersFeed.data?.filter(
a => a.kind === EventKind.ContactList && a.tags.some(b => b[0] === "p" && b[1] === pubkey),
);
return [...new Set(contactLists?.map(a => a.pubkey))];
return [...new Set(contactLists?.map(a => a.pubkey))].sort((a, b) => {
return socialGraphInstance.getFollowDistance(a) - socialGraphInstance.getFollowDistance(b);
});
}, [followersFeed, pubkey]);

return followers;
Expand Down

0 comments on commit f5e84c3

Please sign in to comment.