Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow leaders to nudge other leaders #572

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 39 additions & 36 deletions ui/src/components/poker/UserCard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@
<span data-testid="user-name">{warrior.name}</span>
{/if}
</p>
{#if leaders.includes(warrior.id)}
<p class="text-l text-gray-700 leading-tight">
<p class="text-l text-gray-700 leading-tight">
{#if leaders.includes(warrior.id)}
<LeaderIcon />
{#if isLeader}
&nbsp;
Expand All @@ -120,18 +120,18 @@
</button>
{:else}&nbsp;{$LL.leader()}
{/if}
</p>
{:else if isLeader}
<button
on:click="{promoteLeader}"
class="inline-block align-baseline text-sm
text-green-500 hover:text-green-800 bg-transparent
border-transparent"
data-testid="user-promote"
>
{$LL.promote()}
</button>
{#if !warrior.spectator}
{:else if isLeader}
<button
on:click="{promoteLeader}"
class="inline-block align-baseline text-sm
text-green-500 hover:text-green-800 bg-transparent
border-transparent"
data-testid="user-promote"
>
{$LL.promote()}
</button>
{/if}
{#if isLeader && warrior.id !== $sessionUser.id && !warrior.spectator}
&nbsp;|&nbsp;
<button
on:click="{jabWarrior}"
Expand All @@ -143,28 +143,31 @@
{$LL.warriorNudge()}
</button>
{/if}
{:else if warrior.id === $sessionUser.id}
<button
on:click="{toggleBecomeLeader}"
class="inline-block align-baseline text-sm
text-blue-500 hover:text-blue-800 bg-transparent
border-transparent"
data-testid="user-becomeleader"
>
{$LL.becomeLeader()}
</button>
{/if}
{#if autoFinishVoting && warrior.id === $sessionUser.id}
<button
on:click="{toggleSpectator}"
class="inline-block align-baseline text-sm text-blue-500
hover:text-blue-800 bg-transparent border-transparent"
data-testid="user-togglespectator"
>
{#if !warrior.spectator}
{$LL.becomeSpectator()}
{:else}{$LL.becomeParticipant()}{/if}
</button>
</p>
{#if warrior.id === $sessionUser.id}
{#if !isLeader}
<button
on:click="{toggleBecomeLeader}"
class="inline-block align-baseline text-sm
text-blue-500 hover:text-blue-800 bg-transparent
border-transparent"
data-testid="user-becomeleader"
>
{$LL.becomeLeader()}
</button>
{/if}
{#if autoFinishVoting}
<button
on:click="{toggleSpectator}"
class="inline-block align-baseline text-sm text-blue-500
hover:text-blue-800 bg-transparent border-transparent"
data-testid="user-togglespectator"
>
{#if !warrior.spectator}
{$LL.becomeSpectator()}
{:else}{$LL.becomeParticipant()}{/if}
</button>
{/if}
{/if}
</div>
<div class="w-1/4 text-right">
Expand Down