Skip to content

Commit e143e9e

Browse files
Copilotmarco-souza
andauthored
ref: update social network icons (#251)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: marco-souza <4452113+marco-souza@users.noreply.github.com> Co-authored-by: Marco Souza <marco.souza@mongodb.com>
1 parent aa2559a commit e143e9e

5 files changed

Lines changed: 55 additions & 42 deletions

File tree

e2e/site.spec.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,31 @@ test.describe('Homepage', () => {
3131
const footer = page.locator('footer');
3232
await expect(footer).toBeInViewport();
3333
});
34+
35+
test('shows only official social links in the footer', async ({ page }) => {
36+
await page.goto('/');
37+
38+
const socialLinks = page.locator('footer').getByTestId('social-links');
39+
40+
await expect(socialLinks.getByRole('link', { name: /podcodar no github/i })).toHaveAttribute(
41+
'href',
42+
'https://github.com/podcodar/'
43+
);
44+
await expect(socialLinks.getByRole('link', { name: /podcodar no linkedin/i })).toHaveAttribute(
45+
'href',
46+
'https://www.linkedin.com/company/podcodar/'
47+
);
48+
await expect(socialLinks.getByRole('link', { name: /podcodar no instagram/i })).toHaveAttribute(
49+
'href',
50+
'https://www.instagram.com/podcodar/'
51+
);
52+
await expect(socialLinks.getByRole('link', { name: /podcodar no youtube/i })).toHaveAttribute(
53+
'href',
54+
'https://www.youtube.com/@podcodar5070/'
55+
);
56+
57+
await expect(socialLinks.getByRole('link')).toHaveCount(4);
58+
});
3459
});
3560

3661
// ──────────────────────────────────────────────────────────────────────────────

src/components/Footer.astro

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
2-
import { Icon } from 'astro-icon/components';
32
import Logo from '@/components/Logo.astro';
4-
import { footerSocialIconify, footerSocialLinks } from '@/data/social-links';
3+
import SocialLinks from '@/components/SocialLinks.astro';
54
import { getLangFromUrl, useTranslations } from '@/i18n/utils';
65
76
const today = new Date();
@@ -14,25 +13,5 @@ const t = useTranslations(lang);
1413
<Logo size="sm" showTitle class="justify-center" />
1514
</div>
1615
<p class="m-0">&copy; {today.getFullYear()} PodCodar. {t('footer.copyright')}</p>
17-
<div class="mt-6 flex flex-wrap justify-center gap-5 sm:gap-6">
18-
{
19-
footerSocialLinks.map((link) => (
20-
<a
21-
href={link.href}
22-
target="_blank"
23-
rel="noopener noreferrer"
24-
class="text-base-content/70 hover:text-primary transition-colors"
25-
>
26-
<span class="sr-only">{link.label}</span>
27-
<Icon
28-
name={footerSocialIconify[link.network]}
29-
aria-hidden="true"
30-
width={28}
31-
height={28}
32-
class="inline-block"
33-
/>
34-
</a>
35-
))
36-
}
37-
</div>
16+
<SocialLinks />
3817
</footer>

src/components/SocialLinks.astro

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
import { Icon } from 'astro-icon/components';
3+
import { socialIconify, socialLinks } from '@/data/social-links';
4+
---
5+
6+
<div class="mt-6 flex flex-wrap justify-center gap-5 sm:gap-6" data-testid="social-links">
7+
{
8+
socialLinks.map((link) => (
9+
<a
10+
href={link.href}
11+
target="_blank"
12+
rel="noopener noreferrer"
13+
class="text-base-content/70 hover:text-primary transition-colors"
14+
>
15+
<span class="sr-only">{link.label}</span>
16+
<Icon name={socialIconify[link.network]} aria-hidden="true" width={28} height={28} class="inline-block" />
17+
</a>
18+
))
19+
}
20+
</div>

src/data/social-links.ts

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
/**
22
* Footer / social presence. Update hrefs if a handle or invite URL changes.
33
*/
4-
export type SocialNetwork = 'github' | 'linkedin' | 'instagram' | 'youtube' | 'x' | 'discord';
4+
const SOCIAL_LINKS = ['github', 'linkedin', 'instagram', 'youtube'] as const;
55

6-
export type FooterSocialLink = {
6+
export type SocialNetwork = (typeof SOCIAL_LINKS)[number];
7+
8+
export type SocialLink = {
79
href: string;
810
/** Screen reader label (pt-BR). */
911
label: string;
1012
network: SocialNetwork;
1113
};
1214

1315
/** Iconify ids for `astro-icon` + `@iconify-json/simple-icons`. */
14-
export const footerSocialIconify: Record<SocialNetwork, string> = {
16+
export const socialIconify: Record<SocialNetwork, string> = {
1517
github: 'simple-icons:github',
1618
linkedin: 'simple-icons:linkedin',
1719
instagram: 'simple-icons:instagram',
1820
youtube: 'simple-icons:youtube',
19-
x: 'simple-icons:x',
20-
discord: 'simple-icons:discord',
2121
};
2222

23-
export const footerSocialLinks: FooterSocialLink[] = [
23+
export const socialLinks: SocialLink[] = [
2424
{
2525
network: 'github',
26-
href: 'https://github.com/podcodar',
26+
href: 'https://github.com/podcodar/',
2727
label: 'PodCodar no GitHub',
2828
},
2929
{
@@ -38,17 +38,7 @@ export const footerSocialLinks: FooterSocialLink[] = [
3838
},
3939
{
4040
network: 'youtube',
41-
href: 'https://www.youtube.com/@podcodar',
41+
href: 'https://www.youtube.com/@podcodar5070/',
4242
label: 'PodCodar no YouTube',
4343
},
44-
{
45-
network: 'x',
46-
href: 'https://x.com/podcodar',
47-
label: 'PodCodar no X',
48-
},
49-
{
50-
network: 'discord',
51-
href: 'https://discord.com/invite/podcodar',
52-
label: 'PodCodar no Discord',
53-
},
5444
];

src/data/transparency.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ export const METRICS = [
1818
{ value: '300+', label: 'membros' },
1919
{ value: '30+', label: 'mentorados' },
2020
{ value: '16+', label: 'colocados em empregos' },
21-
{ value: '2', label: 'colocados em universidades federais' },
2221
] as const;
2322

2423
export type BoardMember = (typeof BOARD_MEMBERS)[number];

0 commit comments

Comments
 (0)