Skip to content

Commit 5057ffa

Browse files
committed
change main page for giveaway
1 parent e9b79e9 commit 5057ffa

6 files changed

Lines changed: 382 additions & 148 deletions

File tree

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
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+
{/* Hero */}
29+
<section className="grid justify-center grid-cols-1 p-8 mx-auto 2xl:gap-10 lg:grid-cols-2 lg:px-10 2xl:min-h-768 max-w-7xl">
30+
<section className="grid items-center content-center grid-cols-1 gap-4 mx-auto 2xl:mx-0 2xl:justify-self-end">
31+
<h1 className="pt-4 -mb-4 text-5xl leading-snug tracking-tight vertical-text-clip xl:tracking-wide xl:text-6xl xl:leading-snug 2xl:text-7xl 2xl:leading-snug">
32+
Purrfect
33+
<br />
34+
Web Tutorials
35+
</h1>
36+
<p className="font-sans 2xl:text-2xl" style={{ maxWidth: `40ch` }}>
37+
Get the skills you need to become a better web developer today.
38+
High quality courses with custom certificates and projects to show
39+
off your new skills.
40+
</p>
41+
<div className="flex flex-wrap gap-4">
42+
<Link href="/courses">
43+
<a className="btn-secondary justify-self-end" role="button">
44+
Start Now
45+
</a>
46+
</Link>
47+
<Link href="/user/profile">
48+
<a className="btn-primary justify-self-start" role="button">
49+
Join CodingCat.dev
50+
</a>
51+
</Link>
52+
</div>
53+
</section>
54+
<section className="grid grid-cols-1 row-start-1 -ml-10 lg:col-start-2 place-items-center 3xl:justify-items-start 3xl:ml-0">
55+
<AJPrimary className="w-1/2 max-w-xs lg:w-3/4 lg:max-w-md" />
56+
</section>
57+
</section>
58+
{/* COURSES */}
59+
<BreakBarLeft>
60+
<Skills />
61+
</BreakBarLeft>
62+
<section className="grid w-full gap-10 px-4 mx-auto mb-4 xl:px-10">
63+
<h2 className="mt-4 text-4xl light:text-primary-900 lg:text-5xl">
64+
Latest Courses
65+
</h2>
66+
<PostsCards posts={recentPosts[PostType.course]} />
67+
<Link href="/courses">
68+
<a className="justify-self-center">
69+
<button className="btn-primary" type="button">
70+
View All Courses
71+
</button>
72+
</a>
73+
</Link>
74+
</section>
75+
{/* TUTORIALS */}
76+
<BreakBarRight>
77+
<AJLogoLeft className="w-16 sm:w-16 md:w-20" />
78+
<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">
79+
Learn with AJ and KC
80+
</h3>
81+
<KCAlt className="w-14 sm:w-14 md:w-20" />
82+
</BreakBarRight>
83+
<section className="grid w-full gap-10 px-4 mx-auto mb-4 xl:px-10">
84+
<h2 className="mt-4 text-4xl text-right light:text-primary-900 lg:text-5xl">
85+
Latest Tutorials
86+
</h2>
87+
<PostsCards posts={recentPosts[PostType.tutorial]} />
88+
<Link href="/tutorials">
89+
<a className="justify-self-center">
90+
<button className="btn-primary" type="button">
91+
View All Tutorials
92+
</button>
93+
</a>
94+
</Link>
95+
</section>
96+
{/* BLOG */}
97+
<BreakBarLeft>
98+
<div className="relative flex items-center w-full">
99+
<AJHeartAlt className="w-16 sm:w-16 md:w-20" />
100+
<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">
101+
Read what&#39;s going on in web dev
102+
</h3>
103+
</div>
104+
</BreakBarLeft>
105+
<section className="grid w-full gap-10 px-4 mx-auto mb-4 xl:px-10">
106+
<h2 className="mt-4 text-4xl light:text-primary-900 lg:text-5xl">
107+
Blog Posts
108+
</h2>
109+
<PostsCards posts={recentPosts[PostType.post]} />
110+
<Link href="/blog">
111+
<a className="justify-self-center">
112+
<button className="btn-primary" type="button">
113+
View All Posts
114+
</button>
115+
</a>
116+
</Link>
117+
</section>
118+
{/* PODCASTS */}
119+
<BreakBarRight>
120+
<div className="relative flex items-center justify-end w-full">
121+
<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">
122+
Listen to the latest tech news
123+
</h3>
124+
<Podcasts className="w-16 sm:w-16 md:w-20" />
125+
</div>
126+
</BreakBarRight>
127+
<section className="grid w-full gap-10 px-4 mx-auto mb-4 xl:px-10">
128+
<h2 className="mt-4 text-4xl text-right light:text-primary-900 lg:text-5xl">
129+
Latest Podcasts
130+
</h2>
131+
<PostsCards posts={recentPosts[PostType.podcast]} />
132+
<Link href="/podcasts">
133+
<a className="justify-self-center">
134+
<button className="btn-primary" type="button">
135+
View All Podcasts
136+
</button>
137+
</a>
138+
</Link>
139+
</section>
140+
</div>
141+
</>
142+
);
143+
};
144+
export default HomeDetail;

‎frontend/main/src/components/user/Profile.tsx‎

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const UserMembership = dynamic<any>(
3131
}
3232
);
3333

34-
export default function Profile(): JSX.Element {
34+
export default function Profile({ main = false }): JSX.Element {
3535
const { data: signInCheckResult } = useSigninCheck();
3636
const firestore = useFirestore();
3737

@@ -95,22 +95,31 @@ export default function Profile(): JSX.Element {
9595
return (
9696
<FirebaseFirestoreProvider>
9797
<AuthWrapper fallback={notSignedIn()}>
98-
<section className="grid self-start w-full gap-10 p-10 lg:grid-cols-settings">
99-
<section>
100-
<h2 className="mb-4 font-sans text-4xl vertical-text-clip">
101-
Settings
102-
</h2>
103-
<SettingsLinks />
98+
{main ? (
99+
<>
100+
<UserMembership
101+
user={signInCheckResult?.user}
102+
products={products}
103+
/>
104+
</>
105+
) : (
106+
<section className="grid self-start w-full gap-10 p-10 lg:grid-cols-settings">
107+
<section>
108+
<h2 className="mb-4 font-sans text-4xl vertical-text-clip">
109+
Settings
110+
</h2>
111+
<SettingsLinks />
112+
</section>
113+
{signInCheckResult?.user && (
114+
<div className="flex flex-col">
115+
<UserMembership
116+
user={signInCheckResult.user}
117+
products={products}
118+
/>
119+
</div>
120+
)}
104121
</section>
105-
{signInCheckResult?.user && (
106-
<div className="flex flex-col">
107-
<UserMembership
108-
user={signInCheckResult.user}
109-
products={products}
110-
/>
111-
</div>
112-
)}
113-
</section>
122+
)}
114123
</AuthWrapper>
115124
</FirebaseFirestoreProvider>
116125
);

‎frontend/main/src/components/user/ProfileProFeatures.tsx‎

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
export default function ProfileProFeatures(): JSX.Element {
22
return (
33
<section>
4-
<div className="w-full p-8 text-2xl font-bold tracking-wide text-center uppercase border-b text-primary-900 border-primary-900">
5-
Why Go Pro?
4+
<div className="w-full p-8 text-2xl font-bold tracking-wide text-center uppercase border-b ">
5+
Why Join CodingCat.dev?
66
</div>
77
<div className="flex justify-center m-3">
88
<ul>
@@ -17,13 +17,13 @@ export default function ProfileProFeatures(): JSX.Element {
1717
</svg>
1818
</div>
1919
<div className="flex flex-col flex-wrap">
20-
<span className="ml-3 text-xl font-bold text-primary-900">
20+
<span className="ml-3 text-xl font-bold ">
2121
Ad Free Experience
2222
</span>
23-
<span className="max-w-sm ml-3 text-primary-900 text-md">
23+
<span className="max-w-sm ml-3 text-md">
2424
Enjoy CodingCat.dev Tutorial website 100% without ads.
2525
</span>
26-
<span className="max-w-sm ml-3 text-primary-900 text-md">
26+
<span className="max-w-sm ml-3 text-md">
2727
No referral links and no advertisements.
2828
</span>
2929
</div>
@@ -39,10 +39,8 @@ export default function ProfileProFeatures(): JSX.Element {
3939
</svg>
4040
</div>
4141
<div className="flex flex-col flex-wrap">
42-
<span className="ml-3 text-xl font-bold text-primary-900">
43-
Full Access
44-
</span>
45-
<span className="max-w-sm ml-3 text-primary-900 text-md">
42+
<span className="ml-3 text-xl font-bold ">Full Access</span>
43+
<span className="max-w-sm ml-3 text-md">
4644
Access the full CodingCat.dev Tutorial catalog and enjoy new
4745
premium tutorial series every single month.
4846
</span>
@@ -59,10 +57,10 @@ export default function ProfileProFeatures(): JSX.Element {
5957
</svg>
6058
</div>
6159
<div className="flex flex-col flex-wrap">
62-
<span className="ml-3 text-xl font-bold text-primary-900">
60+
<span className="ml-3 text-xl font-bold ">
6361
Free Series Video Download
6462
</span>
65-
<span className="max-w-sm ml-3 text-primary-900 text-md">
63+
<span className="max-w-sm ml-3 text-md">
6664
Full zip file of entire pro series.
6765
</span>
6866
</div>
@@ -78,10 +76,8 @@ export default function ProfileProFeatures(): JSX.Element {
7876
</svg>
7977
</div>
8078
<div className="flex flex-col flex-wrap">
81-
<span className="ml-3 text-xl font-bold text-primary-900">
82-
Like and Bookmark
83-
</span>
84-
<span className="max-w-sm ml-3 text-primary-900 text-md">
79+
<span className="ml-3 text-xl font-bold ">Like and Bookmark</span>
80+
<span className="max-w-sm ml-3 text-md">
8581
Allows for better feedback, and you can see what courses work
8682
better for you!
8783
</span>
@@ -98,10 +94,8 @@ export default function ProfileProFeatures(): JSX.Element {
9894
</svg>
9995
</div>
10096
<div className="flex flex-col flex-wrap">
101-
<span className="ml-3 text-xl font-bold text-primary-900">
102-
Track Progress
103-
</span>
104-
<span className="max-w-sm ml-3 text-primary-900 text-md">
97+
<span className="ml-3 text-xl font-bold ">Track Progress</span>
98+
<span className="max-w-sm ml-3 text-md">
10599
Some of the courses are very detailed, tracking allows you to
106100
remember where you left off.
107101
</span>

‎frontend/main/src/components/user/UserMembership.tsx‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,13 @@ export default function UserMembership({
2525
{member || team ? (
2626
<section>
2727
<div className="grid gap-3 m-2 justify-items-center place-items-center">
28-
<div className="text-2xl">
29-
You are already a member. Would you like to see your membership?
30-
Or just start with courses?
31-
</div>
28+
<div className="text-2xl">You are already a member.</div>
3229
<div className="grid grid-flow-col gap-3 justify-items-center">
33-
<Link href="/user/membership">
30+
{/* <Link href="/user/membership">
3431
<a>
3532
<div className=" btn-primary">See Membership</div>
3633
</a>
37-
</Link>
34+
</Link> */}
3835
<Link href="/courses">
3936
<a>
4037
<div className="btn-secondary">Start Courses</div>

0 commit comments

Comments
 (0)