Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions e2e/site.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,31 @@ test.describe('Homepage', () => {
const footer = page.locator('footer');
await expect(footer).toBeInViewport();
});

test('shows only official social links in the footer', async ({ page }) => {
await page.goto('/');

const socialLinks = page.locator('footer').getByTestId('social-links');

await expect(socialLinks.getByRole('link', { name: /podcodar no github/i })).toHaveAttribute(
'href',
'https://github.com/podcodar/'
);
await expect(socialLinks.getByRole('link', { name: /podcodar no linkedin/i })).toHaveAttribute(
'href',
'https://www.linkedin.com/company/podcodar/'
);
await expect(socialLinks.getByRole('link', { name: /podcodar no instagram/i })).toHaveAttribute(
'href',
'https://www.instagram.com/podcodar/'
);
await expect(socialLinks.getByRole('link', { name: /podcodar no youtube/i })).toHaveAttribute(
'href',
'https://www.youtube.com/@podcodar5070/'
);

await expect(socialLinks.getByRole('link')).toHaveCount(4);
});
});

// ──────────────────────────────────────────────────────────────────────────────
Expand Down
25 changes: 2 additions & 23 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
import { Icon } from 'astro-icon/components';
import Logo from '@/components/Logo.astro';
import { footerSocialIconify, footerSocialLinks } from '@/data/social-links';
import SocialLinks from '@/components/SocialLinks.astro';
import { getLangFromUrl, useTranslations } from '@/i18n/utils';

const today = new Date();
Expand All @@ -14,25 +13,5 @@ const t = useTranslations(lang);
<Logo size="sm" showTitle class="justify-center" />
</div>
<p class="m-0">&copy; {today.getFullYear()} PodCodar. {t('footer.copyright')}</p>
<div class="mt-6 flex flex-wrap justify-center gap-5 sm:gap-6">
{
footerSocialLinks.map((link) => (
<a
href={link.href}
target="_blank"
rel="noopener noreferrer"
class="text-base-content/70 hover:text-primary transition-colors"
>
<span class="sr-only">{link.label}</span>
<Icon
name={footerSocialIconify[link.network]}
aria-hidden="true"
width={28}
height={28}
class="inline-block"
/>
</a>
))
}
</div>
<SocialLinks />
</footer>
20 changes: 20 additions & 0 deletions src/components/SocialLinks.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
import { Icon } from 'astro-icon/components';
import { socialIconify, socialLinks } from '@/data/social-links';
---

<div class="mt-6 flex flex-wrap justify-center gap-5 sm:gap-6" data-testid="social-links">
{
socialLinks.map((link) => (
<a
href={link.href}
target="_blank"
rel="noopener noreferrer"
class="text-base-content/70 hover:text-primary transition-colors"
>
<span class="sr-only">{link.label}</span>
<Icon name={socialIconify[link.network]} aria-hidden="true" width={28} height={28} class="inline-block" />
</a>
))
}
</div>
26 changes: 8 additions & 18 deletions src/data/social-links.ts
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/**
* Footer / social presence. Update hrefs if a handle or invite URL changes.
*/
export type SocialNetwork = 'github' | 'linkedin' | 'instagram' | 'youtube' | 'x' | 'discord';
const SOCIAL_LINKS = ['github', 'linkedin', 'instagram', 'youtube'] as const;

export type FooterSocialLink = {
export type SocialNetwork = (typeof SOCIAL_LINKS)[number];

export type SocialLink = {
href: string;
/** Screen reader label (pt-BR). */
label: string;
network: SocialNetwork;
};

/** Iconify ids for `astro-icon` + `@iconify-json/simple-icons`. */
export const footerSocialIconify: Record<SocialNetwork, string> = {
export const socialIconify: Record<SocialNetwork, string> = {
github: 'simple-icons:github',
linkedin: 'simple-icons:linkedin',
instagram: 'simple-icons:instagram',
youtube: 'simple-icons:youtube',
x: 'simple-icons:x',
discord: 'simple-icons:discord',
};

export const footerSocialLinks: FooterSocialLink[] = [
export const socialLinks: SocialLink[] = [
{
network: 'github',
href: 'https://github.com/podcodar',
href: 'https://github.com/podcodar/',
label: 'PodCodar no GitHub',
},
{
Expand All @@ -38,17 +38,7 @@ export const footerSocialLinks: FooterSocialLink[] = [
},
{
network: 'youtube',
href: 'https://www.youtube.com/@podcodar',
href: 'https://www.youtube.com/@podcodar5070/',
label: 'PodCodar no YouTube',
},
{
network: 'x',
href: 'https://x.com/podcodar',
label: 'PodCodar no X',
},
{
network: 'discord',
href: 'https://discord.com/invite/podcodar',
label: 'PodCodar no Discord',
},
];
1 change: 0 additions & 1 deletion src/data/transparency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ export const METRICS = [
{ value: '300+', label: 'membros' },
{ value: '30+', label: 'mentorados' },
{ value: '16+', label: 'colocados em empregos' },
{ value: '2', label: 'colocados em universidades federais' },
] as const;

export type BoardMember = (typeof BOARD_MEMBERS)[number];
Expand Down
Loading