diff --git a/src/components/AboutPage.tsx b/src/components/AboutPage.tsx index d68a5d9..d256e8b 100644 --- a/src/components/AboutPage.tsx +++ b/src/components/AboutPage.tsx @@ -540,7 +540,9 @@ const AboutPage: React.FC = () => { Questions or want to learn more?
Get in touch with us diff --git a/src/components/AccountSettings.tsx b/src/components/AccountSettings.tsx index 2186204..60ef345 100644 --- a/src/components/AccountSettings.tsx +++ b/src/components/AccountSettings.tsx @@ -1,6 +1,6 @@ import React, { useState } from 'react'; import { motion } from 'framer-motion'; -import { User, Lock, AlertTriangle, Check } from 'lucide-react'; +import { User, Lock, AlertTriangle, Check, Github } from 'lucide-react'; import { useAuth } from '../hooks/useAuth'; import DashboardLayout from './DashboardLayout'; import { getApiBaseUrl } from '../utils/urlUtils'; @@ -26,9 +26,36 @@ const AccountSettings: React.FC = () => { text: string; } | null>(null); + // GitHub disconnect state + const [disconnecting, setDisconnecting] = useState(false); + const [confirmDisconnect, setConfirmDisconnect] = useState(false); + const [disconnectError, setDisconnectError] = useState(''); + const apiBase = getApiBaseUrl(); const token = localStorage.getItem('accessToken'); + const handleDisconnectGitHub = async () => { + setDisconnecting(true); + setDisconnectError(''); + try { + const res = await fetch(`${apiBase}/api/auth/disconnect/github`, { + method: 'POST', + headers: { Authorization: `Bearer ${token}` }, + }); + const data = await res.json(); + if (res.ok && data.success) { + updateUser(data.user); + setConfirmDisconnect(false); + } else { + setDisconnectError(data.message ?? 'Failed to disconnect GitHub.'); + } + } catch { + setDisconnectError('Network error. Please try again.'); + } finally { + setDisconnecting(false); + } + }; + const handleSaveProfile = async (e: React.FormEvent) => { e.preventDefault(); if (!fullName.trim()) return; @@ -280,6 +307,69 @@ const AccountSettings: React.FC = () => { )} + {/* GitHub Integration Section */} ++ GitHub Integration +
++ Are you sure? This will unlink your GitHub account from + Refactron. +
+ {disconnectError && ( +{disconnectError}
+ )} +
+
+ Refactron
+
+
+ Beta
+
+
+
+ >
)}
-
Notifications
- No notifications yet. -
-+ No notifications yet. +
) : (= ({ children }) => {
- {user?.email} +
+ {user?.fullName ?? user?.email}
+ {user?.fullName && ( ++ {user.email} +
+ )}- Signed in as -
-
- {user?.email}
+ >
+ )}
+
+
+
+ {user?.fullName ?? user?.email}
+
+ {user.email}
Questions? Reach out to us at{' '} - hello@refactron.dev + om@refactron.dev
diff --git a/src/components/EarlyAccessModal.tsx b/src/components/EarlyAccessModal.tsx index 5ef5431..e8e1e1c 100644 --- a/src/components/EarlyAccessModal.tsx +++ b/src/components/EarlyAccessModal.tsx @@ -54,10 +54,9 @@ const EarlyAccessModal: React.FCIf this problem persists, please{' '} contact our support team diff --git a/src/components/FAQSection.tsx b/src/components/FAQSection.tsx index d8edc82..6f96bb7 100644 --- a/src/components/FAQSection.tsx +++ b/src/components/FAQSection.tsx @@ -132,7 +132,9 @@ const FAQSection = () => { Have a specific question? Let's talk.
Contact Us diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx index a948d6f..18175cf 100644 --- a/src/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -167,7 +167,9 @@ const Footer: React.FC = () => {