From 6055b9b604a86c1ed9a10804f6ebd09402f1343c Mon Sep 17 00:00:00 2001 From: kieronjmckenna Date: Sat, 18 Nov 2023 17:46:01 +0000 Subject: [PATCH] fix: linkedin oidc logo and title in react auth --- packages/react/src/components/Auth/Icons.tsx | 1 + .../src/components/Auth/interfaces/SocialAuth.tsx | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/react/src/components/Auth/Icons.tsx b/packages/react/src/components/Auth/Icons.tsx index a4cbad8e..1a26ea7e 100644 --- a/packages/react/src/components/Auth/Icons.tsx +++ b/packages/react/src/components/Auth/Icons.tsx @@ -22,6 +22,7 @@ export const Icons = ({ provider }: IconsProps) => { if (provider == 'azure') return azure() if (provider == 'keycloak') return keycloak() if (provider == 'linkedin') return linkedin() + if (provider == 'linkedin_oidc') return linkedin() if (provider == 'notion') return notion() if (provider == 'slack') return slack() if (provider == 'spotify') return spotify() diff --git a/packages/react/src/components/Auth/interfaces/SocialAuth.tsx b/packages/react/src/components/Auth/interfaces/SocialAuth.tsx index 9339d7f5..80295b9d 100644 --- a/packages/react/src/components/Auth/interfaces/SocialAuth.tsx +++ b/packages/react/src/components/Auth/interfaces/SocialAuth.tsx @@ -58,6 +58,13 @@ function SocialAuth({ setLoading(false) } + function handleProviderNameEdgeCases(provider: string) { + if (provider === 'linkedin_oidc') { + return 'LinkedIn' + } + return provider + } + function capitalize(word: string) { const lower = word.toLowerCase() return word.charAt(0).toUpperCase() + lower.slice(1) @@ -87,7 +94,9 @@ function SocialAuth({ template( i18n?.[currentView]?.social_provider_text as string, { - provider: capitalize(provider), + provider: capitalize( + handleProviderNameEdgeCases(provider) + ), } )}