Skip to content

Commit dcfd122

Browse files
committed
Enable custom social link background setting and use it for Instagram gradient background
1 parent 2dedfa5 commit dcfd122

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

components/PageSocial.module.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
}
88

99
.socialLink:hover {
10+
border-radius: 50%;
1011
color: var(--hover-color);
12+
background: var(--hover-background);
1113
}
1214

1315
.pageSocial .actionBgPane {

components/PageSocial.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ interface SocialLink {
1414
icon: ({ size }: { size: number }) => React.ReactNode
1515
color: string
1616
href?: string
17+
// Currently only used for instagram
18+
background?: string
1719
}
1820

1921
export const socialLinks: SocialLink[] = [
@@ -84,7 +86,8 @@ export const socialLinks: SocialLink[] = [
8486
name: 'instagram',
8587
href: `https://instagram.com/${config.instagram}`,
8688
title: `Instagram @${config.instagram}`,
87-
color: "#ff0000",
89+
color: "#ffffff",
90+
background: "radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%,#d6249f 60%, #285AEB 90%)",
8891
icon: FaInstagram
8992
},
9093

@@ -121,7 +124,7 @@ export function PageSocial() {
121124
rel='noopener noreferrer'
122125
>
123126
<div className={styles.actionBg}>
124-
<div className={styles.actionBgPane} />
127+
<div className={styles.actionBgPane} style={{ background: action.background } as React.CSSProperties} />
125128
</div>
126129

127130
<div className={styles.actionBg}>{action.icon({ size: 24 })}</div>
@@ -139,7 +142,7 @@ export function PageSocialButtons() {
139142
{socialLinks.map((action) => (
140143
<a
141144
key={action.name}
142-
style={{ '--hover-color': action.color } as React.CSSProperties}
145+
style={{ '--hover-background': action.background, '--hover-color': action.color } as React.CSSProperties}
143146
className={cs(styles[action.name], styles.socialLink)}
144147
href={action.href}
145148
title={action.title}

0 commit comments

Comments
 (0)