chore: code formatting

This commit is contained in:
florian 2024-03-05 16:38:52 +00:00
parent e9f626fa6c
commit d5a03283b5
4 changed files with 19 additions and 6 deletions

View File

@ -30,7 +30,6 @@ const GridView = ({ settings, images, currentImage, setCurrentImage, setViewMode
};
const onKeyDown = (event: KeyboardEvent) => {
if (event.key === 'ArrowRight') {
showNextImage();
}

View File

@ -86,12 +86,14 @@ const SlideShow = () => {
const { nav, currentSettings: settings } = useNav();
const [state] = useGlobalState();
const [imageIdx, setImageIdx] = useState<number | undefined>();
const { zapClick, heartClick, zapState, heartState, repostClick, repostState } = useZapsAndReations(state.activeImage, state.userNPub);
const { zapClick, heartClick, zapState, heartState, repostClick, repostState } = useZapsAndReations(
state.activeImage,
state.userNPub
);
const navigate = useNavigate();
const listAuthors = useAuthorsFromList(settings.list);
const [contacts] = useAtom(followsAtom);
const filter = useMemo(() => {
const authorsToQuery = settings.follows
? contacts?.tags.filter(t => t[0] === 'p').map(t => t[1]) || []
@ -325,7 +327,10 @@ const SlideShow = () => {
<div className="bottom-controls">
{state.userNPub && state.activeImage && (
<>
<button className={`repost ${repostState?'reposted':''}`} onClick={() => !repostState && repostClick()}>
<button
className={`repost ${repostState ? 'reposted' : ''}`}
onClick={() => !repostState && repostClick()}
>
<IconRepost></IconRepost>
</button>
<button

View File

@ -19,7 +19,7 @@ const usePeopleLists = (npub?: string) => {
const titleTag = e.getMatchingTags('title').slice(0, 1).flat();
const descriptionTag = e.getMatchingTags('description').slice(0, 1).flat();
const name = titleTag.length>0 ? titleTag[1] : nameTag ? nameTag[1] : 'unknown';
const name = titleTag.length > 0 ? titleTag[1] : nameTag ? nameTag[1] : 'unknown';
const description = descriptionTag.length > 0 && descriptionTag[1];
const people = e.tags.filter(t => t[0] === 'p')?.map(t => t[1]);

View File

@ -11,7 +11,16 @@ const useReposts = (npub?: string) => {
{ disable: !npub }
);
const reposts = useMemo(() => events.flatMap(e => e.getMatchingTags('e').map(t => t[1]).flat()), [events]);
const reposts = useMemo(
() =>
events.flatMap(e =>
e
.getMatchingTags('e')
.map(t => t[1])
.flat()
),
[events]
);
return reposts;
};