parent
054c7faaac
commit
a7098df9cf
17
src/components/ContactsEmptyState.svelte
Normal file
17
src/components/ContactsEmptyState.svelte
Normal file
@ -0,0 +1,17 @@
|
||||
<script>
|
||||
import { _ } from "svelte-i18n";
|
||||
import AddContactModal from "./AddContactModal.svelte";
|
||||
import team_empty from "./team_empty.svg";
|
||||
let modal_open = false;
|
||||
let current_contacts = [];
|
||||
</script>
|
||||
|
||||
<div class="text-center items-center justify-center">
|
||||
<p class="mb-16 text-lg text-gray-500">
|
||||
<img class="w-full h-44" src={team_empty} alt="" />
|
||||
<span class="font-bold">There are no contacts added yet.</span><br />
|
||||
<span>Add your first contact</span>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<AddContactModal bind:modal_open bind:current_contacts />
|
@ -6,7 +6,7 @@
|
||||
current_contacts=result;
|
||||
})
|
||||
import store from "../store";
|
||||
// import TeamsEmptyState from "./TeamsEmptyState.svelte";
|
||||
import ContactsEmptyState from "./ContactsEmptyState.svelte";
|
||||
$: searchvalue = "";
|
||||
$: active_deletes = [];
|
||||
export let current_contacts = [];
|
||||
@ -22,7 +22,7 @@
|
||||
</div>
|
||||
{:then}
|
||||
{#if current_contacts.length === 0}
|
||||
<!-- <TeamsEmptyState /> -->
|
||||
<ContactsEmptyState />
|
||||
{:else}
|
||||
{JSON.stringify(current_contacts)}
|
||||
<input
|
||||
@ -99,9 +99,12 @@
|
||||
<div class="flex items-center">
|
||||
<div class="ml-4">
|
||||
<div class="text-sm font-medium text-gray-900">
|
||||
{#if t.contact}
|
||||
{JSON.stringify(t.contact)}
|
||||
{:else}no contact specified{/if}
|
||||
<!-- {JSON.stringify(t.address)} -->
|
||||
{t.address.address1}<br>
|
||||
{t.address.address2 || ''}<br>
|
||||
{t.address.postalcode}
|
||||
{t.address.city}
|
||||
{t.address.country}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -118,20 +121,16 @@
|
||||
Delete</button>
|
||||
<button
|
||||
on:click={() => {
|
||||
GroupContactService.runnerTeamControllerRemove(t.id, false)
|
||||
GroupContactService.groupContactControllerRemove(t.id, false)
|
||||
.then((resp) => {
|
||||
current_contacts = current_contacts.filter((obj) => obj.id !== t.id);
|
||||
Toastify({
|
||||
text: 'Organization deleted',
|
||||
text: 'Contact deleted',
|
||||
duration: 500,
|
||||
backgroundColor:
|
||||
'linear-gradient(to right, #00b09b, #96c93d)',
|
||||
}).showToast();
|
||||
})
|
||||
.catch((err) => {
|
||||
modal_open = true;
|
||||
delete_team = t;
|
||||
});
|
||||
}}
|
||||
tabindex="0"
|
||||
class="ml-4 text-red-600 hover:text-red-900 cursor-pointer">Confirm
|
||||
|
Loading…
x
Reference in New Issue
Block a user