Add profile pictures and improve modal animations
- Add ProfilePicture component with fallback to user initials - Integrate profile pictures in dashboard recent activity dialog layout - Add profile pictures to payments list and split details - Fix modal animation overshoot by using fixed positioning and smooth slide-in - Add fade-in animation for modal content with proper sequencing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
		@@ -2,6 +2,7 @@
 | 
				
			|||||||
  import { onMount, createEventDispatcher } from 'svelte';
 | 
					  import { onMount, createEventDispatcher } from 'svelte';
 | 
				
			||||||
  import { goto } from '$app/navigation';
 | 
					  import { goto } from '$app/navigation';
 | 
				
			||||||
  import { page } from '$app/stores';
 | 
					  import { page } from '$app/stores';
 | 
				
			||||||
 | 
					  import ProfilePicture from './ProfilePicture.svelte';
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  export let paymentId;
 | 
					  export let paymentId;
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
@@ -150,10 +151,13 @@
 | 
				
			|||||||
                {#each payment.splits as split}
 | 
					                {#each payment.splits as split}
 | 
				
			||||||
                  <div class="split-item" class:current-user={split.username === session?.user?.nickname}>
 | 
					                  <div class="split-item" class:current-user={split.username === session?.user?.nickname}>
 | 
				
			||||||
                    <div class="split-user">
 | 
					                    <div class="split-user">
 | 
				
			||||||
                      <span class="username">{split.username}</span>
 | 
					                      <ProfilePicture username={split.username} size={24} />
 | 
				
			||||||
                      {#if split.username === session?.user?.nickname}
 | 
					                      <div class="user-info">
 | 
				
			||||||
                        <span class="you-badge">You</span>
 | 
					                        <span class="username">{split.username}</span>
 | 
				
			||||||
                      {/if}
 | 
					                        {#if split.username === session?.user?.nickname}
 | 
				
			||||||
 | 
					                          <span class="you-badge">You</span>
 | 
				
			||||||
 | 
					                        {/if}
 | 
				
			||||||
 | 
					                      </div>
 | 
				
			||||||
                    </div>
 | 
					                    </div>
 | 
				
			||||||
                    <div class="split-amount" class:positive={split.amount < 0} class:negative={split.amount > 0}>
 | 
					                    <div class="split-amount" class:positive={split.amount < 0} class:negative={split.amount > 0}>
 | 
				
			||||||
                      {#if split.amount > 0}
 | 
					                      {#if split.amount > 0}
 | 
				
			||||||
@@ -362,6 +366,12 @@
 | 
				
			|||||||
    gap: 0.5rem;
 | 
					    gap: 0.5rem;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .split-user .user-info {
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					    align-items: center;
 | 
				
			||||||
 | 
					    gap: 0.5rem;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .username {
 | 
					  .username {
 | 
				
			||||||
    font-weight: 500;
 | 
					    font-weight: 500;
 | 
				
			||||||
    color: #333;
 | 
					    color: #333;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										66
									
								
								src/lib/components/ProfilePicture.svelte
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										66
									
								
								src/lib/components/ProfilePicture.svelte
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,66 @@
 | 
				
			|||||||
 | 
					<script>
 | 
				
			||||||
 | 
					  export let username;
 | 
				
			||||||
 | 
					  export let size = 40; // Default size in pixels
 | 
				
			||||||
 | 
					  export let alt = '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  let imageError = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  $: profileUrl = `https://bocken.org/static/user/full/${username}.webp`;
 | 
				
			||||||
 | 
					  $: altText = alt || `${username}'s profile picture`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function handleError() {
 | 
				
			||||||
 | 
					    imageError = true;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  function getInitials(name) {
 | 
				
			||||||
 | 
					    if (!name) return '?';
 | 
				
			||||||
 | 
					    return name.split(' ')
 | 
				
			||||||
 | 
					      .map(word => word.charAt(0))
 | 
				
			||||||
 | 
					      .join('')
 | 
				
			||||||
 | 
					      .toUpperCase()
 | 
				
			||||||
 | 
					      .substring(0, 2);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<div class="profile-picture" style="width: {size}px; height: {size}px;">
 | 
				
			||||||
 | 
					  {#if !imageError}
 | 
				
			||||||
 | 
					    <img
 | 
				
			||||||
 | 
					      src={profileUrl}
 | 
				
			||||||
 | 
					      alt={altText}
 | 
				
			||||||
 | 
					      on:error={handleError}
 | 
				
			||||||
 | 
					      loading="lazy"
 | 
				
			||||||
 | 
					    />
 | 
				
			||||||
 | 
					  {:else}
 | 
				
			||||||
 | 
					    <div class="fallback">
 | 
				
			||||||
 | 
					      {getInitials(username)}
 | 
				
			||||||
 | 
					    </div>
 | 
				
			||||||
 | 
					  {/if}
 | 
				
			||||||
 | 
					</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					<style>
 | 
				
			||||||
 | 
					  .profile-picture {
 | 
				
			||||||
 | 
					    border-radius: 50%;
 | 
				
			||||||
 | 
					    overflow: hidden;
 | 
				
			||||||
 | 
					    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					    align-items: center;
 | 
				
			||||||
 | 
					    justify-content: center;
 | 
				
			||||||
 | 
					    flex-shrink: 0;
 | 
				
			||||||
 | 
					    position: relative;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  img {
 | 
				
			||||||
 | 
					    width: 100%;
 | 
				
			||||||
 | 
					    height: 100%;
 | 
				
			||||||
 | 
					    object-fit: cover;
 | 
				
			||||||
 | 
					    display: block;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .fallback {
 | 
				
			||||||
 | 
					    color: white;
 | 
				
			||||||
 | 
					    font-weight: bold;
 | 
				
			||||||
 | 
					    font-size: 0.75em;
 | 
				
			||||||
 | 
					    text-align: center;
 | 
				
			||||||
 | 
					    line-height: 1;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					</style>
 | 
				
			||||||
@@ -38,38 +38,63 @@
 | 
				
			|||||||
    <slot />
 | 
					    <slot />
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  {#if showModal}
 | 
					  <div class="side-panel">
 | 
				
			||||||
    <div class="side-panel">
 | 
					    {#if showModal}
 | 
				
			||||||
      <PaymentModal {paymentId} on:close={() => showModal = false} />
 | 
					      <div class="modal-content">
 | 
				
			||||||
    </div>
 | 
					        <PaymentModal {paymentId} on:close={() => showModal = false} />
 | 
				
			||||||
  {/if}
 | 
					      </div>
 | 
				
			||||||
 | 
					    {/if}
 | 
				
			||||||
 | 
					  </div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<style>
 | 
					<style>
 | 
				
			||||||
  .layout-container {
 | 
					  .layout-container {
 | 
				
			||||||
    display: flex;
 | 
					    display: flex;
 | 
				
			||||||
    min-height: 100vh;
 | 
					    min-height: 100vh;
 | 
				
			||||||
    transition: all 0.3s ease;
 | 
					 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .main-content {
 | 
					  .main-content {
 | 
				
			||||||
    flex: 1;
 | 
					    flex: 1;
 | 
				
			||||||
    transition: all 0.3s ease;
 | 
					    transition: margin-right 0.3s ease-out;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .layout-container.has-modal .main-content {
 | 
					  .layout-container.has-modal .main-content {
 | 
				
			||||||
    flex: 0 0 60%;
 | 
					    margin-right: 400px;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .side-panel {
 | 
					  .side-panel {
 | 
				
			||||||
    flex: 0 0 40%;
 | 
					    position: fixed;
 | 
				
			||||||
    min-width: 400px;
 | 
					    top: 0;
 | 
				
			||||||
    max-width: 500px;
 | 
					    right: 0;
 | 
				
			||||||
 | 
					    width: 400px;
 | 
				
			||||||
 | 
					    height: 100vh;
 | 
				
			||||||
    background: white;
 | 
					    background: white;
 | 
				
			||||||
    border-left: 1px solid #dee2e6;
 | 
					    border-left: 1px solid #dee2e6;
 | 
				
			||||||
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
 | 
					    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
 | 
				
			||||||
    z-index: 100;
 | 
					    z-index: 100;
 | 
				
			||||||
    overflow-y: auto;
 | 
					    overflow-y: auto;
 | 
				
			||||||
 | 
					    transform: translateX(100%);
 | 
				
			||||||
 | 
					    transition: transform 0.3s ease-out;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .layout-container.has-modal .side-panel {
 | 
				
			||||||
 | 
					    transform: translateX(0);
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .modal-content {
 | 
				
			||||||
 | 
					    opacity: 0;
 | 
				
			||||||
 | 
					    animation: fadeIn 0.3s ease-out 0.1s forwards;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  @keyframes fadeIn {
 | 
				
			||||||
 | 
					    from {
 | 
				
			||||||
 | 
					      opacity: 0;
 | 
				
			||||||
 | 
					      transform: translateX(20px);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    to {
 | 
				
			||||||
 | 
					      opacity: 1;
 | 
				
			||||||
 | 
					      transform: translateX(0);
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  @media (max-width: 768px) {
 | 
					  @media (max-width: 768px) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,7 @@
 | 
				
			|||||||
  import { onMount } from 'svelte';
 | 
					  import { onMount } from 'svelte';
 | 
				
			||||||
  import { page } from '$app/stores';
 | 
					  import { page } from '$app/stores';
 | 
				
			||||||
  import { pushState } from '$app/navigation';
 | 
					  import { pushState } from '$app/navigation';
 | 
				
			||||||
 | 
					  import ProfilePicture from '$lib/components/ProfilePicture.svelte';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  export let data; // Used by the layout for session data
 | 
					  export let data; // Used by the layout for session data
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -96,39 +97,44 @@
 | 
				
			|||||||
    {#if balance.recentSplits && balance.recentSplits.length > 0}
 | 
					    {#if balance.recentSplits && balance.recentSplits.length > 0}
 | 
				
			||||||
      <div class="recent-activity">
 | 
					      <div class="recent-activity">
 | 
				
			||||||
        <h2>Recent Activity</h2>
 | 
					        <h2>Recent Activity</h2>
 | 
				
			||||||
        <div class="activity-list">
 | 
					        <div class="activity-dialog">
 | 
				
			||||||
          {#each balance.recentSplits as split}
 | 
					          {#each balance.recentSplits as split}
 | 
				
			||||||
            <a 
 | 
					            <div class="activity-message" class:is-me={split.paymentId?.paidBy === data.session?.user?.nickname}>
 | 
				
			||||||
              href="/cospend/payments/view/{split.paymentId?._id}" 
 | 
					              <div class="message-content">
 | 
				
			||||||
              class="activity-item"
 | 
					                <ProfilePicture username={split.paymentId?.paidBy || 'Unknown'} size={36} />
 | 
				
			||||||
              on:click={(e) => handlePaymentClick(split.paymentId?._id, e)}
 | 
					                <a 
 | 
				
			||||||
            >
 | 
					                  href="/cospend/payments/view/{split.paymentId?._id}" 
 | 
				
			||||||
              <div class="activity-info">
 | 
					                  class="activity-bubble"
 | 
				
			||||||
                <div class="activity-header">
 | 
					                  on:click={(e) => handlePaymentClick(split.paymentId?._id, e)}
 | 
				
			||||||
                  <strong class="payment-title">{split.paymentId?.title || 'Payment'}</strong>
 | 
					                >
 | 
				
			||||||
                  <div class="activity-amount" class:positive={split.amount < 0} class:negative={split.amount > 0}>
 | 
					                  <div class="activity-header">
 | 
				
			||||||
                    {#if split.amount > 0}
 | 
					                    <div class="user-info">
 | 
				
			||||||
                      -{formatCurrency(split.amount)}
 | 
					                      <strong class="payment-title">{split.paymentId?.title || 'Payment'}</strong>
 | 
				
			||||||
                    {:else if split.amount < 0}
 | 
					                      <span class="username">Paid by {split.paymentId?.paidBy || 'Unknown'}</span>
 | 
				
			||||||
                      +{formatCurrency(split.amount)}
 | 
					                    </div>
 | 
				
			||||||
                    {:else}
 | 
					                    <div class="activity-amount" class:positive={split.amount < 0} class:negative={split.amount > 0}>
 | 
				
			||||||
                      even
 | 
					                      {#if split.amount > 0}
 | 
				
			||||||
 | 
					                        -{formatCurrency(split.amount)}
 | 
				
			||||||
 | 
					                      {:else if split.amount < 0}
 | 
				
			||||||
 | 
					                        +{formatCurrency(split.amount)}
 | 
				
			||||||
 | 
					                      {:else}
 | 
				
			||||||
 | 
					                        even
 | 
				
			||||||
 | 
					                      {/if}
 | 
				
			||||||
 | 
					                    </div>
 | 
				
			||||||
 | 
					                  </div>
 | 
				
			||||||
 | 
					                  <div class="payment-details">
 | 
				
			||||||
 | 
					                    <div class="payment-meta">
 | 
				
			||||||
 | 
					                      <span class="payment-date">{formatDate(split.createdAt)}</span>
 | 
				
			||||||
 | 
					                    </div>
 | 
				
			||||||
 | 
					                    {#if split.paymentId?.description}
 | 
				
			||||||
 | 
					                      <div class="payment-description">
 | 
				
			||||||
 | 
					                        {truncateDescription(split.paymentId.description)}
 | 
				
			||||||
 | 
					                      </div>
 | 
				
			||||||
                    {/if}
 | 
					                    {/if}
 | 
				
			||||||
                  </div>
 | 
					                  </div>
 | 
				
			||||||
                </div>
 | 
					                </a>
 | 
				
			||||||
                <div class="payment-details">
 | 
					 | 
				
			||||||
                  <div class="payment-meta">
 | 
					 | 
				
			||||||
                    <span class="paid-by">Paid by {split.paymentId?.paidBy || 'Unknown'}</span>
 | 
					 | 
				
			||||||
                    <span class="payment-date">{formatDate(split.createdAt)}</span>
 | 
					 | 
				
			||||||
                  </div>
 | 
					 | 
				
			||||||
                  {#if split.paymentId?.description}
 | 
					 | 
				
			||||||
                    <div class="payment-description">
 | 
					 | 
				
			||||||
                      {truncateDescription(split.paymentId.description)}
 | 
					 | 
				
			||||||
                    </div>
 | 
					 | 
				
			||||||
                  {/if}
 | 
					 | 
				
			||||||
                </div>
 | 
					 | 
				
			||||||
              </div>
 | 
					              </div>
 | 
				
			||||||
            </a>
 | 
					            </div>
 | 
				
			||||||
          {/each}
 | 
					          {/each}
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
@@ -277,45 +283,112 @@
 | 
				
			|||||||
    color: #333;
 | 
					    color: #333;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .activity-list {
 | 
					  .activity-dialog {
 | 
				
			||||||
    display: flex;
 | 
					    display: flex;
 | 
				
			||||||
    flex-direction: column;
 | 
					    flex-direction: column;
 | 
				
			||||||
    gap: 1rem;
 | 
					    gap: 0.75rem;
 | 
				
			||||||
 | 
					    padding: 0.5rem 0;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .activity-item {
 | 
					  .activity-message {
 | 
				
			||||||
    display: block;
 | 
					    display: flex;
 | 
				
			||||||
    padding: 1rem;
 | 
					    align-items: flex-start;
 | 
				
			||||||
 | 
					    width: 100%;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .activity-message.is-me {
 | 
				
			||||||
 | 
					    flex-direction: row-reverse;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .message-content {
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					    align-items: flex-start;
 | 
				
			||||||
 | 
					    gap: 0.75rem;
 | 
				
			||||||
 | 
					    width: 100%;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .activity-message.is-me .message-content {
 | 
				
			||||||
 | 
					    flex-direction: row-reverse;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .activity-bubble {
 | 
				
			||||||
    background: #f8f9fa;
 | 
					    background: #f8f9fa;
 | 
				
			||||||
    border-radius: 0.5rem;
 | 
					    border-radius: 1rem;
 | 
				
			||||||
 | 
					    padding: 1rem;
 | 
				
			||||||
 | 
					    position: relative;
 | 
				
			||||||
 | 
					    border: 1px solid #e9ecef;
 | 
				
			||||||
    text-decoration: none;
 | 
					    text-decoration: none;
 | 
				
			||||||
    color: inherit;
 | 
					    color: inherit;
 | 
				
			||||||
 | 
					    display: block;
 | 
				
			||||||
    transition: all 0.2s;
 | 
					    transition: all 0.2s;
 | 
				
			||||||
    border: 1px solid transparent;
 | 
					    flex: 1;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .activity-item:hover {
 | 
					  .activity-message.is-me .activity-bubble {
 | 
				
			||||||
    background: #e9ecef;
 | 
					    background: #e3f2fd;
 | 
				
			||||||
    border-color: #1976d2;
 | 
					    border-color: #2196f3;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .activity-bubble:hover {
 | 
				
			||||||
    transform: translateY(-1px);
 | 
					    transform: translateY(-1px);
 | 
				
			||||||
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
 | 
					    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .activity-info {
 | 
					  .activity-bubble::before {
 | 
				
			||||||
    width: 100%;
 | 
					    content: '';
 | 
				
			||||||
 | 
					    position: absolute;
 | 
				
			||||||
 | 
					    top: 1rem;
 | 
				
			||||||
 | 
					    width: 0;
 | 
				
			||||||
 | 
					    height: 0;
 | 
				
			||||||
 | 
					    border: 8px solid transparent;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .activity-bubble::before {
 | 
				
			||||||
 | 
					    left: -15px;
 | 
				
			||||||
 | 
					    border-right-color: #f8f9fa;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .activity-message.is-me .activity-bubble::before {
 | 
				
			||||||
 | 
					    left: auto;
 | 
				
			||||||
 | 
					    right: -15px;
 | 
				
			||||||
 | 
					    border-left-color: #e3f2fd;
 | 
				
			||||||
 | 
					    border-right-color: transparent;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .activity-header {
 | 
					  .activity-header {
 | 
				
			||||||
    display: flex;
 | 
					    display: flex;
 | 
				
			||||||
    justify-content: space-between;
 | 
					    justify-content: space-between;
 | 
				
			||||||
    align-items: flex-start;
 | 
					    align-items: flex-start;
 | 
				
			||||||
    margin-bottom: 0.5rem;
 | 
					    margin-bottom: 0.75rem;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .user-info {
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					    flex-direction: column;
 | 
				
			||||||
 | 
					    gap: 0.25rem;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .payment-title {
 | 
					  .payment-title {
 | 
				
			||||||
    color: #333;
 | 
					    color: #333;
 | 
				
			||||||
    font-size: 1.1rem;
 | 
					    font-size: 1.1rem;
 | 
				
			||||||
    margin-right: 1rem;
 | 
					    font-weight: 600;
 | 
				
			||||||
 | 
					    margin: 0;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .username {
 | 
				
			||||||
 | 
					    color: #666;
 | 
				
			||||||
 | 
					    font-size: 0.9rem;
 | 
				
			||||||
 | 
					    font-weight: 500;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .you-badge {
 | 
				
			||||||
 | 
					    background-color: #1976d2;
 | 
				
			||||||
 | 
					    color: white;
 | 
				
			||||||
 | 
					    padding: 0.125rem 0.5rem;
 | 
				
			||||||
 | 
					    border-radius: 1rem;
 | 
				
			||||||
 | 
					    font-size: 0.75rem;
 | 
				
			||||||
 | 
					    font-weight: 500;
 | 
				
			||||||
 | 
					    display: inline-block;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .activity-amount {
 | 
					  .activity-amount {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
<script>
 | 
					<script>
 | 
				
			||||||
  import { onMount } from 'svelte';
 | 
					  import { onMount } from 'svelte';
 | 
				
			||||||
  import { goto } from '$app/navigation';
 | 
					  import { goto } from '$app/navigation';
 | 
				
			||||||
 | 
					  import ProfilePicture from '$lib/components/ProfilePicture.svelte';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  export let data;
 | 
					  export let data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -133,11 +134,14 @@
 | 
				
			|||||||
      {#each payments as payment}
 | 
					      {#each payments as payment}
 | 
				
			||||||
        <div class="payment-card">
 | 
					        <div class="payment-card">
 | 
				
			||||||
          <div class="payment-header">
 | 
					          <div class="payment-header">
 | 
				
			||||||
            <div class="payment-title">
 | 
					            <div class="payment-title-section">
 | 
				
			||||||
              <h3>{payment.title}</h3>
 | 
					              <ProfilePicture username={payment.paidBy} size={40} />
 | 
				
			||||||
              <div class="payment-meta">
 | 
					              <div class="payment-title">
 | 
				
			||||||
                <span class="date">{formatDate(payment.date)}</span>
 | 
					                <h3>{payment.title}</h3>
 | 
				
			||||||
                <span class="amount">{formatCurrency(payment.amount)}</span>
 | 
					                <div class="payment-meta">
 | 
				
			||||||
 | 
					                  <span class="date">{formatDate(payment.date)}</span>
 | 
				
			||||||
 | 
					                  <span class="amount">{formatCurrency(payment.amount)}</span>
 | 
				
			||||||
 | 
					                </div>
 | 
				
			||||||
              </div>
 | 
					              </div>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            {#if payment.image}
 | 
					            {#if payment.image}
 | 
				
			||||||
@@ -335,6 +339,13 @@
 | 
				
			|||||||
    margin-bottom: 1rem;
 | 
					    margin-bottom: 1rem;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .payment-title-section {
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					    align-items: flex-start;
 | 
				
			||||||
 | 
					    gap: 0.75rem;
 | 
				
			||||||
 | 
					    flex: 1;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .payment-title h3 {
 | 
					  .payment-title h3 {
 | 
				
			||||||
    margin: 0 0 0.5rem 0;
 | 
					    margin: 0 0 0.5rem 0;
 | 
				
			||||||
    color: #333;
 | 
					    color: #333;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,7 @@
 | 
				
			|||||||
<script>
 | 
					<script>
 | 
				
			||||||
  import { onMount } from 'svelte';
 | 
					  import { onMount } from 'svelte';
 | 
				
			||||||
  import { goto } from '$app/navigation';
 | 
					  import { goto } from '$app/navigation';
 | 
				
			||||||
 | 
					  import ProfilePicture from '$lib/components/ProfilePicture.svelte';
 | 
				
			||||||
  
 | 
					  
 | 
				
			||||||
  export let data;
 | 
					  export let data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -123,10 +124,13 @@
 | 
				
			|||||||
            {#each payment.splits as split}
 | 
					            {#each payment.splits as split}
 | 
				
			||||||
              <div class="split-item" class:current-user={split.username === data.session.user.nickname}>
 | 
					              <div class="split-item" class:current-user={split.username === data.session.user.nickname}>
 | 
				
			||||||
                <div class="split-user">
 | 
					                <div class="split-user">
 | 
				
			||||||
                  <span class="username">{split.username}</span>
 | 
					                  <ProfilePicture username={split.username} size={24} />
 | 
				
			||||||
                  {#if split.username === data.session.user.nickname}
 | 
					                  <div class="user-info">
 | 
				
			||||||
                    <span class="you-badge">You</span>
 | 
					                    <span class="username">{split.username}</span>
 | 
				
			||||||
                  {/if}
 | 
					                    {#if split.username === data.session.user.nickname}
 | 
				
			||||||
 | 
					                      <span class="you-badge">You</span>
 | 
				
			||||||
 | 
					                    {/if}
 | 
				
			||||||
 | 
					                  </div>
 | 
				
			||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
                <div class="split-amount" class:positive={split.amount < 0} class:negative={split.amount > 0}>
 | 
					                <div class="split-amount" class:positive={split.amount < 0} class:negative={split.amount > 0}>
 | 
				
			||||||
                  {#if split.amount > 0}
 | 
					                  {#if split.amount > 0}
 | 
				
			||||||
@@ -332,6 +336,12 @@
 | 
				
			|||||||
    gap: 0.5rem;
 | 
					    gap: 0.5rem;
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  .split-user .user-info {
 | 
				
			||||||
 | 
					    display: flex;
 | 
				
			||||||
 | 
					    align-items: center;
 | 
				
			||||||
 | 
					    gap: 0.5rem;
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  .username {
 | 
					  .username {
 | 
				
			||||||
    font-weight: 500;
 | 
					    font-weight: 500;
 | 
				
			||||||
    color: #333;
 | 
					    color: #333;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user