diff --git a/eslint.config.js b/eslint.config.js index 39ea393..164dc04 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -28,5 +28,18 @@ export default tseslint.config( }, { ignores: ['build/', '.svelte-kit/', 'dist/'] + }, + { + rules: { + 'no-unused-vars': 'off', + '@typescript-eslint/no-unused-vars': [ + 'warn', + { + argsIgnorePattern: '^_', + varsIgnorePattern: '^_', + caughtErrorsIgnorePattern: '^_' + } + ] + } } ); diff --git a/src/lib/components/MyProfile/UserStats.svelte b/src/lib/components/MyProfile/UserStats.svelte index 8844980..46f088e 100644 --- a/src/lib/components/MyProfile/UserStats.svelte +++ b/src/lib/components/MyProfile/UserStats.svelte @@ -4,58 +4,38 @@ import Folder from 'lucide-svelte/icons/folder'; import * as Card from '$lib/components/ui/card'; import type { PrivateProfileData } from '$lib/types/PrivateProfileData'; + import { Skeleton } from '$lib/components/ui/skeleton'; + import StatsCard from '$lib/components/Shared/StatsCard.svelte'; + import StatsCardSkeleton from '../Shared/StatsCardSkeleton.svelte'; export let privateProfileData: PrivateProfileData | null; -{#if privateProfileData} -
- - -
- - Total Profile Views -
-
- -
{privateProfileData.views}
-
-
- - - -
- - Projects on Github -
-
- -
{privateProfileData.repoCount}
-
-
- - - -
- - GitHub Contributions (Past 30 Days) -
-
- -
{privateProfileData.contributionsCount}
-
-
- - - -
- - Github Followers -
-
- -
{privateProfileData.followers}
-
-
-
-{/if} +
+ {#if privateProfileData} + + + + + {:else} + {#each { length: 4 } as _} + + {/each} + {/if} +
diff --git a/src/lib/components/PublicProfile/BasicInfo.svelte b/src/lib/components/PublicProfile/BasicInfo.svelte index c77379a..fdfce31 100644 --- a/src/lib/components/PublicProfile/BasicInfo.svelte +++ b/src/lib/components/PublicProfile/BasicInfo.svelte @@ -1,60 +1,90 @@
- - ? - -
- {#if githubData.name} -

{githubData.name}

+ {#if githubData} + + ? {:else} -

{userData.username}

+ {/if} + +
+ {#if githubData} + {#if githubData.name} +

{githubData.name}

+ {:else} +

{userData.username}

+ {/if} - {#if githubData.bio} -

{githubData.bio}

- {:else} -

Public Developer Profile

- {/if} + {#if githubData.bio} +

{githubData.bio}

+ {:else} +

Public Developer Profile

+ {/if} - {#if githubData.company} -

Currently at {githubData.company}

- {/if} -
-
- -
- {#if githubData.blog} + {#if githubData.company} +

Currently at {githubData.company}

+ {/if} +
- {/if} -
+ {#if githubData.blog} +
+ +
+ {/if} + {#if githubData.twitter} +
+ +
+ {/if} +
+ {:else} +
+ +
+ + +
+ {#each { length: 2 } as _} + + {/each} +
+ {/if}
diff --git a/src/lib/components/PublicProfile/GithubStats.svelte b/src/lib/components/PublicProfile/GithubStats.svelte index 548206a..3653123 100644 --- a/src/lib/components/PublicProfile/GithubStats.svelte +++ b/src/lib/components/PublicProfile/GithubStats.svelte @@ -1,50 +1,26 @@
- - - -
- - Projects on GitHub -
-
- -
{githubData.repoCount}
-
-
- - - - -
- - GitHub Contributions (Past 30 Days) -
-
- -
{githubData.contributionsCount}
-
-
- - - - -
- - Github Followers -
-
- -
{githubData.followers}
-
-
+ {#if githubData} + + + + {:else} + {#each { length: 3 } as _} + + {/each} + {/if}
diff --git a/src/lib/components/PublicProfile/PublicProfile.svelte b/src/lib/components/PublicProfile/PublicProfile.svelte index 3e25386..960f3cf 100644 --- a/src/lib/components/PublicProfile/PublicProfile.svelte +++ b/src/lib/components/PublicProfile/PublicProfile.svelte @@ -12,7 +12,7 @@ export let userData: PublicProfile; //Accept githubData as a prop - export let githubData: GithubData; + export let githubData: GithubData | null; diff --git a/src/lib/components/Shared/StatsCard.svelte b/src/lib/components/Shared/StatsCard.svelte new file mode 100644 index 0000000..1b6fe93 --- /dev/null +++ b/src/lib/components/Shared/StatsCard.svelte @@ -0,0 +1,20 @@ + + + + +
+ + {title} +
+
+ +
{data}
+
+
diff --git a/src/lib/components/Shared/StatsCardSkeleton.svelte b/src/lib/components/Shared/StatsCardSkeleton.svelte new file mode 100644 index 0000000..19ba416 --- /dev/null +++ b/src/lib/components/Shared/StatsCardSkeleton.svelte @@ -0,0 +1,15 @@ + + + + +
+ +
+
+ + + +
diff --git a/src/lib/types/GithubData.ts b/src/lib/types/GithubData.ts index 5b50797..e794ba8 100644 --- a/src/lib/types/GithubData.ts +++ b/src/lib/types/GithubData.ts @@ -8,6 +8,7 @@ export interface GithubData { blog: string | null; followers: number; bio: string | null; + twitter: string | null; } export interface GitHubEvent { diff --git a/src/lib/utils/getGithubData.ts b/src/lib/utils/getGithubData.ts index d6238a4..38ed832 100644 --- a/src/lib/utils/getGithubData.ts +++ b/src/lib/utils/getGithubData.ts @@ -53,7 +53,8 @@ export const getGithubData = async (username: string): Promise => { company: userData.company, blog: userData.blog, followers: userData.followers, - bio: userData.bio + bio: userData.bio, + twitter: userData.twitter_username }; } catch (error) { console.error('Failed to fetch GitHub data:', error); diff --git a/src/routes/[username]/+page.svelte b/src/routes/[username]/+page.svelte index c63eaa3..80f034d 100644 --- a/src/routes/[username]/+page.svelte +++ b/src/routes/[username]/+page.svelte @@ -13,6 +13,4 @@ }); -{#if githubData} - -{/if} + diff --git a/src/routes/profile/+page.svelte b/src/routes/profile/+page.svelte index 631f559..a99a34c 100644 --- a/src/routes/profile/+page.svelte +++ b/src/routes/profile/+page.svelte @@ -57,10 +57,7 @@
- - {#if privateProfileData} - - {/if} +
@@ -70,7 +67,7 @@ The links visible on your profile. You can drag links around to modify the order - +
@@ -82,7 +79,11 @@ Tech Stack You can drag skills around to modify the order - +