feat(site): add reusable social links component - #1018
Open
BaoT1301 wants to merge 2 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The marketing footer and the go/creators footer each hardcoded their own copy of Todd's social profile URLs, labels, and icons. That duplication meant a profile change (or a new platform) had to be made in two places and could drift, which it already had: the two footers listed different platform sets and the Discord URL carried a trailing space. Adds a shared `SocialLinks` component under `components/common` with a single `SOCIAL_LINKS` source of truth for every profile (href, aria label, icon). It renders accessible external icon links that open in a new tab with `rel="noopener noreferrer"`, and takes optional `platforms` (which set and order) and `iconSize` props so each surface controls its own presentation without duplicating the data. Both footers now render `<SocialLinks />` instead of their own arrays. Each keeps its existing platform set and order (marketing: Instagram, LinkedIn, X, YouTube; go: X, Instagram, LinkedIn, YouTube, Discord), so the visible icons are unchanged. The only behavior change is that the marketing footer's social links now open in a new tab, matching the go footer. Includes unit tests (default render, platform subset and order, new-tab safety) and a Storybook story with all-platforms and per-footer variants.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #786
The marketing footer and the go/creators footer each hardcoded their own copy of Todd's social profile URLs, labels, and icons. That duplication meant a profile change (or a new platform) had to be made in two places and could drift, which it already had: the two footers listed different platform sets, and the go footer's Discord URL carried a trailing space.
What changed
SocialLinkscomponent undercomponents/common/social-links, with a singleSOCIAL_LINKSsource of truth for every profile (href, aria-label, icon).rel="noopener noreferrer", and accepts optionalplatforms(which set and in what order) andiconSizeprops so each surface controls its own presentation without duplicating the data.<SocialLinks />instead of their own arrays.Kept identical on purpose
Only behavior change
target="_blank"+rel="noopener noreferrer"), matching what the go footer already did. Previously they opened in the same tab via the locale-awareLink, which is meant for internal routes, not external URLs.Tests / stories
Checklist