more code cleanup
This commit is contained in:
@ -1,47 +1,57 @@
|
||||
<script setup>
|
||||
// TODO: close node details tooltip when this opens
|
||||
import { state } from '@/store';
|
||||
import CloseActionButton from '@/components/CloseActionButton.vue';
|
||||
|
||||
const emit = defineEmits(['dismiss']);
|
||||
import { state } from '../store.js';
|
||||
|
||||
function dismissShowingNodeNeighbours() {
|
||||
state.selectedNodeToShowNeighbours = null;
|
||||
emit('dismiss');
|
||||
state.selectedNodeToShowNeighbours = null;
|
||||
emit('dismiss');
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="relative z-sidebar" role="dialog" aria-modal="true">
|
||||
<!-- sidebar -->
|
||||
<transition
|
||||
enter-active-class="transition duration-300 ease-in-out transform"
|
||||
enter-from-class="translate-y-full"
|
||||
enter-to-class="translate-y-0"
|
||||
leave-active-class="transition duration-300 ease-in-out transform"
|
||||
leave-from-class="translate-y-0"
|
||||
leave-to-class="translate-y-full">
|
||||
<div v-show="state.selectedNodeToShowNeighbours != null" class="fixed left-0 right-0 bottom-0">
|
||||
<div v-if="state.selectedNodeToShowNeighbours != null" class="mx-auto w-screen max-w-md p-4">
|
||||
<div class="flex h-full flex-col bg-white shadow-xl rounded-xl border">
|
||||
<div class="p-2">
|
||||
<div class="flex items-start justify-between">
|
||||
<div>
|
||||
<h2 class="font-bold">{{ state.selectedNodeToShowNeighbours.short_name }} Neighbours</h2>
|
||||
<h3 v-if="state.selectedNodeToShowNeighboursType === 'weHeard'" class="text-sm">Nodes heard by {{ state.selectedNodeToShowNeighbours.short_name }}</h3>
|
||||
<h3 v-if="state.selectedNodeToShowNeighboursType === 'theyHeard'" class="text-sm">Nodes that heard {{ state.selectedNodeToShowNeighbours.short_name }}</h3>
|
||||
</div>
|
||||
<div class="my-auto ml-3 flex h-7 items-center">
|
||||
<a href="javascript:void(0)" class="rounded-full" @click="dismissShowingNodeNeighbours">
|
||||
<div class="bg-gray-100 hover:bg-gray-200 p-2 rounded-full">
|
||||
<svg class="w-6 h-6" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
||||
<path d="M18 6l-12 12"></path>
|
||||
<path d="M6 6l12 12"></path>
|
||||
</svg>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="relative z-sidebar" role="dialog" aria-modal="true">
|
||||
<transition
|
||||
enter-active-class="transition duration-300 ease-in-out transform"
|
||||
enter-from-class="translate-y-full"
|
||||
enter-to-class="translate-y-0"
|
||||
leave-active-class="transition duration-300 ease-in-out transform"
|
||||
leave-from-class="translate-y-0"
|
||||
leave-to-class="translate-y-full"
|
||||
>
|
||||
<div v-show="state.selectedNodeToShowNeighbours" class="fixed left-0 right-0 bottom-0">
|
||||
<div v-if="state.selectedNodeToShowNeighbours" class="mx-auto w-screen max-w-md p-4">
|
||||
<div class="flex h-full flex-col bg-white shadow-xl rounded-xl border">
|
||||
<div class="p-2">
|
||||
<div class="flex items-start justify-between">
|
||||
<div>
|
||||
<h2 class="font-bold">
|
||||
{{ state.selectedNodeToShowNeighbours.short_name }} Neighbors
|
||||
</h2>
|
||||
<h3
|
||||
v-if="state.selectedNodeToShowNeighboursType === 'weHeard'"
|
||||
class="text-sm"
|
||||
>
|
||||
Nodes heard by {{ state.selectedNodeToShowNeighbours.short_name }}
|
||||
</h3>
|
||||
<h3
|
||||
v-if="state.selectedNodeToShowNeighboursType === 'theyHeard'"
|
||||
class="text-sm"
|
||||
>
|
||||
Nodes that heard {{ state.selectedNodeToShowNeighbours.short_name }}
|
||||
</h3>
|
||||
</div>
|
||||
<CloseActionButton
|
||||
@click="dismissShowingNodeNeighbours"
|
||||
class="my-auto ml-3"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</transition>
|
||||
</div>
|
||||
</template>
|
Reference in New Issue
Block a user