File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,25 +6,25 @@ import IconShare from "@/assets/icons/IconShare.svg";
66const URL = Astro .url ;
77---
88
9- < div
10- class = " flex flex-col flex-wrap items-center justify-center gap-1 sm:items-start "
11- >
12- <label class =" flex flex-auto flex-row items-center-safe gap-1" >
13- <IconShare />
14- <span class =" italic" >Share this post on</span >
15- </label >
16- <div class =" text-center" >
17- {
18- SHARE_LINKS . map ( social => (
19- < LinkButton
20- href = { ` ${ social . href + URL } ` }
21- class = " scale-90 p-2 hover:rotate-6 sm:p-1 "
22- title = { social . linkTitle }
23- >
24- < social.icon class = " inline-block size-6 scale-125 fill-transparent stroke-current stroke-2 opacity-90 group-hover:fill-transparent sm:scale-110 " / >
25- <span class = " sr-only " > { social . linkTitle } </ span >
26- </ LinkButton >
27- ))
28- }
29- </ div >
30- </ div >
9+ {
10+ SHARE_LINKS . length > 0 && (
11+ < div class = " flex flex-none flex-col items-center justify-center gap-1 sm:items-start " >
12+ <label class = " flex flex-auto flex-row items-center-safe gap-1" >
13+ <IconShare />
14+ <span class = " italic" >Share this post on</span >
15+ </label >
16+ <div class = " text-center" >
17+ { SHARE_LINKS . map ( social => (
18+ < LinkButton
19+ href = { ` ${ social . href + URL } ` }
20+ class = " scale-90 p-2 hover:rotate-6 sm:p-1 "
21+ title = { social . linkTitle }
22+ >
23+ < social.icon class = " inline-block size-6 scale-125 fill-transparent stroke-current stroke-2 opacity-90 group-hover:fill-transparent sm:scale-110 " / >
24+ < span class = " sr-only " > { social . linkTitle } </ span >
25+ </ LinkButton >
26+ )) }
27+ </ div >
28+ </ div >
29+ )
30+ }
Original file line number Diff line number Diff line change 1+ import type { Props } from "astro" ;
12import IconMail from "@/assets/icons/IconMail.svg" ;
23import IconGitHub from "@/assets/icons/IconGitHub.svg" ;
34import IconBrandX from "@/assets/icons/IconBrandX.svg" ;
@@ -8,11 +9,18 @@ import IconTelegram from "@/assets/icons/IconTelegram.svg";
89import IconPinterest from "@/assets/icons/IconPinterest.svg" ;
910import { SITE } from "@/config" ;
1011
11- export const SOCIALS = [
12+ interface Social {
13+ name : string ;
14+ href : string ;
15+ linkTitle : string ;
16+ icon : ( _props : Props ) => Element ;
17+ }
18+
19+ export const SOCIALS : Social [ ] = [
1220 {
1321 name : "Github" ,
1422 href : "https://github.com/satnaing/astro-paper" ,
15- linkTitle : ` ${ SITE . title } on Github` ,
23+ linkTitle : `${ SITE . title } on Github` ,
1624 icon : IconGitHub ,
1725 } ,
1826 {
@@ -35,7 +43,7 @@ export const SOCIALS = [
3543 } ,
3644] as const ;
3745
38- export const SHARE_LINKS = [
46+ export const SHARE_LINKS : Social [ ] = [
3947 {
4048 name : "WhatsApp" ,
4149 href : "https://wa.me/?text=" ,
You can’t perform that action at this time.
0 commit comments