Feature/social auth buttons - #784
Open
Unclebaffa wants to merge 2 commits into
Open
Conversation
- Add SocialAuthButtons component with Google and Facebook buttons - Include inline SVG icons for both providers (no external deps) - Add divider with configurable 'or ...' label - Fully accessible: aria-label, role=group/separator, aria-hidden on decorative SVGs - Dark mode support via Tailwind dark: variants - No backend integration (UI only) - Fix pre-existing broken login page (code inside return statement) - Refactor register page to use shared SocialAuthButtons component - Add 7 unit tests for SocialAuthButtons (all passing)
…uth UI - feat: add SocialAuthButtons component (Google + Facebook, dark mode, SVG icons) - feat: integrate SocialAuthButtons into login and register pages - test: add 7 unit tests for SocialAuthButtons; all 153 tests pass across 15 suites TypeScript (tsc --noEmit now clean): - lib/api/client.ts: type headers as Record<string,string> to allow Authorization indexing - lib/types.ts: add experienceYears? field to Mentor interface - components/mentors/data.ts: re-export Mentor, ExperienceLevel; add EXPERIENCE_LEVELS array - components/mentors/DiscoveryMentorCard.tsx: nullish coalesce all optional Mentor fields - components/mentors/MentorComparisonDrawer.tsx: add rating ?? 0 and id || mentorId fallbacks - components/DiscussionMetadata.tsx: add full TypeScript types + React.CSSProperties - app/(public)/mentors/data/mockMentors.ts: type as Mentor[], add MENTORS + mentorSlug exports - app/(public)/mentors/[id]/page.tsx: type existing param in filter callback - app/(public)/mentors/components/MentorCard.tsx: replace @heroicons/react with lucide-react - app/(public)/resources/tracks/LearningTracks.tsx: fix LearningTrackCard import path - app/CategoryBadge.tsx: add ColorKey/ColorEntry types, typed COLOR_MAP and props - components/community/CreateDiscussionForm.tsx: import missing Toast component - components/icons.tsx: add named aliases (CodeIcon, GearIcon, ChevronRightIcon, etc.) - components/resources/icons.ts: create re-export barrel for resource icon imports ESLint (0 errors): - components/community/RichTextEditor.tsx: move ToolbarButton to module level - hooks/useDiscussions.ts: wrap setState in async IIFE to fix react-hooks/set-state-in-effect - components/ResourceSearchBar.tsx: wrap setState in microtask - lib/auth-context.tsx: use lazy useState initializer for localStorage reads Prettier: all files formatted clean Bug fixes: - app/layout.tsx: remove duplicate AuthProvider import - app/(dashboard)/community/[id]/page.tsx: fix duplicate content, unescaped JSX entities - app/(public)/discover-mentors/MentorDiscoveryView.tsx: fix corruption, align Mentor fields - app/(public)/mentors/page.tsx: fix duplicate component syntax and missing return wrapper - components/ui/StarRating.tsx: fix 1-indexed partial-fill star calculation - lib/utils.ts: replace missing clsx/tailwind-merge with pure cn() implementation
|
@Unclebaffa Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
Contributor
|
Please resolve conflict |
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.
Here are the full implementation notes:
Implementation Notes —
feature/social-auth-buttons(f7dc3d9)Final Verification State
npx tsc --noEmitnpm run lintnpx prettier --checknpx jest1. New Feature — Social Authentication Buttons
components/auth/SocialAuthButtons.tsx(NEW)A reusable, accessible component with Google + Facebook sign-in buttons.
aria-labelper buttononGoogleSignIn?,onFacebookSignIn?,className?— all optional (safe before OAuth is wired up)Integrated into both
app/(auth)/login/page.tsxandapp/(auth)/register/page.tsx.Tests —
__tests__/auth/SocialAuthButtons.test.tsx(NEW)7 unit tests: renders both buttons, divider text, callback invocation per button, graceful no-op without callbacks,
classNameforwarding, andaria-labelpresence.2. TypeScript Fixes (61 errors → 0)
lib/api/client.tsheadersasRecord<string, string>—HeadersInitdoesn't allow index accesslib/types.tsexperienceYears?: numbertoMentor(alongside existingyearsExperience?)components/mentors/data.tsMentor,ExperienceLevel; addedEXPERIENCE_LEVELSarraycomponents/mentors/DiscoveryMentorCard.tsxMentorfields (?? 0,?? [])components/mentors/MentorComparisonDrawer.tsxrating ?? 0,id || mentorId || ""fallbackscomponents/DiscussionMetadata.tsxReact.CSSProperties; fixednow - date→now.getTime() - date.getTime()app/(public)/mentors/data/mockMentors.tsMentor[], string IDs, addedMENTORSalias +mentorSlug()functionapp/(public)/mentors/[id]/page.tsxexisting: Mentorin filter callbackapp/(public)/mentors/components/MentorCard.tsx@heroicons/react(not installed) withlucide-reactStarapp/(public)/resources/tracks/LearningTracks.tsxLearningTrackCardimport path (landing/→components/)app/CategoryBadge.tsxColorKey/ColorEntrytypes, typedCOLOR_MAP,hashStringToColorKey, and component propscomponents/community/CreateDiscussionForm.tsxToastfrom@/components/ui/toastcomponents/icons.tsxCodeIcon,GearIcon,PaletteIcon,ChartIcon,RocketIcon,BriefcaseIcon,ChevronRightIcon,SearchIconcomponents/resources/icons.ts(NEW)HeroSearchBar'sSearchIconimport3. ESLint Fixes (28 errors → 0)
components/community/RichTextEditor.tsxToolbarButtondefined inside render — 26static-componentserrorshooks/useDiscussions.tssetStatecalled synchronously inside effectcomponents/ResourceSearchBar.tsxset-state-in-effectviolationPromise.resolve().then(...)lib/auth-context.tsxsetStatein effect forlocalStoragereaduseState(() => ...)initializer4. Bug Fixes
app/layout.tsxAuthProviderimport from merge conflictapp/(dashboard)/community/[id]/page.tsx'in JSX,timeAgoinside componentapp/(public)/discover-mentors/MentorDiscoveryView.tsxMentorfield names (hourlyRate,yearsOfExperience), filter function inlineapp/(public)/mentors/page.tsxreturn (components/ui/StarRating.tsxlib/utils.tsclsx/tailwind-mergewhich aren't inpackage.json— replaced with self-containedcn()5. Test Infrastructure
__tests__/ui/ResourceSearchBar.test.tsx— AddeduseSearchParamsto thenext/navigationmock (was missing, causing immediate crash)__tests__/ui/StarRating.test.tsx— Updated float assertions to tolerate rounding after the star formula fixCloses #611