General clean up and improvements.

This commit is contained in:
Scott Idem
2025-04-02 13:42:14 -04:00
parent b9f4189a95
commit 7fa0d5cc5b
6 changed files with 41 additions and 7 deletions

View File

@@ -8,7 +8,11 @@ import { onMount } from 'svelte';
import { goto } from '$app/navigation';
// *** Import other supporting libraries
import { BookPlus, FolderPlus } from '@lucide/svelte';
import {
BookPlus,
FolderPlus, Library,
SquareLibrary
} from '@lucide/svelte';
import { liveQuery } from "dexie";
import { Modal } from 'flowbite-svelte';
@@ -82,6 +86,14 @@ onMount(() => {
});
async function create_journal() {
// Confirm before creating a new journal
if (confirm('Are you sure you want to create a new journal?')) {
console.log('Creating new journal...');
} else {
console.log('Journal creation cancelled.');
return;
}
if ($journals_sess.journal.new_journal_name && $journals_sess.journal.new_journal_type_code) {
$journals_slct.journal_id = null;
try {
@@ -130,7 +142,11 @@ async function create_journal() {
<section class="ae_journals md:container h-full mx-auto space-y-2">
<h1 class="h1 text-center">Journals for {$ae_loc.account_name ?? 'Æ loading...'}</h1>
<h1 class="h1 text-center">
<!-- <Library size="1em" class="mx-1 inline-block" /> -->
<SquareLibrary size="1em" class="mx-1 inline-block text-gray-500"/>
Journals for {$ae_loc.account_name ?? 'Æ loading...'}
</h1>
<div class="flex flex-row items-center justify-center w-full border-gray-200 border-y-2 py-2">
<!-- Add new journal button -->
@@ -233,8 +249,16 @@ async function create_journal() {
<input type="text" placeholder="Journal Type" bind:value={$journals_sess.journal.new_journal_type_code} class="input input-bordered w-full mb-2" />
</div>
<div class="modal-action">
<button class="btn btn-primary" onclick={create_journal}>Create</button>
<button class="btn" onclick={$journals_sess.show__modal_new__journal_obj ?? false}>
<button class="btn variant-glass-primary"
onclick={create_journal}>Create</button>
<button
type="button"
onclick={() => {
// Close the modal
$journals_sess.show__modal_new__journal_obj = false;
}}
class="btn variant-glass-secondary"
>
Cancel
</button>
</div>