-
Notifications
You must be signed in to change notification settings - Fork 0
Update dependencies, social icons, and PR deploys #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| --- | ||
| import { faLinkedin } from "@fortawesome/free-brands-svg-icons"; | ||
| import { siGithub, siX } from "simple-icons"; | ||
|
|
||
| const { name, size = 24, class: className, ...attrs } = Astro.props; | ||
|
Comment on lines
+1
to
+5
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding a |
||
|
|
||
| const [linkedinWidth, linkedinHeight, , , linkedinPath] = faLinkedin.icon; | ||
|
|
||
| const icons = { | ||
| github: { | ||
| label: siGithub.title, | ||
| path: siGithub.path, | ||
| viewBox: "0 0 24 24", | ||
| }, | ||
| linkedin: { | ||
| label: "LinkedIn", | ||
| path: linkedinPath, | ||
| viewBox: `0 0 ${linkedinWidth} ${linkedinHeight}`, | ||
| }, | ||
| twitter: { | ||
| label: siX.title, | ||
| path: siX.path, | ||
| viewBox: "0 0 24 24", | ||
| }, | ||
| }; | ||
|
|
||
| const icon = icons[name]; | ||
| --- | ||
|
|
||
| { | ||
| icon && ( | ||
| <svg | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| width={size} | ||
| height={size} | ||
| viewBox={icon.viewBox} | ||
| fill="currentColor" | ||
| role="img" | ||
| aria-label={icon.label} | ||
| class={className} | ||
| {...attrs} | ||
| > | ||
| <path d={icon.path} /> | ||
| </svg> | ||
| ) | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
as conston thesocialLinksarray ensures that theiconproperty is inferred as the literal types"github" | "linkedin" | "twitter"instead of a genericstring. This prevents TypeScript type mismatch errors when passinglink.iconto the typedSocialIconcomponent.