diff --git a/src/lib/components/Modal.svelte b/src/lib/components/Modal.svelte
index 964eebb93..7919140e0 100644
--- a/src/lib/components/Modal.svelte
+++ b/src/lib/components/Modal.svelte
@@ -12,6 +12,7 @@
export const show = () => {
open = true;
+ console.log('lfkjdsflkdsj');
dialog.showModal();
};
export const hide = () => {
@@ -22,7 +23,7 @@
export const isOpen = () => open;
const handleClick = (event: MouseEvent) => {
- if (content && !content.contains(event.target as Node | null)) {
+ if (content && !content.contains(event.target as Node | null) && !event.defaultPrevented) {
hide();
}
};
diff --git a/src/lib/components/icons/IconClose.svelte b/src/lib/components/icons/IconClose.svelte
new file mode 100644
index 000000000..e3a2a7ada
--- /dev/null
+++ b/src/lib/components/icons/IconClose.svelte
@@ -0,0 +1,20 @@
+
+
+
diff --git a/src/lib/components/icons/index.ts b/src/lib/components/icons/index.ts
index ee2eff717..3d3a7bebb 100644
--- a/src/lib/components/icons/index.ts
+++ b/src/lib/components/icons/index.ts
@@ -22,3 +22,4 @@ export { default as IconGitBranch } from './IconGitBranch.svelte';
export { default as IconHome } from './IconHome.svelte';
export { default as IconLoading } from './IconLoading.svelte';
export { default as IconTerminal } from './IconTerminal.svelte';
+export { default as IconClose } from './IconClose.svelte';
diff --git a/src/routes/projects/[projectId]/commit/+page.svelte b/src/routes/projects/[projectId]/commit/+page.svelte
index c5f8ed574..14ce8e096 100644
--- a/src/routes/projects/[projectId]/commit/+page.svelte
+++ b/src/routes/projects/[projectId]/commit/+page.svelte
@@ -8,10 +8,12 @@
import { error, success } from '$lib/toasts';
import { fly } from 'svelte/transition';
import { IconRotateClockwise } from '$lib/components/icons';
+ import { Dialog } from '$lib/components';
export let data: PageData;
- const { statuses, diffs, user, api, projectId } = data;
+ const { statuses, diffs, user, api, projectId, project } = data;
+ let connectToCloudDialog: Dialog;
let summary = '';
let description = '';
@@ -58,6 +60,14 @@
};
const onGenerateCommitMessage = async () => {
+ if (!isLoggedIn) {
+ // TODO: Modal prompting the user to log in
+ return;
+ }
+ if (!isCloudEnabled) {
+ connectToCloudDialog.show();
+ return;
+ }
if ($user === undefined) return;
const partialDiff = Object.fromEntries(
@@ -118,10 +128,46 @@
$: isCommitEnabled = summary.length > 0 && $statuses.filter(({ staged }) => staged).length > 0;
$: isLoggedIn = $user !== undefined;
+ $: isCloudEnabled = $project?.api?.sync;
$: isSomeFilesSelected = $statuses.some(({ staged }) => staged) && $statuses.length > 0;
$: isGenerateCommitEnabled = isLoggedIn && isSomeFilesSelected;
+
+ GitButler Cloud required
+
+
+ By connecting to GitButler Cloud you'll unlock improved, cloud only features, including
+ AI-generated commit summaries, and the assurance of never losing your work with synced
+ project.
+
+
+ AI-genearate commits
+
+ This not only saves you time and effort but also ensures consistency in tone and style,
+ ultimately helping you to boost sales and improve customer satisfaction.
+
+
+
+ Secure and reliable backup
+
+ GitButler backup guarantees that anything you’ve ever written in your projects are safe,
+ secure and easily recoverable.
+
+