1
1
import { useRouter } from "next/router"
2
2
import { useTranslation } from "next-i18next"
3
3
import { FaDiscord , FaGithub , FaTwitter } from "react-icons/fa"
4
+ import { IoChevronUpSharp } from "react-icons/io5"
4
5
import {
5
6
Box ,
6
7
Flex ,
@@ -17,8 +18,11 @@ import type { FooterLink, FooterLinkSection, Lang } from "@/lib/types"
17
18
import { BaseLink } from "@/components/Link"
18
19
import Translation from "@/components/Translation"
19
20
21
+ import { scrollIntoView } from "@/lib/utils/scrollIntoView"
20
22
import { getLocaleTimestamp } from "@/lib/utils/time"
21
23
24
+ import { Button } from "./Buttons"
25
+
22
26
const socialLinks = [
23
27
{
24
28
icon : FaGithub ,
@@ -331,40 +335,32 @@ const Footer = ({ lastDeployDate }: FooterProps) => {
331
335
return (
332
336
< Box as = "footer" py = "4" px = "8" >
333
337
< Flex
334
- fontSize = "md"
335
- justify = "space-between"
338
+ justify = { { base : "center" , md : 'space-between' } }
336
339
alignItems = "center"
337
340
flexWrap = "wrap"
341
+ gap = { 8 }
342
+ pt = { 4 }
343
+ pb = { 4 }
344
+ borderTop = { "1px solid" }
345
+ borderColor = { "body.light" }
338
346
>
339
347
{ lastDeployDate && (
340
- < Text >
348
+ < Text fontSize = { "sm" } fontStyle = { "italic" } color = { "body.medium" } >
341
349
< Translation id = "website-last-updated" /> :{ " " }
342
350
{ getLocaleTimestamp ( locale as Lang , lastDeployDate ) }
343
351
</ Text >
344
352
) }
345
- < Box my = { 4 } >
346
- { socialLinks . map ( ( { to, ariaLabel, icon } ) => (
347
- < BaseLink
348
- key = { to }
349
- href = { to }
350
- hideArrow
351
- color = "body.base"
352
- aria-label = { ariaLabel }
353
- ms = "4"
354
- _focus = { { color : "primary.base" } }
355
- >
356
- < Icon
357
- as = { icon }
358
- _hover = { {
359
- transition :
360
- "color 0.2s ease-in-out, transform 0.2s ease-in-out" ,
361
- } }
362
- fontSize = "4xl"
363
- />
364
- </ BaseLink >
365
- ) ) }
366
- </ Box >
353
+
354
+ < Button
355
+ leftIcon = { < IoChevronUpSharp /> }
356
+ variant = "outline"
357
+ isSecondary
358
+ onClick = { ( ) => scrollIntoView ( "__next" ) }
359
+ >
360
+ Go to top
361
+ </ Button >
367
362
</ Flex >
363
+
368
364
< SimpleGrid
369
365
gap = { 4 }
370
366
justifyContent = "space-between"
@@ -392,27 +388,58 @@ const Footer = ({ lastDeployDate }: FooterProps) => {
392
388
</ Box >
393
389
) ) }
394
390
</ SimpleGrid >
395
- < List
396
- display = "flex"
397
- flexWrap = "wrap"
391
+ < Flex
392
+ p = { 6 }
393
+ flexDir = "column"
394
+ alignItems = "center"
398
395
justifyContent = "center"
399
- my = "6"
400
- mx = "0"
401
- py = "8"
402
- px = "2"
403
- lineHeight = "base"
404
- fontWeight = "normal"
405
396
fontSize = "sm"
406
397
bg = "background.highlight"
407
398
>
408
- { dipperLinks . map ( ( { to, text } ) => (
409
- < ListItem key = { text } p = "2" m = "0" >
410
- < BaseLink href = { to } { ...linkProps } >
411
- { text }
399
+ < Box display = "flex" gap = { 4 } >
400
+ { socialLinks . map ( ( { to, ariaLabel, icon } ) => (
401
+ < BaseLink
402
+ key = { to }
403
+ href = { to }
404
+ hideArrow
405
+ color = "body.base"
406
+ aria-label = { ariaLabel }
407
+ _focus = { { color : "primary.base" } }
408
+ >
409
+ < Icon
410
+ as = { icon }
411
+ _hover = { {
412
+ transition :
413
+ "color 0.2s ease-in-out, transform 0.2s ease-in-out" ,
414
+ } }
415
+ fontSize = "4xl"
416
+ />
412
417
</ BaseLink >
413
- </ ListItem >
414
- ) ) }
415
- </ List >
418
+ ) ) }
419
+ </ Box >
420
+ < List
421
+ display = "flex"
422
+ flexDir = { { base : "column" , sm : "row" } }
423
+ flexWrap = "wrap"
424
+ justifyContent = { { base : "center" , sm : "space-between" , md : "center" } }
425
+ fontWeight = "normal"
426
+ fontSize = "sm"
427
+ p = { 5 }
428
+ m = { 0 }
429
+ >
430
+ { dipperLinks . map ( ( { to, text } ) => (
431
+ < ListItem
432
+ key = { text }
433
+ textAlign = "center"
434
+ px = "2"
435
+ >
436
+ < BaseLink href = { to } w = { [ "100%" , null ] } { ...linkProps } >
437
+ { text }
438
+ </ BaseLink >
439
+ </ ListItem >
440
+ ) ) }
441
+ </ List >
442
+ </ Flex >
416
443
</ Box >
417
444
)
418
445
}
0 commit comments