partey_workadventure/front/src/Components/Chat/ChatSubMenu.svelte

37 lines
1017 B
Svelte
Raw Normal View History

2021-07-13 11:00:32 +02:00
<script lang="ts">
2021-12-06 16:12:37 +01:00
import type { PlayerInterface } from "../../Phaser/Game/PlayerInterface";
import { requestVisitCardsStore } from "../../Stores/GameStore";
import { _ } from "../../Translator/Translator";
2021-07-13 11:00:32 +02:00
export let player: PlayerInterface;
function openVisitCard() {
if (player.visitCardUrl) {
requestVisitCardsStore.set(player.visitCardUrl);
}
}
</script>
<ul class="selectMenu" style="border-top: {player.color || 'whitesmoke'} 5px solid">
2021-12-19 16:01:51 +01:00
<li>
<button class="text-btn" disabled={!player.visitCardUrl} on:click={openVisitCard}
>{_("chat.menu.visit-card")}</button
2021-12-19 16:01:51 +01:00
>
</li>
<li><button class="text-btn" disabled>{_("chat.menu.add-friend")}</button></li>
2021-07-13 11:00:32 +02:00
</ul>
<style lang="scss">
2021-12-06 16:12:37 +01:00
ul.selectMenu {
background-color: whitesmoke;
position: absolute;
padding: 5px;
border-radius: 4px;
list-style-type: none;
2021-07-13 11:00:32 +02:00
2021-12-06 16:12:37 +01:00
li {
text-align: center;
}
2021-07-13 11:00:32 +02:00
}
2021-12-06 16:12:37 +01:00
</style>