File tree Expand file tree Collapse file tree 2 files changed +30
-22
lines changed Expand file tree Collapse file tree 2 files changed +30
-22
lines changed Original file line number Diff line number Diff line change @@ -5,22 +5,22 @@ import LinkButton from "./LinkButton.astro";
55const URL = Astro .url ;
66---
77
8- < div
9- class = " flex flex-col flex-wrap items-center justify-center gap-1 sm:items-start "
10- >
11- <span class =" italic" >Share this post on:</span >
12- <div class =" text-center" >
13- {
14- SHARE_LINKS . map ( social => (
15- < LinkButton
16- href = { ` ${ social . href + URL } ` }
17- class = " scale-90 p-2 hover:rotate-6 sm:p-1 "
18- title = { social . linkTitle }
19- >
20- < social.icon class = " inline-block size-6 scale-125 fill-transparent stroke-current stroke-2 opacity-90 group-hover:fill-transparent sm:scale-110 " / >
21- <span class = " sr-only " > { social . linkTitle } </ span >
22- </ LinkButton >
23- ))
24- }
25- </ div >
26- </ div >
8+ {
9+ SHARE_LINKS . length > 0 && (
10+ < div class = " flex flex-none flex-col items-center justify-center gap-1 sm:items-end " >
11+ <span class = " italic" >Share this post on:</span >
12+ <div class = " text-center" >
13+ { SHARE_LINKS . map ( social => (
14+ < LinkButton
15+ href = { ` ${ social . href + URL } ` }
16+ class = " scale-90 p-2 hover:rotate-6 sm:p-1 "
17+ title = { social . linkTitle }
18+ >
19+ < social.icon class = " inline-block size-6 scale-125 fill-transparent stroke-current stroke-2 opacity-90 group-hover:fill-transparent sm:scale-110 " / >
20+ < span class = " sr-only " > { social . linkTitle } </ span >
21+ </ LinkButton >
22+ )) }
23+ </ div >
24+ </ div >
25+ )
26+ }
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