Skip to content

Commit 43f751a

Browse files
authored
Merge pull request #3 from codewec/dev
#2 add title & fix form modal
2 parents 7371afd + 10b70b8 commit 43f751a

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

src/lib/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
export const version = '0.0.2';
1+
export const version = '0.0.3';
2+
export const page_title = 'Dashlit';
23
export const default_dashboard = 'dashboard.json';
34
export const data_path = '/app/data';
45
export const cookie_token_key = 'token';

src/routes/(auth)/login/+page.svelte

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
<script lang="ts">
22
import { enhance } from '$app/forms';
3+
import { page_title } from '$lib';
34
import { Card, Button, Label, Input, Helper } from 'flowbite-svelte';
45
56
let errorMessage: string | undefined = $state(undefined);
67
</script>
78

9+
<svelte:head>
10+
<title>{page_title}</title>
11+
</svelte:head>
12+
813
<div
914
class="flex h-screen items-center justify-center bg-gradient-to-r from-indigo-200 via-purple-200 to-pink-200 p-4"
1015
>

src/routes/+page.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const load: PageServerLoad = async (event) => {
2222
return '{}';
2323
});
2424
const dashboard: Dashboard = JSON.parse(data);
25-
return { groups: dashboard.groups, canLogout: env.PASSWORD?.length ?? 0 > 0 };
25+
return { groups: dashboard.groups, canLogout: (env.PASSWORD?.length ?? 0) > 0 };
2626
};
2727

2828
export const actions = {

src/routes/+page.svelte

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import ModalFormItem from '$lib/components/modalFormItem.svelte';
1414
import ModalFormGroup from '$lib/components/modalFormGroup.svelte';
1515
import { newGroup, newItem } from '$lib/factory.js';
16+
import { page_title } from '$lib';
1617
1718
let { data } = $props();
1819
@@ -144,14 +145,17 @@
144145
};
145146
</script>
146147

148+
<svelte:head>
149+
<title>{page_title}</title>
150+
</svelte:head>
151+
147152
<div class="bg-gray-50 p-4">
148153
<Header
149154
{editMode}
150155
canLogout={data.canLogout}
151156
handleSave={handleSaveDashboard}
152157
handleEdit={() => (editMode = !editMode)}
153158
/>
154-
155159
<Dashboard
156160
{editMode}
157161
{groups}
@@ -186,7 +190,7 @@
186190
if (item && editableItem) {
187191
handleSaveItem(editableItem.groupId, item);
188192
} else {
189-
editableGroup = undefined;
193+
editableItem = undefined;
190194
}
191195
}}
192196
/>

0 commit comments

Comments
 (0)