Skip to content

Commit

Permalink
Applique le style sur les mentions de commentaire
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaudMZN committed Sep 18, 2024
1 parent bedad80 commit 846c7ce
Showing 1 changed file with 51 additions and 5 deletions.
56 changes: 51 additions & 5 deletions svelte/lib/mesure/commentaire/ListeSuggestionsMention.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<script lang="ts">
import type { Contributeur } from '../../tableauDesMesures/tableauDesMesures.d';
import Initiales from '../../ui/Initiales.svelte';
import { storeAutorisations } from '../../gestionContributeurs/stores/autorisations.store';
export let items: Contributeur[];
export let callback: (c: Contributeur) => void;
Expand Down Expand Up @@ -28,11 +30,55 @@
</script>

<ul>
{#each items as item, i}
<li>
<span class:active={i === activeIdx}>
{item.prenomNom}
</span>
{#each items as contributeur, i}
<!-- svelte-ignore a11y-click-events-have-key-events -->
<li on:click={() => callback(contributeur)}>
<div class:active={i === activeIdx} class="contenu-nom-prenom">
<Initiales
valeur={contributeur.initiales}
resumeNiveauDroit={$storeAutorisations.autorisations[contributeur.id]
?.resumeNiveauDroit}
/>
<span class="prenom-nom">{@html contributeur.prenomNom}</span>
</div>
</li>
{/each}
</ul>

<style>
ul {
background: white;
margin: 0;
list-style: none;
border-radius: 6px;
border: 1px solid var(--liseres-fonce);
padding: 0;
}
li {
cursor: pointer;
}
.contenu-nom-prenom {
display: flex;
align-items: center;
gap: 8px;
font-weight: 500;
overflow: hidden;
padding: 9px 16px;
}
.contenu-nom-prenom.active {
background: #eff6ff;
}
.prenom-nom {
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.contenu-nom-prenom.active .prenom-nom {
color: var(--bleu-mise-en-avant);
}
</style>

0 comments on commit 846c7ce

Please sign in to comment.