Sponsorships and Speakers are working and looking pretty well. Other general clean up.
This commit is contained in:
@@ -7,6 +7,7 @@ console.log(`Svelte Sponsorships page data:`, data);
|
||||
// import type { Writable } from 'svelte/store';
|
||||
// const store_current_page: Writable<string> = localStorageStore('store_current_page', 'start');
|
||||
|
||||
// https://github.com/skeletonlabs/skeleton/blob/master/packages/skeleton/src/lib/utilities/Modal/types.ts
|
||||
// To retrieve the store, getModalStore must be invoked at the top level of your component!
|
||||
import { getDrawerStore, getModalStore, ProgressRadial } from '@skeletonlabs/skeleton';
|
||||
import type {
|
||||
@@ -19,34 +20,45 @@ const modalStore = getModalStore();
|
||||
|
||||
import { api } from '$lib/api';
|
||||
import { ae_loc, ae_sess, ae_api, slct, slct_trigger } from '$lib/ae_stores';
|
||||
|
||||
import type { key_val } from '$lib/ae_stores';
|
||||
|
||||
import Edit_modal_sponsorship_obj from './10_edit_modal__sponsorship_obj.svelte';
|
||||
import List_sponsorship_obj from './10_list__sponsorship_obj.svelte';
|
||||
import View_modal_sponsorship_obj from './10_view_modal__sponsorship_obj.svelte';
|
||||
|
||||
type key_val = {
|
||||
[key: string]: any;
|
||||
};
|
||||
|
||||
// Editing
|
||||
const modalComponentEditSponsorshipObj: ModalComponent = { ref: Edit_modal_sponsorship_obj };
|
||||
const modalComponentEditSponsorshipObj: ModalComponent = { ref: Edit_modal_sponsorship_obj, props: {container_class_li: 'w-full p-4 space-y-4 card', container_header_class_li: 'card-header text-2xl font-bold'} };
|
||||
|
||||
const modal_edit__sponsorship_obj: ModalSettings = {
|
||||
type: 'component',
|
||||
component: modalComponentEditSponsorshipObj,
|
||||
title: 'Edit Sponsorship',
|
||||
position: '', // default is "items-center"
|
||||
|
||||
// Provide arbitrary classes to the backdrop and modal elements:
|
||||
// backdropClasses: '!bg-green-500',
|
||||
// modalClasses: 'w-modal-wide',
|
||||
|
||||
// Provide arbitrary metadata to your modal instance:
|
||||
// meta: { fn: do_something_function }
|
||||
};
|
||||
|
||||
// Viewing
|
||||
const modalComponentViewSponsorshipObj: ModalComponent = { ref: View_modal_sponsorship_obj };
|
||||
const modalComponentViewSponsorshipObj: ModalComponent = { ref: View_modal_sponsorship_obj, props: {container_class_li: 'w-full p-4 space-y-4 card', container_header_class_li: 'card-header text-2xl font-bold'} };
|
||||
|
||||
const modal_view__sponsorship_obj: ModalSettings = {
|
||||
type: 'component',
|
||||
component: modalComponentViewSponsorshipObj,
|
||||
title: 'Viewing Sponsorship',
|
||||
position: '', // default is "items-center"
|
||||
|
||||
// Provide arbitrary classes to the backdrop and modal elements:
|
||||
// backdropClasses: '!bg-green-500',
|
||||
// modalClasses: 'w-modal-wide',
|
||||
|
||||
// Provide arbitrary metadata to your modal instance:
|
||||
// meta: { fn: do_something_function }
|
||||
};
|
||||
|
||||
// We don't want the edit or view to show up by default. Maybe if we see an object ID param in the URL, we can show the view modal.
|
||||
@@ -59,13 +71,27 @@ $ae_loc.site_domain = data.url.origin;
|
||||
$: if ($slct_trigger == 'show_edit__sponsorship_obj' && $ae_loc.mod.sponsorships.show_edit__sponsorship_obj) {
|
||||
console.log('Show Modal Edit');
|
||||
$slct_trigger = null;
|
||||
|
||||
let location = window.location.href;
|
||||
const url = new URL(location);
|
||||
url.searchParams.set('sponsorship_id', $slct.sponsorship_id);
|
||||
history.pushState({}, '', url);
|
||||
|
||||
// $ae_loc.mod.sponsorships.show_view__sponsorship_obj = false;
|
||||
// modalStore.clear();
|
||||
modalStore.trigger(modal_edit__sponsorship_obj);
|
||||
}
|
||||
$: if ($slct_trigger == 'show_view__sponsorship_obj' && $ae_loc.mod.sponsorships.show_view__sponsorship_obj) {
|
||||
console.log('Show Modal View');
|
||||
$slct_trigger = null;
|
||||
|
||||
let location = window.location.href;
|
||||
const url = new URL(location);
|
||||
url.searchParams.set('sponsorship_id', $slct.sponsorship_id);
|
||||
history.pushState({}, '', url);
|
||||
|
||||
// $ae_loc.mod.sponsorships.show_edit__sponsorship_obj = false;
|
||||
// modalStore.clear();
|
||||
modalStore.trigger(modal_view__sponsorship_obj);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user