diff --git a/public/lume-logo-bg.png b/public/lume-logo-bg.png new file mode 100644 index 0000000..8d3d708 Binary files /dev/null and b/public/lume-logo-bg.png differ diff --git a/src/app/page.tsx b/src/app/page.tsx index ff44935..9d3ba99 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,24 +1,26 @@ -import { redirect } from "next/navigation"; -import { headers } from "next/headers"; -import Feed from "@/components/Feed"; -import SearchBar from "@/components/SearchBar"; -import { fetchFeedData } from "@/lib/feed.ts"; +import { redirect } from "next/navigation" +import { headers } from "next/headers" +import Feed from "@/components/Feed" +import SearchBar from "@/components/SearchBar" +import { fetchFeedData } from "@/lib/feed.ts" +import * as GraphicSection from "@/components/GraphicSection" +import { ArrowIcon } from "@/components/ArrowIcon" type Props = { searchParams?: { - q?: string | undefined; - }; -}; + q?: string | undefined + } +} export default async function Home({ searchParams }: Props) { - const headerList = headers(); - const referer = headerList.get("referer"); + const headerList = headers() + const referer = headerList.get("referer") if (!referer && searchParams?.q) { - redirect(`/search?q=${searchParams.q}`); + redirect(`/search?q=${searchParams.q}`) } - const data = await fetchFeedData({}); + const data = await fetchFeedData({}) return ( <> @@ -32,7 +34,55 @@ export default async function Home({ searchParams }: Props) { initialData={data.data} /> + + + + + + + + WEB3.NEWS is a project by Lume. Let’s build an open, user-owned + web together. + + + + Learn more about Lume and join our community + + + + + + + + + + + + + + WEB3.NEWS is a project by Lume. Let’s build an open, user-owned + web together. + + + + Learn more about Lume and join our community + + + + + + > - ); + ) } diff --git a/src/components/ArrowIcon.tsx b/src/components/ArrowIcon.tsx new file mode 100644 index 0000000..7208f86 --- /dev/null +++ b/src/components/ArrowIcon.tsx @@ -0,0 +1,48 @@ +export const ArrowIcon = ({className}: {className?: string}) => { + return ( + + + + + + + + + + + + + ) +} diff --git a/src/components/Feed.tsx b/src/components/Feed.tsx index 02aeb9c..511de62 100644 --- a/src/components/Feed.tsx +++ b/src/components/Feed.tsx @@ -23,8 +23,6 @@ const Feed = ({ initialData: Article[]; }) => { const filters = ["latest", "day", "week", "month"] as const; - const [dataResponse, setDataResponse] = - useState>>(); const [content, setContent] = useState>(initialData); const [selectedFilter, setSelectedFilter] = useState<(typeof filters)[number]>("latest"); @@ -111,7 +109,7 @@ const Feed = ({ ); })} - {dataResponse?.next ? ( + {swrData?.next ? ( { + return {children} +} + +const Background = ({className, children}: React.PropsWithChildren & {className?: string}) => { + return {children} +} + +const Foreground = ({className, children}: React.PropsWithChildren & {className?: string}) => { + return {children} +} + +export { + Root, + Background, + Foreground +} diff --git a/src/lib/feed.ts b/src/lib/feed.ts index 2cdbe0f..1e5a353 100644 --- a/src/lib/feed.ts +++ b/src/lib/feed.ts @@ -39,11 +39,27 @@ export async function fetchFeedData({ } } - const articles = await prisma.article.findMany({ - ...query, - skip: current, - take: next, - }); + // Mocking the data instead of fetching from the database + const articles: Article[] = [ + { + id: 1, + title: "Mock Article 1", + slug: "This is a mock article.", + siteKey: "asdas", + url: "asdasd", + createdAt: new Date(), + updatedAt: new Date(), + }, + { + id: 2, + title: "Mock Article 2", + slug: "This is a mock article.", + siteKey: "asdas", + url: "asdasd", + createdAt: new Date(), + updatedAt: new Date(), + }, + ]; const nextPointer = articles.length >= limit ? next + limit : null;
+ WEB3.NEWS is a project by Lume. Let’s build an open, user-owned + web together. +