feat(*): Update styling of users list component

This commit is contained in:
Josh Creek
2023-07-10 13:26:39 +01:00
parent ef3e631e7c
commit 14c312807e
+50 -15
View File
@@ -1,22 +1,57 @@
<script lang="ts"> <script lang="ts">
export let estimates: any; export let users: any;
export let handleEstimateChange: any; export let showEstimates: boolean = false;
export let currentUserIndex: number;
</script> </script>
<div id="users-list"> <div id="users-list">
<h2>Users</h2> <h2>Users</h2>
<ul> {#each users as user}
{#each estimates as user, index} <div class="name">{user.name}</div>
<li> <div
{user.name} class="user-card"
<input class:user-card-null={user.estimate === null}
type="number" class:user-card-green={user.estimate !== null}
value={user.estimate} >
on:input={(e) => handleEstimateChange(e, user)} {#if user.estimate !== null && showEstimates}
disabled={currentUserIndex !== index ? true : null} <p class="estimate">{user.estimate}</p>
/> {/if}
</li> </div>
{/each} {/each}
</ul>
</div> </div>
<style>
.user-card {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
width: 60px;
height: 80px;
border: 1px solid #ccc;
border-radius: 8px;
margin: 10px;
background-color: #fff;
text-align: center;
}
.user-card-null {
background-color: #ccc;
color: #fff;
}
.user-card-green {
background-color: #6bbf6b;
color: #fff;
}
.estimate {
font-size: 24px;
font-weight: bold;
margin: 0;
}
.name {
font-size: 16px;
margin-top: 10px;
}
</style>