-
Notifications
You must be signed in to change notification settings - Fork 10
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 #43 from s1lvax/bugfix/code-refactoring
Mini code refactoring
- Loading branch information
Showing
23 changed files
with
249 additions
and
211 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
src/lib/components/Features.svelte → src/lib/components/Index/Features.svelte
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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,60 @@ | ||
<script lang="ts"> | ||
import * as Avatar from '$lib/components/ui/avatar'; | ||
import { Button } from '$lib/components/ui/button'; | ||
import { IdCard } from 'lucide-svelte'; | ||
import GitHub from 'lucide-svelte/icons/github'; | ||
import type { GithubData } from '$lib/types/GithubData'; | ||
import type { PublicProfile } from '$lib/types/PublicProfile'; | ||
export let githubData: GithubData; | ||
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> | ||
{:else} | ||
<p class="text-xl 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.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} | ||
<div> | ||
<Button | ||
href={githubData.blog} | ||
target="_blank" | ||
class="mt-2 flex justify-center rounded-full" | ||
variant="outline" | ||
> | ||
<IdCard /> | ||
</Button> | ||
</div> | ||
{/if} | ||
</div> | ||
</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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<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'; | ||
export let githubData: GithubData; | ||
</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> | ||
</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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<script lang="ts"> | ||
import * as Table from '$lib/components/ui/table'; | ||
import * as Card from '$lib/components/ui/card'; | ||
import type { PublicProfile } from '$lib/types/PublicProfile'; | ||
export let userData: PublicProfile; | ||
</script> | ||
|
||
<!-- Links Section --> | ||
<Card.Root> | ||
<Card.Header> | ||
<Card.Title>Links</Card.Title> | ||
<Card.Description>Discover the developer's projects and favorite resources</Card.Description> | ||
</Card.Header> | ||
<Card.Content class="grid gap-4"> | ||
{#if userData.links.length > 0} | ||
<Table.Root> | ||
<Table.Header> | ||
<Table.Row> | ||
<Table.Head>Title</Table.Head> | ||
</Table.Row> | ||
</Table.Header> | ||
<Table.Body> | ||
{#each userData.links as link} | ||
<a href={link.url} target="_blank"> | ||
<Table.Row class="flex flex-row space-x-4 hover:cursor-pointer"> | ||
<Table.Cell class="font-medium">{link.title}</Table.Cell> | ||
</Table.Row> | ||
</a> | ||
{/each} | ||
</Table.Body> | ||
</Table.Root> | ||
{:else} | ||
<p class="text-muted-foreground">No links available</p> | ||
{/if} | ||
</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,8 @@ | ||
<script> | ||
import LightDarkMode from '$lib/components/Shared/LightDarkMode.svelte'; | ||
</script> | ||
|
||
<p class="text-sm text-muted-foreground"> | ||
Do you want one? <a href="/" class="text-blue-600 underline">Create yours here.</a> | ||
</p> | ||
<LightDarkMode /> |
Oops, something went wrong.