1
- import { pick } from "lodash"
2
- import { getMessages , setRequestLocale } from "next-intl/server"
1
+ import { getTranslations , setRequestLocale } from "next-intl/server"
3
2
4
3
import { Lang } from "@/lib/types"
5
4
6
- import I18nProvider from "@/components/I18nProvider"
5
+ import { Image } from "@/components/Image"
6
+ import MainArticle from "@/components/MainArticle"
7
+ import StartWithEthereumFlow from "@/components/StartWithEthereumFlow"
8
+ import ShareModal from "@/components/StartWithEthereumFlow/ShareModal"
7
9
8
10
import { getMetadata } from "@/lib/utils/metadata"
9
- import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
10
11
import { getNewToCryptoWallets } from "@/lib/utils/wallets"
11
12
12
- import StartPage from "./_components/start"
13
+ import HeroImage from "@/public/images/heroes/developers-hub-hero.jpg"
14
+ import ManDogeImage from "@/public/images/start-with-ethereum/man-doge-playing.png"
13
15
14
16
const Page = async ( { params } : { params : Promise < { locale : Lang } > } ) => {
15
17
const { locale } = await params
16
18
17
19
setRequestLocale ( locale )
18
20
19
- // Get i18n messages
20
- const allMessages = await getMessages ( { locale } )
21
- const requiredNamespaces = getRequiredNamespacesForPage ( "/start" )
22
- const messages = pick ( allMessages , requiredNamespaces )
21
+ const t = await getTranslations ( { locale, namespace : "page-start" } )
23
22
24
23
const newToCryptoWallets = getNewToCryptoWallets ( )
25
24
const wallets = newToCryptoWallets . map ( ( wallet ) => ( {
@@ -28,9 +27,41 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
28
27
} ) )
29
28
30
29
return (
31
- < I18nProvider locale = { locale } messages = { messages } >
32
- < StartPage newToCryptoWallets = { wallets } />
33
- </ I18nProvider >
30
+ < MainArticle className = "flex w-full flex-col items-center overflow-x-hidden" >
31
+ < div className = "mb-16 h-[240px] w-full md:h-[380px] lg:h-[398px]" >
32
+ < Image
33
+ src = { HeroImage }
34
+ alt = { t ( "page-start-hero-alt" ) }
35
+ sizes = "(max-width: 1504px) 100vw, 1504px"
36
+ className = "h-full w-full object-cover"
37
+ priority
38
+ />
39
+ </ div >
40
+
41
+ < div className = "mb-36 flex flex-col gap-12 overflow-x-hidden px-8" >
42
+ < div className = "mx-auto flex max-w-[1000px] flex-col items-center gap-4 text-center" >
43
+ < h1 > { t ( "page-start-title" ) } </ h1 >
44
+ < p > { t ( "page-start-subtitle" ) } </ p >
45
+ </ div >
46
+
47
+ < div id = "start-with-ethereum-flow" className = "flex flex-col gap-12" >
48
+ < StartWithEthereumFlow locale = { locale } newToCryptoWallets = { wallets } />
49
+ </ div >
50
+
51
+ < div className = "flex w-full flex-col gap-12 rounded-2xl border border-accent-c/10 bg-gradient-to-t from-accent-c/10 from-20% to-accent-c/5 to-60% px-12 py-16 md:flex-row dark:from-accent-c/20 dark:to-accent-c/10" >
52
+ < div className = "flex flex-1 flex-col gap-8" >
53
+ < h2 className = "" > { t ( "page-start-share-section-title" ) } </ h2 >
54
+ < p > { t ( "page-start-share-section-description" ) } </ p >
55
+ < div className = "flex w-full md:w-auto" >
56
+ < ShareModal />
57
+ </ div >
58
+ </ div >
59
+ < div className = "flex max-w-[450px] flex-col items-center justify-center" >
60
+ < Image src = { ManDogeImage } alt = { t ( "page-start-man-doge-alt" ) } />
61
+ </ div >
62
+ </ div >
63
+ </ div >
64
+ </ MainArticle >
34
65
)
35
66
}
36
67
@@ -41,11 +72,13 @@ export async function generateMetadata({
41
72
} ) {
42
73
const { locale } = await params
43
74
75
+ const t = await getTranslations ( { locale, namespace : "page-start" } )
76
+
44
77
return await getMetadata ( {
45
78
locale,
46
79
slug : [ "start" ] ,
47
- title : "Start with crypto" ,
48
- description : "Your gateway to the world of ethereum" ,
80
+ title : t ( "page-start-meta-title" ) ,
81
+ description : t ( "page-start-meta-description" ) ,
49
82
image : "/images/heroes/developers-hub-hero.jpg" ,
50
83
} )
51
84
}
0 commit comments