import "swiper/css";
import "swiper/css/navigation";
import { Autoplay, Navigation } from "swiper";
import { BannerArrow } from "./Icons/BannerArrow";
import { Col, Row } from "antd";
import { IOView } from "../types";
import { Link } from "react-router-dom";
import { MaybeLink, PostWidget } from "./PostWidget";
import { MoodReadResponse, PostReadResponse } from "@newstackdev/iosdk-newgraph-client-js";
import { NLView } from "../types";
import { Swiper, SwiperSlide } from "swiper/react";
import { VerifiedIcon } from "./Icons/VerifiedIcon";
import { urlify } from "../utils/urlHelpers";
import { useActions, useAppState } from "../overmind";
import { useEffect, useState } from "react";
import { useRef } from "react";
import { useVerifiedPosts } from "../hooks/useVerified";
import Title from "../Pages/Explore/Title";
const SpotlightListCarousel: IOView<{
children: JSX.Element;
navigationPrevRef: any;
navigationNextRef: any;
}> = ({ children, navigationPrevRef, navigationNextRef }) => {
return (
{children}
);
};
const Spotlight: IOView<{
post: PostReadResponse;
title?: string;
verifiedUsers: (string | undefined)[] | undefined;
}> = ({ post, title, verifiedUsers }) => {
const state = useAppState();
const url = urlify(post?.description);
const actions = useActions();
useEffect(() => {
actions.lists.resetMoodAndPostAvailability();
}, []);
//@ts-ignore
const spotlightDetailContentUrl = !post.id ? "" : !post ? `/post/${post.id}` : `/folder/${post.moods.id}/${post.id}`;
return (
<>
!state.auth.authenticated && window.scrollTo(0, 0)}>
{url && (
)}
{post?.author?.username || post?.author?.displayName}
{verifiedUsers && verifiedUsers.includes(post?.author?.username) && (
)}
>
);
};
export const SpotlightGrid: NLView<{
title?: string;
carousel?: boolean;
navigationPrevRef: any;
navigationNextRef: any;
posts: PostReadResponse[];
}> = ({ title, carousel, navigationPrevRef, navigationNextRef, posts }) => {
const { verifiedUsers } = useVerifiedPosts(posts);
if (carousel) {
return (
{posts.map((post) => {
return (
);
})}
);
} else
return (
{posts.map((post) => {
return (
);
})}
);
};
const Spotlights: NLView<{
href?: string;
title?: string;
carousel?: boolean;
posts: PostReadResponse[];
}> = ({ title, carousel, posts, href }) => {
const state = useAppState();
const navigationPrevRef = useRef(null);
const navigationNextRef = useRef(null);
return (
<>
>
);
};
export default Spotlights;