Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c145810

Browse files
committed
Add hero section when logged out
1 parent 17aa275 commit c145810

File tree

3 files changed

+50
-6
lines changed

3 files changed

+50
-6
lines changed

src/components/Hero.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { signIn } from 'next-auth/client'
2+
import { A } from '@/components'
3+
4+
export default function Hero() {
5+
return (
6+
<div className="relative bg-gray-50 overflow-hidden ">
7+
<div className="mx-auto max-w-7xl px-4 py-16">
8+
<div className="text-center">
9+
<h1 className="text-4xl tracking-tight font-extrabold text-gray-900 sm:text-5xl md:text-6xl">
10+
<span className="block text-indigo-600 xl:inline">Coderplex </span>
11+
<span className="block xl:inline">Community</span>
12+
</h1>
13+
<p className="mt-3 max-w-md mx-auto text-base text-gray-500 sm:text-lg md:mt-5 md:text-xl md:max-w-3xl">
14+
Lorem ipsum dolor sit amet consectetur adipisicing elit.
15+
Reprehenderit nam voluptatibus placeat perspiciatis porro laborum
16+
cum explicabo dolore quae.
17+
</p>
18+
<div className="mt-5 max-w-md mx-auto sm:flex sm:justify-center md:mt-8">
19+
<div className="rounded-md shadow">
20+
<button
21+
onClick={() => signIn('github')}
22+
className="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 md:py-4 md:text-lg md:px-10"
23+
>
24+
Join Community
25+
</button>
26+
</div>
27+
<div className="mt-3 rounded-md shadow sm:mt-0 sm:ml-3">
28+
<A
29+
href="https://chat.coderplex.org"
30+
className="w-full flex items-center justify-center px-8 py-3 border border-transparent text-base font-medium rounded-md text-indigo-600 bg-white hover:bg-gray-50 md:py-4 md:text-lg md:px-10"
31+
>
32+
Join Discord
33+
</A>
34+
</div>
35+
</div>
36+
</div>
37+
</div>
38+
</div>
39+
)
40+
}

src/components/HomePageFeed.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,25 @@ import {
1010
} from 'phosphor-react'
1111
import { HomePageFeedUpdateType } from 'src/pages'
1212
import { DateTime } from 'luxon'
13-
import { Markdown, A } from '@/components'
1413
import { useMutation, useQuery } from 'react-query'
1514
import classNames from 'classnames'
1615
import { useEffect, useReducer, useState } from 'react'
1716
import { signIn, useSession } from 'next-auth/client'
17+
import { User } from 'src/pages/members'
18+
import useFollowUser from './profile/useFollowUser'
1819
import {
20+
Markdown,
21+
A,
22+
Hero,
23+
AppNavBar,
24+
AppFooter,
1925
NewComment,
2026
NewGoal,
2127
NewUpdate,
2228
UpdateComment,
2329
UpdateComments,
2430
UpdateCommentsList,
25-
} from './goals'
26-
import { User } from 'src/pages/members'
27-
import AppNavBar from './AppNavBar'
28-
import AppFooter from './AppFooter'
29-
import useFollowUser from './profile/useFollowUser'
31+
} from '@/components'
3032

3133
type LikeData = {
3234
count: number
@@ -228,6 +230,7 @@ export default function HomePageFeed({
228230
<header className="bg-white shadow-sm sticky top-0 z-10">
229231
<AppNavBar />
230232
</header>
233+
{!session && <Hero />}
231234
<div className="py-10 flex-1">
232235
<div className="max-w-3xl mx-auto sm:px-6 lg:max-w-7xl lg:px-8 lg:grid lg:grid-cols-12 lg:gap-8">
233236
<div className="hidden lg:block lg:col-span-3 xl:col-span-2">

src/components/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ export * from './profile'
99
export * from './goals'
1010
export { default as Markdown } from './Markdown'
1111
export { default as HomePageFeed } from './HomePageFeed'
12+
export { default as Hero } from './Hero'

0 commit comments

Comments
 (0)