Skip to content

Commit

Permalink
Add profile picture
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesharries committed Mar 28, 2022
1 parent 0f066d9 commit e4b4c85
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
38 changes: 25 additions & 13 deletions src/components/toolbar.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,24 @@
<h1>Where You've Been</h1>
<span class="toolbar_version">v{version}</span>
</small>
<div class="toolbar_user">
<p class="toolbar_user">
{#if isLoggedIn}
<p>
<strong>
{$user.athlete.firstname}
{$user.athlete.lastname}
</strong>
{#if $stats.totalDistance > 0}
<small class="text-muted ml-md">
{Math.round($stats.totalDistance / 1000)} km traveled
</small>
{/if}
</p>
<img
src={$user.athlete.profile}
class="toolbar_pic"
alt={`${$user.athlete.firstname} ${$user.athlete.lastname}`}
/>
<strong class="ml-md">
{$user.athlete.firstname}
{$user.athlete.lastname}
</strong>
{#if $stats.totalDistance > 0}
<small class="text-muted ml-md">
{Math.round($stats.totalDistance / 1000)} km travelled
</small>
{/if}
{/if}
</div>
</p>
<div class="toolbar_actions">
<ToolbarActions />
</div>
Expand Down Expand Up @@ -62,5 +65,14 @@
.toolbar_user {
flex: 1;
text-align: center;
display: flex;
align-items: center;
justify-content: center;
}
.toolbar_pic {
height: 30px;
width: 30px;
border-radius: 100%;
}
</style>
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface User {
username: string;
firstname: string;
lastname: string;
profile: string;
}
}

Expand Down

0 comments on commit e4b4c85

Please sign in to comment.