Upload New Intro
{#if !!uploadPromise}
{#await uploadPromise}
diff --git a/src/IntroSelector.svelte b/src/IntroSelector.svelte
index da56ff1..8b78b57 100644
--- a/src/IntroSelector.svelte
+++ b/src/IntroSelector.svelte
@@ -11,6 +11,7 @@
export let exclude = null;
export let include = null;
export let btnLabel = 'Add';
+ export let btnDanger = false;
export let emptyMsg = null;
let filteredIntroList = [];
@@ -82,16 +83,35 @@
let selectedIntros = [];
-
- {#if !!filteredIntroList && filteredIntroList.length > 0}
- {#each filteredIntroList as intro (intro.index)}
-
- {/each}
- {:else}
-
{emptyMsg}
- {/if}
-
+
+
+ {#if !!filteredIntroList && filteredIntroList.length > 0}
+ {#each filteredIntroList as intro (intro.index)}
+
+ {/each}
+ {:else}
+
{emptyMsg}
+ {/if}
+
+
+
+
diff --git a/src/api.js b/src/api.js
index fe28c8c..4c4f13d 100644
--- a/src/api.js
+++ b/src/api.js
@@ -1,6 +1,6 @@
import { env } from '$env/dynamic/public';
-export const apiCall = async (method, endpoint, token, body) => {
+export const apiCall = async (method, endpoint, token, body, contentType) => {
const headers = (() => {
if (!!token) {
return { 'token': token };
@@ -12,7 +12,7 @@ export const apiCall = async (method, endpoint, token, body) => {
return (await
fetch(
`${env.PUBLIC_API_URL}/${endpoint}`,
- { method: method, headers: headers, body: body })
+ { method: method, headers: { 'Content-Type': contentType, ...headers }, body: body })
);
};
@@ -48,3 +48,7 @@ export const removeIntro = async (guild, channel, selectedIntros, token) => {
export const uploadIntro = async (guild, name, file, token) => {
await apiCall('POST', `intros/${guild}/upload?name=${encodeURIComponent(name)}`, token, file);
}
+
+export const deleteIntro = async (guild, selectedIntros, token) => {
+ await apiCall('DELETE', `intros/${guild}/delete`, token, JSON.stringify(selectedIntros), 'application/json');
+}
diff --git a/src/app.html b/src/app.html
index fffa607..4869924 100644
--- a/src/app.html
+++ b/src/app.html
@@ -23,7 +23,7 @@
div#cardContent {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
- align-items: center;
+ align-items: stretch;
justify-items: center;
justify-content: center;
background-color: #323259;
@@ -33,14 +33,24 @@
gap: 1em;
}
- div#list {
+ div#nestedCardContent {
display: flex;
+ position: relative;
width: 85%;
- border-radius: 4px;
+ height: fit-content;
flex-direction: column;
align-items: center;
+ background-color: #2a2a4a;
+ padding: 16px;
+ box-shadow: 1px 3px 4px 1px #1f1f36;
+ }
+
+ div#nestedCardContent.cardNoShadow{
+ box-shadow: none;
+ }
+
+ div#nestedCardContent.cardLight{
background-color: #323259;
- padding: 1em;
}
button, #list-item {
@@ -68,5 +78,5 @@
background-image: linear-gradient(0deg, #40406e, #444475);
}
- %sveltekit.body%
+
%sveltekit.body%