diff --git a/app/components/@settings/tabs/connections/GithubConnection.tsx b/app/components/@settings/tabs/connections/GithubConnection.tsx
index c6142834..e2d8924f 100644
--- a/app/components/@settings/tabs/connections/GithubConnection.tsx
+++ b/app/components/@settings/tabs/connections/GithubConnection.tsx
@@ -73,22 +73,13 @@ export function GithubConnection() {
});
const [isLoading, setIsLoading] = useState(true);
const [isConnecting, setIsConnecting] = useState(false);
- const [expandedSections, setExpandedSections] = useState({
- organizations: false,
- languages: false,
- recentActivity: false,
- repositories: false,
- });
-
- const toggleSection = (section: keyof typeof expandedSections) => {
- setExpandedSections((prev) => ({
- ...prev,
- [section]: !prev[section],
- }));
- };
+ const [isFetchingStats, setIsFetchingStats] = useState(false);
+ const [isStatsExpanded, setIsStatsExpanded] = useState(false);
const fetchGitHubStats = async (token: string) => {
try {
+ setIsFetchingStats(true);
+
const reposResponse = await fetch(
'https://api.github.com/user/repos?sort=updated&per_page=10&affiliation=owner,organization_member,collaborator',
{
@@ -165,6 +156,7 @@ export function GithubConnection() {
logStore.logError('Failed to fetch GitHub stats', { error });
toast.error('Failed to fetch GitHub statistics');
} finally {
+ setIsFetchingStats(false);
}
};
@@ -188,7 +180,7 @@ export function GithubConnection() {
setIsLoading(false);
}, []);
- if (isLoading) {
+ if (isLoading || isConnecting || isFetchingStats) {
return ;
}
@@ -350,7 +342,7 @@ export function GithubConnection() {
'hover:bg-red-600',
)}
>
-
+
Disconnect
)}
@@ -365,161 +357,144 @@ export function GithubConnection() {
{connection.user && connection.stats && (
-
-

-
-
- {connection.user.name || connection.user.login}
-
- {connection.user.bio && (
-
{connection.user.bio}
- )}
-
-
-
- {connection.user.followers} followers
-
-
-
- {connection.user.public_repos} public repos
-
-
-
- {connection.stats.totalStars} stars
-
-
-
- {connection.stats.totalForks} forks
-
-
-
-
-
- {/* Organizations Section */}
- {connection.stats.organizations.length > 0 && (
-
-
- {expandedSections.organizations && (
-
- {connection.stats.organizations.map((org) => (
-
-
- {org.login}
-
- ))}
+