Skip to content

Commit 6be0ef9

Browse files
authored
Merge pull request #400 from CodingCatDev/main
Sync Main back to Dev
2 parents e9b79e9 + 176ec73 commit 6be0ef9

6 files changed

Lines changed: 355 additions & 147 deletions

File tree

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
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&#39;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;

‎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)