forked from s1lvax/route
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request s1lvax#59 from s1lvax/dev
Dev
- Loading branch information
Showing
11 changed files
with
171 additions
and
136 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,90 @@ | ||
<script lang="ts"> | ||
import * as Avatar from '$lib/components/ui/avatar'; | ||
import { Button } from '$lib/components/ui/button'; | ||
import { IdCard } from 'lucide-svelte'; | ||
import { IdCard, Twitter } from 'lucide-svelte'; | ||
import GitHub from 'lucide-svelte/icons/github'; | ||
import { Skeleton } from '$lib/components/ui/skeleton'; | ||
import type { GithubData } from '$lib/types/GithubData'; | ||
import type { PublicProfile } from '$lib/types/PublicProfile'; | ||
export let githubData: GithubData; | ||
export let githubData: GithubData | null; | ||
export let userData: PublicProfile; | ||
</script> | ||
|
||
<!-- User Avatar and Basic Info --> | ||
<div class="flex items-center justify-center space-x-4"> | ||
<Avatar.Root class="h-24 w-24 rounded-full"> | ||
<Avatar.Image src={githubData.avatarUrl} alt="User Avatar" /> | ||
<Avatar.Fallback>?</Avatar.Fallback> | ||
</Avatar.Root> | ||
<div class="flex flex-col space-y-4 text-center"> | ||
{#if githubData.name} | ||
<p class="text-2xl font-bold">{githubData.name}</p> | ||
{#if githubData} | ||
<Avatar.Image src={githubData.avatarUrl} alt="User Avatar" /> | ||
<Avatar.Fallback>?</Avatar.Fallback> | ||
{:else} | ||
<p class="text-xl font-bold">{userData.username}</p> | ||
<Skeleton class="h-full w-full rounded-full"></Skeleton> | ||
{/if} | ||
</Avatar.Root> | ||
<div class="flex flex-col space-y-4 text-center"> | ||
{#if githubData} | ||
{#if githubData.name} | ||
<p class="text-2xl font-bold">{githubData.name}</p> | ||
{:else} | ||
<p class="text-2xl font-bold">{userData.username}</p> | ||
{/if} | ||
|
||
{#if githubData.bio} | ||
<p class="text-muted-foreground">{githubData.bio}</p> | ||
{:else} | ||
<p class="text-muted-foreground">Public Developer Profile</p> | ||
{/if} | ||
{#if githubData.bio} | ||
<p class="text-muted-foreground">{githubData.bio}</p> | ||
{:else} | ||
<p class="text-muted-foreground">Public Developer Profile</p> | ||
{/if} | ||
|
||
{#if githubData.company} | ||
<p class="text-muted-foreground">Currently at {githubData.company}</p> | ||
{/if} | ||
<div class="flex flex-row items-center justify-center gap-4"> | ||
<div> | ||
<Button | ||
href={githubData.url} | ||
target="_blank" | ||
class="mt-2 flex justify-center rounded-full" | ||
variant="outline" | ||
> | ||
<GitHub /> | ||
</Button> | ||
</div> | ||
{#if githubData.blog} | ||
{#if githubData.company} | ||
<p class="text-muted-foreground">Currently at {githubData.company}</p> | ||
{/if} | ||
<div class="flex flex-row items-center justify-center gap-4"> | ||
<div> | ||
<Button | ||
href={githubData.blog} | ||
href={githubData.url} | ||
target="_blank" | ||
class="mt-2 flex justify-center rounded-full" | ||
variant="outline" | ||
> | ||
<IdCard /> | ||
<GitHub /> | ||
</Button> | ||
</div> | ||
{/if} | ||
</div> | ||
{#if githubData.blog} | ||
<div> | ||
<Button | ||
href={githubData.blog} | ||
target="_blank" | ||
class="mt-2 flex justify-center rounded-full" | ||
variant="outline" | ||
> | ||
<IdCard /> | ||
</Button> | ||
</div> | ||
{/if} | ||
{#if githubData.twitter} | ||
<div> | ||
<Button | ||
href="https://x.com/{githubData.twitter}" | ||
target="_blank" | ||
class="mt-2 flex justify-center rounded-full" | ||
variant="outline" | ||
> | ||
<Twitter /> | ||
</Button> | ||
</div> | ||
{/if} | ||
</div> | ||
{:else} | ||
<div class="flex w-[300px] justify-center"> | ||
<Skeleton class="h-8 w-[75px]"></Skeleton> | ||
</div> | ||
<Skeleton class="h-6 w-[300px]"></Skeleton> | ||
|
||
<div class="flex flex-row items-center justify-center gap-4"> | ||
{#each { length: 2 } as _} | ||
<Skeleton class="mt-2 h-[40px] w-[58px] rounded-full"></Skeleton> | ||
{/each} | ||
</div> | ||
{/if} | ||
</div> | ||
</div> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,26 @@ | ||
<script lang="ts"> | ||
import * as Card from '$lib/components/ui/card'; | ||
import type { GithubData } from '$lib/types/GithubData'; | ||
import { Folder } from 'lucide-svelte'; | ||
import GitHub from 'lucide-svelte/icons/github'; | ||
import StatsCard from '$lib/components/Shared/StatsCard.svelte'; | ||
import StatsCardSkeleton from '$lib/components/Shared/StatsCardSkeleton.svelte'; | ||
export let githubData: GithubData; | ||
export let githubData: GithubData | null; | ||
</script> | ||
|
||
<!-- GitHub Stats Cards --> | ||
<div class="mt-8 grid gap-4 md:grid-cols-2 lg:grid-cols-3"> | ||
<!-- Total Projects (Repo Count) Card --> | ||
<Card.Root> | ||
<Card.Header class="flex flex-row items-center justify-between space-y-0 pb-2"> | ||
<div class="flex items-center space-x-2"> | ||
<Folder class="h-4 w-4 text-muted-foreground" /> | ||
<Card.Title class="text-sm font-medium">Projects on GitHub</Card.Title> | ||
</div> | ||
</Card.Header> | ||
<Card.Content> | ||
<div class="text-2xl font-bold">{githubData.repoCount}</div> | ||
</Card.Content> | ||
</Card.Root> | ||
|
||
<!-- GitHub Contributions Card --> | ||
<Card.Root> | ||
<Card.Header class="flex flex-row items-center justify-between space-y-0 pb-2"> | ||
<div class="flex items-center space-x-2"> | ||
<GitHub class="h-4 w-4 text-muted-foreground" /> | ||
<Card.Title class="text-sm font-medium">GitHub Contributions (Past 30 Days)</Card.Title> | ||
</div> | ||
</Card.Header> | ||
<Card.Content> | ||
<div class="text-2xl font-bold">{githubData.contributionsCount}</div> | ||
</Card.Content> | ||
</Card.Root> | ||
|
||
<!-- Praise Received Card --> | ||
<Card.Root> | ||
<Card.Header class="flex flex-row items-center justify-between space-y-0 pb-2"> | ||
<div class="flex items-center space-x-2"> | ||
<GitHub class="h-4 w-4 text-muted-foreground" /> | ||
<Card.Title class="text-sm font-medium">Github Followers</Card.Title> | ||
</div> | ||
</Card.Header> | ||
<Card.Content> | ||
<div class="text-2xl font-bold">{githubData.followers}</div> | ||
</Card.Content> | ||
</Card.Root> | ||
{#if githubData} | ||
<StatsCard icon={Folder} title="Projects on Github" data={githubData.repoCount.toString()} /> | ||
<StatsCard | ||
icon={GitHub} | ||
title="GitHub Contributions (Past 30 Days)" | ||
data={githubData.contributionsCount.toString()} | ||
/> | ||
<StatsCard icon={GitHub} title="GitHub Followers" data={githubData.followers.toString()} /> | ||
{:else} | ||
{#each { length: 3 } as _} | ||
<StatsCardSkeleton /> | ||
{/each} | ||
{/if} | ||
</div> |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script lang="ts"> | ||
import type { ComponentType, SvelteComponent } from 'svelte'; | ||
import * as Card from '$lib/components/ui/card'; | ||
export let icon: ComponentType<SvelteComponent>; | ||
export let title: string; | ||
export let data: string; | ||
</script> | ||
|
||
<Card.Root> | ||
<Card.Header class="flex flex-row items-center justify-between space-y-0 pb-2"> | ||
<div class="flex items-center space-x-2"> | ||
<svelte:component this={icon} class="h-4 w-4 text-muted-foreground"></svelte:component> | ||
<Card.Title class="text-sm font-medium">{title}</Card.Title> | ||
</div> | ||
</Card.Header> | ||
<Card.Content> | ||
<div class="text-2xl font-bold">{data}</div> | ||
</Card.Content> | ||
</Card.Root> |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script> | ||
import * as Card from '$lib/components/ui/card'; | ||
import { Skeleton } from '$lib/components/ui/skeleton'; | ||
</script> | ||
|
||
<Card.Root> | ||
<Card.Header class="flex flex-row items-center justify-between space-y-0 pb-2"> | ||
<div class="flex w-full items-center space-x-2"> | ||
<Skeleton class="h-5 w-[75%]"></Skeleton> | ||
</div> | ||
</Card.Header> | ||
<Card.Content> | ||
<Skeleton class="h-8 w-[40%]"></Skeleton> | ||
</Card.Content> | ||
</Card.Root> |
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.