-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: enhance ambassador card social media buttons #5113
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
base: master
Are you sure you want to change the base?
Changes from all commits
a368d89
b05ada8
15b639c
d8a5063
5a1fd37
4984ea4
fd36f95
5269193
dfd65ee
f6981d9
77b8faa
dd1214b
2e7bf8c
2a7c4a5
21c45af
dc2e896
0b67095
88a3588
77032b2
35c5ad3
a770077
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,9 @@ import type { Ambassador } from '@/types/pages/community/Community'; | |
| import { HeadingTypeStyle } from '@/types/typography/Heading'; | ||
|
|
||
| import Button from '../../../components/buttons/Button'; | ||
| import IconGithub from '../../../components/icons/Github'; | ||
| import IconLinkedIn from '../../../components/icons/LinkedIn'; | ||
| import IconTwitter from '../../../components/icons/Twitter'; | ||
| import GenericLayout from '../../../components/layout/GenericLayout'; | ||
| import NewsletterSubscribe from '../../../components/NewsletterSubscribe'; | ||
| import Heading from '../../../components/typography/Heading'; | ||
|
|
@@ -21,7 +24,6 @@ export function addAdditionalUserInfo(user: Ambassador) { | |
| ...user | ||
| }; | ||
|
|
||
| // add social links | ||
| if (userData.github) { | ||
| userData.githubUrl = `https://www.github.com/${userData.github}`; | ||
| } | ||
|
|
@@ -32,8 +34,6 @@ export function addAdditionalUserInfo(user: Ambassador) { | |
| userData.twitterUrl = `https://www.twitter.com/${userData.twitter}`; | ||
| } | ||
|
|
||
| // add img url | ||
| // github redirects to avatar url using `https://www.github.com/<username>.png` | ||
| userData.img = `${userData.githubUrl}.png`; | ||
|
|
||
| return userData; | ||
|
|
@@ -49,11 +49,15 @@ export default function Index() { | |
| ['name'] | ||
| ); | ||
|
|
||
| // Variable to handle long URL and pass max-len linter | ||
| const ambassadorProgramUrl = | ||
| 'https://github.com/asyncapi/community/blob/master/docs/020-governance-and-policies/AMBASSADOR_PROGRAM.md'; | ||
|
|
||
| return ( | ||
| <GenericLayout title='AsyncAPI Ambassador Program' description='The AsyncAPI Ambassador Program' image={image} wide> | ||
| <div className='flex flex-col items-center justify-between lg:flex-row' data-testid='Ambassadors-main'> | ||
| <div className='w-full text-center lg:w-[45%] lg:text-left' data-testid='Ambassadors-content'> | ||
| <h1 className='mt-10 text-3xl font-semibold md:text-4xl lg:text-5xl' data-testid='Ambassadors-title'> | ||
| <h1 className='mt-10 text-3xl font-semibold md:text-4xl lg:text-5xl' data-testid='Ambassadors-title'> | ||
| Teachers. Champions. <span className='countdown-text-gradient'>Ambassadors!</span> | ||
| </h1> | ||
| <Heading typeStyle={HeadingTypeStyle.bodyLg} textColor='text-gray-700' className='mt-5 text-slate-500'> | ||
|
|
@@ -64,7 +68,7 @@ export default function Index() { | |
| <Button | ||
| className='mt-10 block text-center focus:outline-none md:inline-block' | ||
| text='Become an AsyncAPI Ambassador' | ||
| href='https://github.com/asyncapi/community/blob/master/docs/020-governance-and-policies/AMBASSADOR_PROGRAM.md' | ||
| href={ambassadorProgramUrl} | ||
| target='_blank' | ||
| /> | ||
| </div> | ||
|
|
@@ -123,11 +127,8 @@ export default function Index() { | |
| <div data-testid='Ambassadors-members-country'>{ambassador.country}</div> | ||
| </div> | ||
| <Link href={`ambassadors/${ambassador.github}`} as={`ambassadors/${ambassador.github}`}> | ||
| <div className='p-2'> | ||
| <div | ||
| className='h-auto w-full cursor-pointer rounded-md bg-center' | ||
| data-testid='Ambassadors-members-img' | ||
| > | ||
| <div className='p-2 cursor-pointer'> | ||
| <div className='h-auto w-full rounded-md bg-center' data-testid='Ambassadors-members-img'> | ||
| <img | ||
| src={ambassador.img} | ||
| alt={ambassador.name} | ||
|
|
@@ -140,22 +141,38 @@ export default function Index() { | |
| </div> | ||
| <div className='flex h-full flex-col justify-between'> | ||
| <div className='p-2 text-sm'>{ambassador.bio}</div> | ||
| <div className='flex border-t p-2' data-testid='Ambassadors-members-socials'> | ||
| <a | ||
| href={ambassador.twitterUrl} | ||
| target='_blank' | ||
| rel='noreferrer' | ||
| className='underline' | ||
| data-testid='Ambassadors-members-twitter' | ||
| > | ||
| Twitter ↗ | ||
| </a> | ||
| <a href={ambassador.githubUrl} target='_blank' rel='noreferrer' className='ml-3 underline'> | ||
| Github ↗ | ||
| </a> | ||
| <a href={ambassador.linkedinUrl} target='_blank' rel='noreferrer' className='ml-3 underline'> | ||
| Linkedin ↗ | ||
| </a> | ||
| <div className='flex border-t p-2 gap-4' data-testid='Ambassadors-members-socials'> | ||
| {ambassador.twitterUrl && ( | ||
| <a | ||
| href={ambassador.twitterUrl} | ||
| target='_blank' | ||
| rel='noreferrer' | ||
| className='text-gray-500 hover:text-black transition-colors' | ||
| data-testid='Ambassadors-members-twitter' | ||
| > | ||
| <IconTwitter className='h-5 w-5 fill-current' /> | ||
| </a> | ||
|
Comment on lines
+145
to
+154
Contributor
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. Social icon links missing accessible labels. Screen readers will announce these links as empty since there's no visible text and no ♿ Proposed fix — add aria-labels to all three social links <a
href={ambassador.twitterUrl}
target='_blank'
rel='noreferrer'
className='text-gray-500 hover:text-black transition-colors'
data-testid='Ambassadors-members-twitter'
+ aria-label={`${ambassador.name} on Twitter`}
>
<a
href={ambassador.githubUrl}
target='_blank'
rel='noreferrer'
className='text-gray-500 hover:text-black transition-colors'
+ aria-label={`${ambassador.name} on GitHub`}
>
<a
href={ambassador.linkedinUrl}
target='_blank'
rel='noreferrer'
className='text-gray-500 hover:text-[`#0077b5`] transition-colors'
+ aria-label={`${ambassador.name} on LinkedIn`}
>🤖 Prompt for AI Agents
Member
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. have a look at the coderabbit's suggestion @yashdarekar17
Contributor
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.
|
||
| )} | ||
| {ambassador.githubUrl && ( | ||
| <a | ||
| href={ambassador.githubUrl} | ||
| target='_blank' | ||
| rel='noreferrer' | ||
| className='text-gray-500 hover:text-black transition-colors' | ||
| > | ||
| <IconGithub className='h-5 w-5 fill-current' /> | ||
| </a> | ||
| )} | ||
| {ambassador.linkedinUrl && ( | ||
| <a | ||
| href={ambassador.linkedinUrl} | ||
| target='_blank' | ||
| rel='noreferrer' | ||
| className='text-gray-500 hover:text-[#0077b5] transition-colors' | ||
| > | ||
| <IconLinkedIn className='h-5 w-5 fill-current' /> | ||
| </a> | ||
| )} | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
@@ -205,7 +222,7 @@ export default function Index() { | |
| <Button | ||
| className='mt-5 block text-center focus:outline-none md:mt-10 md:inline-block md:w-[48%]' | ||
| text='Become an Ambassador now' | ||
| href='https://github.com/asyncapi/community/blob/master/docs/020-governance-and-policies/AMBASSADOR_PROGRAM.md' | ||
| href={ambassadorProgramUrl} | ||
| target='_blank' | ||
| /> | ||
| <Button | ||
|
|
||
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.
don't add unnecessary comment