|
1 |
| -import Image from "next/image"; |
2 |
| -// import { Blogs } from '../components/Global' |
| 1 | +import Head from "next/head"; |
| 2 | +import Star from "@/components/star"; |
| 3 | +import { fontGilroy } from "@/lib/fonts"; |
| 4 | +import { cn } from "@/lib/utils"; |
| 5 | +import Blog from "./Blog"; |
| 6 | +import PCard from "./PCard"; |
| 7 | +// import { Blogs } from '@/components/Global' |
3 | 8 | import { Metadata } from "next";
|
4 | 9 |
|
5 | 10 | export const metadata: Metadata = {
|
6 | 11 | title: "Blog",
|
7 | 12 | };
|
8 | 13 |
|
9 | 14 |
|
10 |
| -async function getData() { |
11 |
| - const res = await fetch('https://dev.to/api/articles?username=webxdao'); |
12 |
| - // The return value is *not* serialized |
13 |
| - // You can return Date, Map, Set, etc. |
14 |
| - |
15 |
| - // Recommendation: handle errors |
16 |
| - if (!res.ok) { |
17 |
| - // This will activate the closest `error.js` Error Boundary |
18 |
| - throw new Error('Failed to fetch data'); |
19 |
| - } |
20 |
| - |
21 |
| - return res.json(); |
22 |
| -} |
23 |
| - |
24 |
| -export default async function BlogPage({ |
25 |
| - params: { data }, |
26 |
| -}:{ |
27 |
| - params: { data: [] }; |
28 |
| -}) { |
29 |
| - // Initiate dev.to API request |
30 |
| - const blogData = getData(); |
31 |
| - |
32 |
| - // Wait for the promises to resolve |
33 |
| - const [dataT] = await Promise.all([blogData]); |
| 15 | +export default function BlogPage() { |
34 | 16 |
|
35 | 17 | return (
|
36 | 18 | <>
|
37 |
| - <section className="py-8"> |
38 |
| - <div className="container mx-auto max-w-5xl"> |
39 |
| - <h1 className="my-2 w-full text-center text-4xl font-bold leading-tight text-white"> |
40 |
| - Blogs |
| 19 | + <section className="w-full overflow-hidden py-8"> |
| 20 | + <div className="container mx-auto flex max-w-5xl flex-row flex-wrap justify-around lg:flex-nowrap "> |
| 21 | + <h1 |
| 22 | + className={cn( |
| 23 | + "w-max-content my-2 w-full text-center text-7xl font-semibold leading-tight text-slate-900 dark:text-white lg:text-left", |
| 24 | + fontGilroy.className |
| 25 | + )} |
| 26 | + > |
| 27 | + Dev Blog |
41 | 28 | </h1>
|
| 29 | + <div className="mt-9 hidden gap-20 lg:flex"> |
| 30 | + <div className="my-auto flex"> |
| 31 | + <Star height={40} width={40} /> |
| 32 | + </div> |
| 33 | + <Star height={90} width={90} /> |
| 34 | + </div> |
| 35 | + <svg xmlns="http://www.w3.org/2000/svg" width="900" height="2" className="-mx-52 mb-11 mt-auto hidden lg:flex"> |
| 36 | + <line x1="0" y1="0" x2="1000" y2="0" strokeWidth="2" className="stroke-black dark:stroke-white"/> |
| 37 | + </svg> |
42 | 38 | </div>
|
| 39 | + <div className="ml-4 mr-1 mt-6 flex justify-center text-lg font-light leading-tight text-black dark:text-white sm:text-center md:text-xl lg:text-left "> |
| 40 | + Our primary emphasis is on cutting-edge platforms in the industry, ensuring that{" "} |
| 41 | + <br className="max-md:hidden" /> |
| 42 | + you are equipped with the necessary skills for your future endeavors. |
| 43 | + </div> |
| 44 | + </section> |
43 | 45 |
|
44 |
| - <section> |
45 |
| - <div className="z-2 relative mx-0 my-7 flex grid-cols-1 flex-wrap items-center justify-center"> |
46 |
| - |
47 |
| - {dataT.map((curElem: any) => { |
48 |
| - return ( |
49 |
| - <div |
50 |
| - className="grid-items z-2 justify-conten group relative m-7 flex h-min w-min items-center rounded-2xl bg-white/5 shadow-2xl backdrop-blur-md" |
51 |
| - key={curElem.id} |
52 |
| - > |
53 |
| - <div className="relative flex h-80 w-[17.5rem] flex-col items-center justify-center opacity-70 hover:opacity-100 sm:w-[15.5rem] md:w-[19rem] lg:w-[27rem]"> |
54 |
| - <div className="relative w-4/5 truncate rounded-2xl border-8 border-solid border-black/25 duration-500 group-hover:-translate-y-6"> |
55 |
| - <Image |
56 |
| - src={curElem.cover_image} |
57 |
| - width={400} |
58 |
| - height={250} |
59 |
| - alt="blog image" |
60 |
| - className="relative left-0 top-0 h-full w-full object-cover" |
61 |
| - /> |
62 |
| - </div> |
63 |
| - <div className="relative m-0 flex-wrap items-center justify-center text-center"> |
64 |
| - <h3 className="mx-2.5 mb-2.5 mt-5 text-center text-sm font-medium uppercase leading-4 tracking-wider text-white duration-500 group-hover:-translate-y-6"> |
65 |
| - <b>{curElem.title}</b> |
66 |
| - <br></br> |
67 |
| - <br></br> |
68 |
| - <span className="text-xs font-light lowercase">{curElem.description}</span> |
69 |
| - <br></br> |
70 |
| - <br></br> |
71 |
| - <a |
72 |
| - href={curElem.url} |
73 |
| - target="_blank" |
74 |
| - rel="noopener noreferrer" |
75 |
| - className="inline-block rounded-md border border-transparent bg-green-500 px-8 py-3 text-center font-medium text-white" |
76 |
| - > |
77 |
| - <b>Read More</b> |
78 |
| - </a> |
79 |
| - </h3> |
80 |
| - </div> |
81 |
| - </div> |
82 |
| - </div> |
83 |
| - ); |
84 |
| - })} |
| 46 | + <PCard /> |
| 47 | + |
| 48 | + <main className="mx-auto grid max-w-6xl gap-8 px-4"> |
| 49 | + <div className="mx-auto max-w-5xl"> |
| 50 | + <h1 className="my-10 text-center text-xl font-bold">Categories</h1> |
| 51 | + <div className="flex flex-wrap justify-center gap-9 sm:gap-14"> |
| 52 | + {["Dapp", "Open Source", "Blockchain", "Community", "Hackathons"].map((name) => ( |
| 53 | + <div className="w-40 rounded py-2 text-center shadow-md shadow-purple-400/40"> |
| 54 | + {name} |
| 55 | + </div> |
| 56 | + ))} |
85 | 57 | </div>
|
86 |
| - </section> |
87 |
| - </section> |
| 58 | + </div> |
| 59 | + {/* @ts-expect-error Async Server Component */} |
| 60 | + <Blog /> |
| 61 | + </main> |
88 | 62 | </>
|
89 | 63 | );
|
90 |
| -}; |
| 64 | +} |
0 commit comments