Skip to content

Commit 30ac990

Browse files
authored
make nice & extract into components (skillrecordings#177)
1 parent 09db701 commit 30ac990

File tree

3 files changed

+48
-17
lines changed

3 files changed

+48
-17
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React, {FunctionComponent} from 'react'
2+
import Link from 'next/link'
3+
4+
type CreateAccountCTAProps = {}
5+
6+
const CreateAccountCTA: FunctionComponent<CreateAccountCTAProps> = () => {
7+
return (
8+
<div className="flex flex-col items-center px-5">
9+
<h2 className="sm:text-2xl text-xl leading-tighter tracking-tight font-light text-center max-w-sm">
10+
This lesson is <strong className="font-bold">free to watch</strong>.
11+
</h2>
12+
<Link href="/login">
13+
<a className="mt-8 text-white py-3 px-5 rounded-md text-base font-semibold bg-blue-600 hover:bg-indigo-600 hover:shadow-xl transition-all ease-in-out duration-300 hover:scale-105 transform">
14+
Click here to Create an account or Login to view
15+
</a>
16+
</Link>
17+
</div>
18+
)
19+
}
20+
21+
export default CreateAccountCTA
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import React, {FunctionComponent} from 'react'
2+
import Link from 'next/link'
3+
4+
type JoinCTAProps = {}
5+
6+
const JoinCTA: FunctionComponent<JoinCTAProps> = () => {
7+
return (
8+
<div className="flex flex-col items-center px-5">
9+
<h2 className="sm:text-2xl text-xl leading-tighter tracking-tight font-light text-center">
10+
This lesson is an{' '}
11+
<strong className="font-bold">egghead member exclusive</strong>.
12+
</h2>
13+
<Link href="/pricing">
14+
<a className="mt-8 text-white py-3 px-5 rounded-md text-base font-semibold bg-blue-600 hover:bg-indigo-600 hover:shadow-xl transition-all ease-in-out duration-300 hover:scale-105 transform">
15+
Click here to join today and unlock this lesson
16+
</a>
17+
</Link>
18+
</div>
19+
)
20+
}
21+
22+
export default JoinCTA

src/pages/lessons/[slug].tsx

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import {NextSeo} from 'next-seo'
1919
import removeMarkdown from 'remove-markdown'
2020
import getTracer from 'utils/honeycomb-tracer'
2121
import {setupHttpTracing} from '@vercel/tracing-js'
22+
import CreateAccountCTA from 'components/pages/lessons/CreateAccountCTA'
23+
import JoinCTA from 'components/pages/lessons/JoinCTA copy'
2224

2325
const tracer = getTracer('lesson-page')
2426

@@ -239,7 +241,7 @@ const Lesson: FunctionComponent<LessonProps> = ({initialLesson}) => {
239241
}}
240242
>
241243
<div
242-
className="w-full relative overflow-hidden bg-gray-200"
244+
className="w-full relative overflow-hidden bg-black text-white"
243245
css={{paddingTop: '56.25%'}}
244246
>
245247
<div className="absolute w-full h-full top-0 left-0">
@@ -264,26 +266,12 @@ const Lesson: FunctionComponent<LessonProps> = ({initialLesson}) => {
264266

265267
{currentPlayerState === 'joining' && (
266268
<OverlayWrapper>
267-
<h2 className="sm:text-xl text-lg leading-tight font-bold text-center">
268-
This Lesson is Free to Watch
269-
</h2>
270-
<Link href="/login">
271-
<a className="no-underline hover:underline text-blue-500 mt-5 text-center">
272-
Click here to Create an Account or Login to View
273-
</a>
274-
</Link>
269+
<CreateAccountCTA />
275270
</OverlayWrapper>
276271
)}
277272
{currentPlayerState === 'subscribing' && (
278273
<OverlayWrapper>
279-
<h2 className="sm:text-xl text-lg leading-tight font-bold text-center">
280-
This Lesson is an egghead Member Exclusive
281-
</h2>
282-
<Link href="/pricing">
283-
<a className="no-underline hover:underline text-blue-500 mt-5 text-center">
284-
Click here to join today and unlock this lesson!
285-
</a>
286-
</Link>
274+
<JoinCTA />
287275
</OverlayWrapper>
288276
)}
289277
{currentPlayerState === 'showingNext' && (

0 commit comments

Comments
 (0)