diff --git a/README.md b/README.md index 740d79e..285557f 100644 --- a/README.md +++ b/README.md @@ -102,10 +102,10 @@ yarn build - Example: `mysupacomments.com` ```html -
+
``` -- Optionally, You can set the `loadmore` attribute to `true` to disable autoloading of comments, the User has to click Load Comments button. (Default is `false`) +- Optionally, You can set the `clickToLoad` attribute to `true` to disable autoloading of comments, the User has to click Load Comments button. (Default is `false`) Now, If you open your static website or blog, you will see the comments section like below. diff --git a/package.json b/package.json index 7729531..edbefa4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "SupaComments", - "version": "0.0.3", + "version": "0.0.4", "private": true, "scripts": { "watch:tailwind": "postcss public/tailwind.css -o public/build/comments.css -w", diff --git a/public/index.html b/public/index.html index f8568e2..d7636ab 100644 --- a/public/index.html +++ b/public/index.html @@ -13,7 +13,7 @@ -
+
diff --git a/src/App.svelte b/src/App.svelte index d794585..f1d1f5d 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -4,12 +4,12 @@ const postPath = window.location.pathname; const hostURL = window.location.host; export let appUrl; - export let loadMore; + export let clickToLoad; const Props = { hostURL, postPath, - loadMore, + clickToLoad, }; diff --git a/src/components/AllComments.svelte b/src/components/AllComments.svelte index 2219ffb..c35cb4d 100644 --- a/src/components/AllComments.svelte +++ b/src/components/AllComments.svelte @@ -4,11 +4,11 @@ import { generateFromString } from "generate-avatar"; export let postPath; let loading = true; - export let loadMore; - let enableLoadMore; + export let clickToLoad; + let enableclickToLoad; export const comments = async () => { - enableLoadMore = false; + enableclickToLoad = false; const { data, error } = await supabase .from("comments") .select() @@ -27,10 +27,10 @@ } }; - if (loadMore) { - enableLoadMore = true; + if (clickToLoad) { + enableclickToLoad = true; } else { - enableLoadMore = false; + enableclickToLoad = false; comments(); } @@ -42,7 +42,7 @@

User Comments

- {#if enableLoadMore} + {#if enableclickToLoad}