diff --git a/src/lib/actions/clickOutside.ts b/src/lib/actions/clickOutside.ts new file mode 100644 index 0000000000..8520ac3176 --- /dev/null +++ b/src/lib/actions/clickOutside.ts @@ -0,0 +1,15 @@ +export function clickOutside(node: HTMLElement, callback: () => void) { + const handleClick = (event: MouseEvent) => { + if (node && !node.contains(event.target as Node)) { + callback(); + } + }; + + document.addEventListener('click', handleClick, true); + + return { + destroy() { + document.removeEventListener('click', handleClick, true); + } + }; +} diff --git a/src/lib/components/Select.svelte b/src/lib/components/Select.svelte index 7c127fcc72..75fc926904 100644 --- a/src/lib/components/Select.svelte +++ b/src/lib/components/Select.svelte @@ -146,14 +146,14 @@ {#each groups as group} {@const isDefault = group.label === DEFAULT_GROUP} {#if isDefault} - {#each options as option} + {#each group.options as option} {/each} {:else} - {#each options as option} + {#each group.options as option} diff --git a/src/lib/layouts/Docs.svelte b/src/lib/layouts/Docs.svelte index 41fbe335c9..d01f179a3b 100644 --- a/src/lib/layouts/Docs.svelte +++ b/src/lib/layouts/Docs.svelte @@ -58,8 +58,21 @@ }); setContext('isDocs', true); + + const handleKeydown = (e: KeyboardEvent) => { + if (e.key === 'Escape' && ($layoutState.showReferences || $layoutState.showSidenav)) { + e.preventDefault(); + layoutState.update((state) => ({ + ...state, + showReferences: false, + showSidenav: false + })); + } + }; + +
diff --git a/src/lib/layouts/Sidebar.svelte b/src/lib/layouts/Sidebar.svelte index 3d327e8f7e..bace756b3b 100644 --- a/src/lib/layouts/Sidebar.svelte +++ b/src/lib/layouts/Sidebar.svelte @@ -1,114 +1,123 @@ - diff --git a/src/routes/community/+page.svelte b/src/routes/community/+page.svelte index fa995928b6..836501e3b6 100644 --- a/src/routes/community/+page.svelte +++ b/src/routes/community/+page.svelte @@ -370,7 +370,9 @@ style="--grid-item-size:15rem" >
  • -
    +
    Create content
    @@ -380,7 +382,9 @@
  • -
    +
    Present at meetups
    @@ -390,7 +394,9 @@
  • -
    +
    Report bugs
    @@ -400,7 +406,9 @@
  • -
    +
    Submit new ideas
    @@ -410,7 +418,9 @@
  • -
    +
    Improve documentation
    @@ -420,7 +430,9 @@
  • -
    +
    Helping others
    @@ -585,107 +597,103 @@
    -
    -
    -
    -
    -
    -
    -

    - Appwrite insights -

    -

    - Sign up to our company blog and get the latest insights - from Appwrite. Learn more about engineering, product - design, building community, and tips & tricks for using - Appwrite. -

    -
    -
    +
    +
    +
    +
    +
    +

    + Appwrite insights +

    +

    + Sign up to our company blog and get the latest insights from + Appwrite. Learn more about engineering, product design, + building community, and tips & tricks for using Appwrite. +

    +
    - {#if submitted} -
    - - - - +
    + {#if submitted} +
    + + + + - - Thank you for subscribing! An email has been sent to your - inbox. - + + Thank you for subscribing! An email has been sent to your inbox. + +
    + {:else} +
    +
    + + +
    +
    + +
    - {:else} - Sign up -
    - - -
    -
    - - -
    - - {#if error} - - Something went wrong. Please try again later. - - {/if} -
    - {/if} -
    + {#if error} + + Something went wrong. Please try again later. + + {/if} + + {/if}
    - +
    {/each}
    -