|
| 1 | +import { NextSeo } from 'next-seo'; |
| 2 | +import Link from 'next/link'; |
| 3 | +import PostsCards from '@/components/PostsCards'; |
| 4 | +import { Post, PostType } from '@/models/post.model'; |
| 5 | +import Layout from '@/layout/Layout'; |
| 6 | +import BreakBarLeft from '@/components/home/BreakBarLeft'; |
| 7 | +import BreakBarRight from '@/components/home/BreakBarRight'; |
| 8 | + |
| 9 | +import Skills from '@/components/home/Skills'; |
| 10 | +import AJLogoLeft from '@/components/global/icons/AJAlt'; |
| 11 | +import KCAlt from '@/components/global/icons/KCAlt'; |
| 12 | +import AJHeartAlt from '@/components/global/icons/AJHeartAlt'; |
| 13 | +import Podcasts from '@/components/global/icons/nav/Podcasts'; |
| 14 | +import AJPrimary from '@/components/global/icons/AJPrimary'; |
| 15 | +import { Site } from '@/models/site.model'; |
| 16 | + |
| 17 | +interface StaticParams { |
| 18 | + site: Site; |
| 19 | + recentPosts: { |
| 20 | + [key: string]: Post[]; |
| 21 | + }; |
| 22 | +} |
| 23 | + |
| 24 | +const HomeDetail = ({ site, recentPosts }: StaticParams) => { |
| 25 | + return ( |
| 26 | + <> |
| 27 | + <div> |
| 28 | + {/* COURSES */} |
| 29 | + <BreakBarLeft> |
| 30 | + <Skills /> |
| 31 | + </BreakBarLeft> |
| 32 | + <section className="grid w-full gap-10 px-4 mx-auto mb-4 xl:px-10"> |
| 33 | + <h2 className="mt-4 text-4xl light:text-primary-900 lg:text-5xl"> |
| 34 | + Latest Courses |
| 35 | + </h2> |
| 36 | + <PostsCards posts={recentPosts[PostType.course]} /> |
| 37 | + <Link href="/courses"> |
| 38 | + <a className="justify-self-center"> |
| 39 | + <button className="btn-primary" type="button"> |
| 40 | + View All Courses |
| 41 | + </button> |
| 42 | + </a> |
| 43 | + </Link> |
| 44 | + </section> |
| 45 | + {/* TUTORIALS */} |
| 46 | + <BreakBarRight> |
| 47 | + <AJLogoLeft className="w-16 sm:w-16 md:w-20" /> |
| 48 | + <h3 className="absolute w-1/2 text-2xl text-center sm:left-0 sm:w-full left-1/4 text-basics-50 sm:text-4xl lg:text-4xl"> |
| 49 | + Learn with AJ and KC |
| 50 | + </h3> |
| 51 | + <KCAlt className="w-14 sm:w-14 md:w-20" /> |
| 52 | + </BreakBarRight> |
| 53 | + <section className="grid w-full gap-10 px-4 mx-auto mb-4 xl:px-10"> |
| 54 | + <h2 className="mt-4 text-4xl text-right light:text-primary-900 lg:text-5xl"> |
| 55 | + Latest Tutorials |
| 56 | + </h2> |
| 57 | + <PostsCards posts={recentPosts[PostType.tutorial]} /> |
| 58 | + <Link href="/tutorials"> |
| 59 | + <a className="justify-self-center"> |
| 60 | + <button className="btn-primary" type="button"> |
| 61 | + View All Tutorials |
| 62 | + </button> |
| 63 | + </a> |
| 64 | + </Link> |
| 65 | + </section> |
| 66 | + {/* BLOG */} |
| 67 | + <BreakBarLeft> |
| 68 | + <div className="relative flex items-center w-full"> |
| 69 | + <AJHeartAlt className="w-16 sm:w-16 md:w-20" /> |
| 70 | + <h3 className="absolute w-3/4 ml-4 text-2xl text-center sm:left-0 sm:w-full left-16 text-basics-50 sm:text-4xl md:text-2xl lg:text-4xl"> |
| 71 | + Read what's going on in web dev |
| 72 | + </h3> |
| 73 | + </div> |
| 74 | + </BreakBarLeft> |
| 75 | + <section className="grid w-full gap-10 px-4 mx-auto mb-4 xl:px-10"> |
| 76 | + <h2 className="mt-4 text-4xl light:text-primary-900 lg:text-5xl"> |
| 77 | + Blog Posts |
| 78 | + </h2> |
| 79 | + <PostsCards posts={recentPosts[PostType.post]} /> |
| 80 | + <Link href="/blog"> |
| 81 | + <a className="justify-self-center"> |
| 82 | + <button className="btn-primary" type="button"> |
| 83 | + View All Posts |
| 84 | + </button> |
| 85 | + </a> |
| 86 | + </Link> |
| 87 | + </section> |
| 88 | + {/* PODCASTS */} |
| 89 | + <BreakBarRight> |
| 90 | + <div className="relative flex items-center justify-end w-full"> |
| 91 | + <h3 className="absolute left-0 w-3/4 ml-4 text-2xl text-center sm:w-full text-basics-50 sm:text-3xl md:text-3xl lg:text-4xl"> |
| 92 | + Listen to the latest tech news |
| 93 | + </h3> |
| 94 | + <Podcasts className="w-16 sm:w-16 md:w-20" /> |
| 95 | + </div> |
| 96 | + </BreakBarRight> |
| 97 | + <section className="grid w-full gap-10 px-4 mx-auto mb-4 xl:px-10"> |
| 98 | + <h2 className="mt-4 text-4xl text-right light:text-primary-900 lg:text-5xl"> |
| 99 | + Latest Podcasts |
| 100 | + </h2> |
| 101 | + <PostsCards posts={recentPosts[PostType.podcast]} /> |
| 102 | + <Link href="/podcasts"> |
| 103 | + <a className="justify-self-center"> |
| 104 | + <button className="btn-primary" type="button"> |
| 105 | + View All Podcasts |
| 106 | + </button> |
| 107 | + </a> |
| 108 | + </Link> |
| 109 | + </section> |
| 110 | + </div> |
| 111 | + </> |
| 112 | + ); |
| 113 | +}; |
| 114 | +export default HomeDetail; |
0 commit comments