refactor snackbar

This commit is contained in:
Rotimi Best
2023-09-27 05:35:06 +01:00
parent ff2ba21de1
commit a391af49a3
26 changed files with 143 additions and 304 deletions
+2 -5
View File
@@ -1,11 +1,9 @@
<script lang="ts">
import TextChip from '$lib/components/Chip/Text.svelte';
import ComingSoon from '$lib/components/ComingSoon/index.svelte';
import Filter from 'carbon-icons-svelte/lib/Filter.svelte';
import { onMount } from 'svelte';
import copy from 'copy-to-clipboard';
import {
Pagination,
CopyButton,
Search,
StructuredList,
@@ -33,7 +31,7 @@
import type { Person, ProfileRole } from '$lib/components/Course/components/People/types';
import { ROLE_LABEL, ROLES } from '$lib/utils/constants/roles';
import { profile } from '$lib/utils/store/user';
import { snackbarStore } from '$lib/components/Snackbar/store';
import { snackbar } from '$lib/components/Snackbar/store';
import Avatar from '$lib/components/Avatar/index.svelte';
export let data;
@@ -101,8 +99,7 @@
}
function copyToClipboard(studentAssignedId: string | null) {
$snackbarStore.open = true;
$snackbarStore.message = `Copied to clipboard`;
snackbar.success(`Copied to clipboard`);
if (studentAssignedId) {
copy(studentAssignedId);