mirror of
https://github.com/LukeHagar/website.git
synced 2025-12-06 12:57:48 +00:00
migrate: page from stores to state.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { fade } from 'svelte/transition';
|
import { fade } from 'svelte/transition';
|
||||||
import { loggedIn, user } from '$lib/utils/console';
|
import { loggedIn, user } from '$lib/utils/console';
|
||||||
import { PUBLIC_GROWTH_ENDPOINT } from '$env/static/public';
|
import { PUBLIC_GROWTH_ENDPOINT } from '$env/static/public';
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
email,
|
email,
|
||||||
type: feedbackType,
|
type: feedbackType,
|
||||||
route: $page.route.id,
|
route: page.route.id,
|
||||||
comment,
|
comment,
|
||||||
metaFields: {
|
metaFields: {
|
||||||
userId
|
userId
|
||||||
@@ -102,7 +102,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
href={`https://github.com/appwrite/website/tree/main/src/routes${$page.route.id}`}
|
href={`https://github.com/appwrite/website/tree/main/src/routes${page.route.id}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel="noopener noreferrer"
|
||||||
class="web-link flex items-baseline gap-1"
|
class="web-link flex items-baseline gap-1"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
|
|
||||||
let mounted = false;
|
let mounted = false;
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
const randomDelay = () => Math.floor(Math.random() * 750);
|
const randomDelay = () => Math.floor(Math.random() * 750);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="banner" class:hidden={$page.url.pathname.includes('init')}>
|
<div class="banner" class:hidden={page.url.pathname.includes('init')}>
|
||||||
<div class="content text-primary">
|
<div class="content text-primary">
|
||||||
<div class="headings">
|
<div class="headings">
|
||||||
<span style:font-weight="500"
|
<span style:font-weight="500"
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
import { classNames } from '$lib/utils/classnames';
|
import { classNames } from '$lib/utils/classnames';
|
||||||
import { trackEvent } from '$lib/actions/analytics';
|
import { trackEvent } from '$lib/actions/analytics';
|
||||||
import { browser } from '$app/environment';
|
import { browser } from '$app/environment';
|
||||||
import { page } from '$app/stores';
|
|
||||||
import { getAppwriteDashboardUrl } from '$lib/utils/dashboard';
|
import { getAppwriteDashboardUrl } from '$lib/utils/dashboard';
|
||||||
|
|
||||||
export let classes = '';
|
export let classes = '';
|
||||||
|
|||||||
@@ -44,7 +44,7 @@
|
|||||||
import { isMac } from '$lib/utils/platform';
|
import { isMac } from '$lib/utils/platform';
|
||||||
import { getContext, setContext } from 'svelte';
|
import { getContext, setContext } from 'svelte';
|
||||||
import { GITHUB_REPO_LINK, GITHUB_STARS } from '$lib/constants';
|
import { GITHUB_REPO_LINK, GITHUB_STARS } from '$lib/constants';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { getAppwriteDashboardUrl } from '$lib/utils/dashboard';
|
import { getAppwriteDashboardUrl } from '$lib/utils/dashboard';
|
||||||
|
|
||||||
export let variant: DocsLayoutVariant = 'default';
|
export let variant: DocsLayoutVariant = 'default';
|
||||||
@@ -67,7 +67,7 @@
|
|||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
|
|
||||||
const key = $page.route.id?.includes('tutorials') ? TUT_CTX_KEY : CTX_KEY;
|
const key = page.route.id?.includes('tutorials') ? TUT_CTX_KEY : CTX_KEY;
|
||||||
setContext(key, true);
|
setContext(key, true);
|
||||||
|
|
||||||
const handleKeydown = (e: KeyboardEvent) => {
|
const handleKeydown = (e: KeyboardEvent) => {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
import type { TocItem } from './DocsArticle.svelte';
|
import type { TocItem } from './DocsArticle.svelte';
|
||||||
import Heading from '$markdoc/nodes/Heading.svelte';
|
import Heading from '$markdoc/nodes/Heading.svelte';
|
||||||
import { onMount, tick } from 'svelte';
|
import { onMount, tick } from 'svelte';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
|
|
||||||
export let toc: Array<TocItem>;
|
export let toc: Array<TocItem>;
|
||||||
export let back: string;
|
export let back: string;
|
||||||
@@ -50,13 +50,13 @@
|
|||||||
async function preSelectItemOnInit() {
|
async function preSelectItemOnInit() {
|
||||||
await tick();
|
await tick();
|
||||||
|
|
||||||
if (!$page.url.hash) return;
|
if (!page.url.hash) return;
|
||||||
const tocItem = toc.slice(1);
|
const tocItem = toc.slice(1);
|
||||||
|
|
||||||
// no sub-items, return.
|
// no sub-items, return.
|
||||||
if (!tocItem.length) return;
|
if (!tocItem.length) return;
|
||||||
|
|
||||||
const pageHash = $page.url.hash.replace('#', '');
|
const pageHash = page.url.hash.replace('#', '');
|
||||||
const tocItemHref = tocItem[0].href.replace('#', '');
|
const tocItemHref = tocItem[0].href.replace('#', '');
|
||||||
|
|
||||||
if (pageHash !== tocItemHref) return;
|
if (pageHash !== tocItemHref) return;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
import ProductsMobileSubmenu from '$lib/components/ProductsMobileSubmenu.svelte';
|
import ProductsMobileSubmenu from '$lib/components/ProductsMobileSubmenu.svelte';
|
||||||
import { trackEvent } from '$lib/actions/analytics';
|
import { trackEvent } from '$lib/actions/analytics';
|
||||||
import MainNav from '$lib/components/MainNav.svelte';
|
import MainNav from '$lib/components/MainNav.svelte';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { getAppwriteDashboardUrl } from '$lib/utils/dashboard';
|
import { getAppwriteDashboardUrl } from '$lib/utils/dashboard';
|
||||||
|
|
||||||
export let omitMainId = false;
|
export let omitMainId = false;
|
||||||
@@ -190,7 +190,7 @@
|
|||||||
class:is-special-padding={!BANNER_KEY.startsWith('init-banner-')}
|
class:is-special-padding={!BANNER_KEY.startsWith('init-banner-')}
|
||||||
style={BANNER_KEY === 'init-banner-02' ? 'padding-inline: 0' : ''}
|
style={BANNER_KEY === 'init-banner-02' ? 'padding-inline: 0' : ''}
|
||||||
>
|
>
|
||||||
<!-- {#if !$page.data.isStickyNav}
|
<!-- {#if !page.data.isStickyNav}
|
||||||
{#if BANNER_KEY.startsWith('init-banner-')}
|
{#if BANNER_KEY.startsWith('init-banner-')}
|
||||||
<InitBanner />
|
<InitBanner />
|
||||||
{:else}
|
{:else}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import type { NavLink } from './Sidebar.svelte';
|
import type { NavLink } from './Sidebar.svelte';
|
||||||
|
|
||||||
export let groupItem: NavLink;
|
export let groupItem: NavLink;
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<a
|
<a
|
||||||
class="web-side-nav-button flex size-10 w-full items-center rounded-lg p-2 whitespace-nowrap"
|
class="web-side-nav-button flex size-10 w-full items-center rounded-lg p-2 whitespace-nowrap"
|
||||||
class:is-selected={$page.url?.pathname === groupItem.href}
|
class:is-selected={page.url?.pathname === groupItem.href}
|
||||||
href={groupItem.href}
|
href={groupItem.href}
|
||||||
target={groupItem.openInNewTab ? '_blank' : '_self'}
|
target={groupItem.openInNewTab ? '_blank' : '_self'}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
import type { TocItem } from '$lib/layouts/DocsArticle.svelte';
|
import type { TocItem } from '$lib/layouts/DocsArticle.svelte';
|
||||||
import { DOCS_TITLE_SUFFIX, OVERVIEW_TITLE_SUFFIX } from '$routes/titles';
|
import { DOCS_TITLE_SUFFIX, OVERVIEW_TITLE_SUFFIX } from '$routes/titles';
|
||||||
import { getContext, setContext } from 'svelte';
|
import { getContext, setContext } from 'svelte';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
|
|
||||||
export let title: string;
|
export let title: string;
|
||||||
export let description: string;
|
export let description: string;
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
return carry;
|
return carry;
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const isProductsPage = /^\/docs\/products\/[^/]+$/.test($page.route.id!.toString());
|
const isProductsPage = /^\/docs\/products\/[^/]+$/.test(page.route.id!.toString());
|
||||||
|
|
||||||
let seoTitle = title + DOCS_TITLE_SUFFIX;
|
let seoTitle = title + DOCS_TITLE_SUFFIX;
|
||||||
if (isProductsPage) seoTitle = title + OVERVIEW_TITLE_SUFFIX;
|
if (isProductsPage) seoTitle = title + OVERVIEW_TITLE_SUFFIX;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { Article, FooterNav, MainFooter } from '$lib/components';
|
import { Article, FooterNav, MainFooter } from '$lib/components';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { Main } from '$lib/layouts';
|
import { Main } from '$lib/layouts';
|
||||||
import { getContext } from 'svelte';
|
import { getContext } from 'svelte';
|
||||||
import { TITLE_SUFFIX } from '$routes/titles';
|
import { TITLE_SUFFIX } from '$routes/titles';
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
const posts = getContext<PostsData[]>('posts');
|
const posts = getContext<PostsData[]>('posts');
|
||||||
const authors = getContext<AuthorData[]>('authors');
|
const authors = getContext<AuthorData[]>('authors');
|
||||||
const author = authors.find(
|
const author = authors.find(
|
||||||
(p) => $page.url.pathname.substring($page.url.pathname.lastIndexOf('/') + 1) === p.slug
|
(p) => page.url.pathname.substring(page.url.pathname.lastIndexOf('/') + 1) === p.slug
|
||||||
);
|
);
|
||||||
|
|
||||||
const seoTitle = name + TITLE_SUFFIX;
|
const seoTitle = name + TITLE_SUFFIX;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { Article, FooterNav, MainFooter } from '$lib/components';
|
import { Article, FooterNav, MainFooter } from '$lib/components';
|
||||||
import { Main } from '$lib/layouts';
|
import { Main } from '$lib/layouts';
|
||||||
import { DEFAULT_HOST } from '$lib/utils/metadata';
|
import { DEFAULT_HOST } from '$lib/utils/metadata';
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
export let name: string;
|
export let name: string;
|
||||||
export let description: string;
|
export let description: string;
|
||||||
|
|
||||||
const pageSlug = $page.url.pathname.substring($page.url.pathname.lastIndexOf('/') + 1);
|
const pageSlug = page.url.pathname.substring(page.url.pathname.lastIndexOf('/') + 1);
|
||||||
const authors = getContext<AuthorData[]>('authors');
|
const authors = getContext<AuthorData[]>('authors');
|
||||||
const postsList = getContext<PostsData[]>('posts');
|
const postsList = getContext<PostsData[]>('posts');
|
||||||
const posts = postsList.filter((post) => post.category.includes(pageSlug));
|
const posts = postsList.filter((post) => post.category.includes(pageSlug));
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
import type { AuthorData, PostsData } from '$routes/blog/content';
|
import type { AuthorData, PostsData } from '$routes/blog/content';
|
||||||
import { TITLE_SUFFIX } from '$routes/titles';
|
import { TITLE_SUFFIX } from '$routes/titles';
|
||||||
import { getContext, setContext } from 'svelte';
|
import { getContext, setContext } from 'svelte';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import CTA from '$lib/components/BlogCta.svelte';
|
import CTA from '$lib/components/BlogCta.svelte';
|
||||||
import PostMeta from '$lib/components/blog/post-meta.svelte';
|
import PostMeta from '$lib/components/blog/post-meta.svelte';
|
||||||
import Breadcrumbs from '$lib/components/blog/breadcrumbs.svelte';
|
import Breadcrumbs from '$lib/components/blog/breadcrumbs.svelte';
|
||||||
@@ -74,7 +74,7 @@
|
|||||||
|
|
||||||
callToAction ??= true;
|
callToAction ??= true;
|
||||||
|
|
||||||
const currentURL = `https://appwrite.io${$page.url.pathname}`;
|
const currentURL = `https://appwrite.io${page.url.pathname}`;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { FooterNav, MainFooter } from '$lib/components';
|
import { FooterNav, MainFooter } from '$lib/components';
|
||||||
import { Main } from '$lib/layouts';
|
import { Main } from '$lib/layouts';
|
||||||
import DocsError from './docs/+error.svelte';
|
import DocsError from './docs/+error.svelte';
|
||||||
|
|
||||||
const isDocs = $page.url.pathname.startsWith('/docs');
|
const isDocs = page.url.pathname.startsWith('/docs');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if isDocs}
|
{#if isDocs}
|
||||||
@@ -16,12 +16,12 @@
|
|||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="web-hero" style="--hero-gap:1.25rem;">
|
<div class="web-hero" style="--hero-gap:1.25rem;">
|
||||||
<span class="web-badges text-micro !text-white uppercase"
|
<span class="web-badges text-micro !text-white uppercase"
|
||||||
>{$page.status}</span
|
>{page.status}</span
|
||||||
>
|
>
|
||||||
<h1 class="text-headline font-aeonik-pro text-primary">
|
<h1 class="text-headline font-aeonik-pro text-primary">
|
||||||
{$page.error?.message ?? 'An error has occured'}
|
{page.error?.message ?? 'An error has occured'}
|
||||||
</h1>
|
</h1>
|
||||||
{#if $page.status === 404}
|
{#if page.status === 404}
|
||||||
<p class="text-description">
|
<p class="text-description">
|
||||||
Sorry, it seems that the page you are looking for does not exist.
|
Sorry, it seems that the page you are looking for does not exist.
|
||||||
Feel free to use our navigation menu or the button below to explore
|
Feel free to use our navigation menu or the button below to explore
|
||||||
|
|||||||
@@ -50,7 +50,8 @@
|
|||||||
import '$icons/output/web-icon.css';
|
import '$icons/output/web-icon.css';
|
||||||
|
|
||||||
import { browser, dev } from '$app/environment';
|
import { browser, dev } from '$app/environment';
|
||||||
import { navigating, page, updated } from '$app/stores';
|
import { page, updated } from '$app/state';
|
||||||
|
import { navigating } from '$app/stores';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { loggedIn } from '$lib/utils/console';
|
import { loggedIn } from '$lib/utils/console';
|
||||||
import { beforeNavigate } from '$app/navigation';
|
import { beforeNavigate } from '$app/navigation';
|
||||||
@@ -68,9 +69,9 @@
|
|||||||
const tracked = new Set();
|
const tracked = new Set();
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
saveReferrerAndUtmSource($page.url);
|
saveReferrerAndUtmSource(page.url);
|
||||||
|
|
||||||
const initialTheme = $page.route.id?.startsWith('/docs') ? getPreferredTheme() : 'dark';
|
const initialTheme = page.route.id?.startsWith('/docs') ? getPreferredTheme() : 'dark';
|
||||||
|
|
||||||
applyTheme(initialTheme);
|
applyTheme(initialTheme);
|
||||||
|
|
||||||
@@ -95,7 +96,7 @@
|
|||||||
if (window) {
|
if (window) {
|
||||||
tracked.clear();
|
tracked.clear();
|
||||||
}
|
}
|
||||||
if ($updated && !willUnload && to?.url) {
|
if (updated && !willUnload && to?.url) {
|
||||||
location.href = to.url.href;
|
location.href = to.url.href;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -105,8 +106,7 @@
|
|||||||
document.body.dataset.loggedIn = '';
|
document.body.dataset.loggedIn = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
$: canonicalUrl =
|
$: canonicalUrl = page.url.origin.replace(/^https?:\/\/www\./, 'https://') + page.url.pathname;
|
||||||
$page.url.origin.replace(/^https?:\/\/www\./, 'https://') + $page.url.pathname;
|
|
||||||
|
|
||||||
function handleScroll() {
|
function handleScroll() {
|
||||||
const scrollY = window.scrollY;
|
const scrollY = window.scrollY;
|
||||||
@@ -116,9 +116,9 @@
|
|||||||
thresholds.forEach((threshold) => {
|
thresholds.forEach((threshold) => {
|
||||||
if (scrollPercentage >= threshold && !tracked.has(threshold)) {
|
if (scrollPercentage >= threshold && !tracked.has(threshold)) {
|
||||||
const pageName =
|
const pageName =
|
||||||
$page.url.pathname.slice(1) === ''
|
page.url.pathname.slice(1) === ''
|
||||||
? 'home'
|
? 'home'
|
||||||
: $page.url.pathname.slice(1).replace(/\//g, '-');
|
: page.url.pathname.slice(1).replace(/\//g, '-');
|
||||||
|
|
||||||
const eventName = `${pageName}_scroll-depth_${threshold * 100}prct_scroll`;
|
const eventName = `${pageName}_scroll-depth_${threshold * 100}prct_scroll`;
|
||||||
tracked.add(threshold);
|
tracked.add(threshold);
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { tick } from 'svelte';
|
||||||
|
import { page } from '$app/state';
|
||||||
import { Main } from '$lib/layouts';
|
import { Main } from '$lib/layouts';
|
||||||
import { Article, FooterNav, MainFooter } from '$lib/components';
|
import { TITLE_SUFFIX } from '$routes/titles';
|
||||||
import { TITLE_SUFFIX } from '$routes/titles.js';
|
|
||||||
import { DEFAULT_HOST } from '$lib/utils/metadata';
|
import { DEFAULT_HOST } from '$lib/utils/metadata';
|
||||||
import { onMount, tick } from 'svelte';
|
|
||||||
import { beforeNavigate, goto } from '$app/navigation';
|
|
||||||
import { createDebounce } from '$lib/utils/debounce';
|
import { createDebounce } from '$lib/utils/debounce';
|
||||||
|
import { goto, onNavigate } from '$app/navigation';
|
||||||
|
import { Article, FooterNav, MainFooter } from '$lib/components';
|
||||||
|
|
||||||
let { data } = $props();
|
let { data } = $props();
|
||||||
|
|
||||||
@@ -28,20 +28,15 @@
|
|||||||
|
|
||||||
let previousPage: number | null = null;
|
let previousPage: number | null = null;
|
||||||
|
|
||||||
beforeNavigate(({ from, type }) => {
|
onNavigate(async ({ from, type }) => {
|
||||||
previousPage = type === 'link' ? parseInt(from?.params?.page ?? '1') : null;
|
previousPage = type === 'link' ? parseInt(from?.params?.page ?? '1') : null;
|
||||||
|
if (!articlesHeader || !previousPage) return;
|
||||||
|
|
||||||
|
await tick();
|
||||||
|
articlesHeader.scrollIntoView();
|
||||||
});
|
});
|
||||||
|
|
||||||
onMount(() => {
|
let selectedCategory = $state(page.url.searchParams.get('category') ?? 'Latest');
|
||||||
return page.subscribe(async () => {
|
|
||||||
if (articlesHeader && previousPage) {
|
|
||||||
await tick();
|
|
||||||
articlesHeader?.scrollIntoView();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
let selectedCategory = $state($page.url.searchParams.get('category') ?? 'Latest');
|
|
||||||
|
|
||||||
const handleSearch = async () => {
|
const handleSearch = async () => {
|
||||||
const searchQuery = query.toLowerCase();
|
const searchQuery = query.toLowerCase();
|
||||||
@@ -50,7 +45,7 @@
|
|||||||
* Navigate to the first page on search/filter to ensure consistent
|
* Navigate to the first page on search/filter to ensure consistent
|
||||||
* navigation experience when changing categories or search queries.
|
* navigation experience when changing categories or search queries.
|
||||||
*/
|
*/
|
||||||
const url = new URL('/blog', $page.url);
|
const url = new URL('/blog', page.url);
|
||||||
|
|
||||||
if (searchQuery) {
|
if (searchQuery) {
|
||||||
url.searchParams.set('search', searchQuery);
|
url.searchParams.set('search', searchQuery);
|
||||||
@@ -71,7 +66,7 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
let navigationLink = $derived((pageNumber: number): string => {
|
let navigationLink = $derived((pageNumber: number): string => {
|
||||||
const currentUrl = $page.url;
|
const currentUrl = page.url;
|
||||||
const url = new URL(`/blog/${pageNumber}`, currentUrl);
|
const url = new URL(`/blog/${pageNumber}`, currentUrl);
|
||||||
|
|
||||||
if (currentUrl.search) {
|
if (currentUrl.search) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
import { DEFAULT_DESCRIPTION, DEFAULT_HOST } from '$lib/utils/metadata';
|
import { DEFAULT_DESCRIPTION, DEFAULT_HOST } from '$lib/utils/metadata';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import ChangelogEntry from '../ChangelogEntry.svelte';
|
import ChangelogEntry from '../ChangelogEntry.svelte';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { CHANGELOG_KEY } from '../utils';
|
import { CHANGELOG_KEY } from '../utils';
|
||||||
import { TITLE_SUFFIX } from '$routes/titles';
|
import { TITLE_SUFFIX } from '$routes/titles';
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
localStorage.setItem(CHANGELOG_KEY, $page.data.changelogEntries.toString());
|
localStorage.setItem(CHANGELOG_KEY, page.data.changelogEntries.toString());
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { FooterNav, MainFooter, Tooltip } from '$lib/components';
|
import { FooterNav, MainFooter, Tooltip } from '$lib/components';
|
||||||
import PreFooter from '$lib/components/PreFooter.svelte';
|
import PreFooter from '$lib/components/PreFooter.svelte';
|
||||||
import { type SocialShareOption, socialSharingOptions } from '$lib/constants';
|
import { type SocialShareOption, socialSharingOptions } from '$lib/constants';
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
let copyText = $state<CopyStatusValue>(CopyStatus.Copy);
|
let copyText = $state<CopyStatusValue>(CopyStatus.Copy);
|
||||||
|
|
||||||
async function handleCopy() {
|
async function handleCopy() {
|
||||||
const blogPostUrl = encodeURI(`https://appwrite.io${$page.url.pathname}`);
|
const blogPostUrl = encodeURI(`https://appwrite.io${page.url.pathname}`);
|
||||||
|
|
||||||
await copy(blogPostUrl);
|
await copy(blogPostUrl);
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getShareLink(shareOption: SocialShareOption): string {
|
function getShareLink(shareOption: SocialShareOption): string {
|
||||||
const blogPostUrl = encodeURI(`https://appwrite.io${$page.url.pathname}`);
|
const blogPostUrl = encodeURI(`https://appwrite.io${page.url.pathname}`);
|
||||||
const shareableLink = shareOption.link
|
const shareableLink = shareOption.link
|
||||||
.replace('{TITLE}', seo.title + '.')
|
.replace('{TITLE}', seo.title + '.')
|
||||||
.replace('{URL}', blogPostUrl);
|
.replace('{URL}', blogPostUrl);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { MainFooter } from '$lib/components';
|
import { MainFooter } from '$lib/components';
|
||||||
import { Docs } from '$lib/layouts';
|
import { Docs } from '$lib/layouts';
|
||||||
import Sidebar from './Sidebar.svelte';
|
import Sidebar from './Sidebar.svelte';
|
||||||
@@ -10,11 +10,11 @@
|
|||||||
<div class="web-article mx-auto flex max-w-[700px] items-center justify-center py-4">
|
<div class="web-article mx-auto flex max-w-[700px] items-center justify-center py-4">
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="web-hero" style="--hero-gap:1.25rem;">
|
<div class="web-hero" style="--hero-gap:1.25rem;">
|
||||||
<span class="web-badges text-micro !text-white uppercase">{$page.status}</span>
|
<span class="web-badges text-micro !text-white uppercase">{page.status}</span>
|
||||||
<h1 class="text-headline font-aeonik-pro text-primary">
|
<h1 class="text-headline font-aeonik-pro text-primary">
|
||||||
{$page.error?.message ?? 'An error has occured'}
|
{page.error?.message ?? 'An error has occured'}
|
||||||
</h1>
|
</h1>
|
||||||
{#if $page.status === 404}
|
{#if page.status === 404}
|
||||||
<p class="text-description">
|
<p class="text-description">
|
||||||
Sorry, it seems that the page you are looking for does not exist. Feel free
|
Sorry, it seems that the page you are looking for does not exist. Feel free
|
||||||
to use our navigation menu or the button below to explore more of Appwrite's
|
to use our navigation menu or the button below to explore more of Appwrite's
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import Docs from '$lib/layouts/Docs.svelte';
|
import Docs from '$lib/layouts/Docs.svelte';
|
||||||
import Sidebar from '../Sidebar.svelte';
|
import Sidebar from '../Sidebar.svelte';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Docs variant={$page.route.id === '/docs/quick-starts' ? 'default' : 'two-side-navs'}>
|
<Docs variant={page.route.id === '/docs/quick-starts' ? 'default' : 'two-side-navs'}>
|
||||||
<Sidebar />
|
<Sidebar />
|
||||||
<slot />
|
<slot />
|
||||||
</Docs>
|
</Docs>
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import Docs from '$lib/layouts/Docs.svelte';
|
import Docs from '$lib/layouts/Docs.svelte';
|
||||||
import Sidebar, { type NavParent, type NavTree } from '$lib/layouts/Sidebar.svelte';
|
import Sidebar, { type NavParent, type NavTree } from '$lib/layouts/Sidebar.svelte';
|
||||||
import { preferredPlatform, preferredVersion } from '$lib/utils/references';
|
import { preferredPlatform, preferredVersion } from '$lib/utils/references';
|
||||||
|
|
||||||
$: expandable = !!$page.url.pathname.match(
|
$: expandable = !!page.url.pathname.match(
|
||||||
/\/docs\/references\/.*?\/(client|server).*?\/.*?\/?/
|
/\/docs\/references\/.*?\/(client|server).*?\/.*?\/?/
|
||||||
);
|
);
|
||||||
|
|
||||||
$: platform = $preferredPlatform ?? $page.params?.platform ?? 'client-web';
|
$: platform = $preferredPlatform ?? page.params?.platform ?? 'client-web';
|
||||||
|
|
||||||
/* correct platform prefix for references page */
|
/* correct platform prefix for references page */
|
||||||
$: resolvedPlatformPrefix = /^server-|^client-/.test(platform)
|
$: resolvedPlatformPrefix = /^server-|^client-/.test(platform)
|
||||||
? platform
|
? platform
|
||||||
: `server-${platform}`;
|
: `server-${platform}`;
|
||||||
|
|
||||||
$: prefix = `/docs/references/${$preferredVersion ?? $page.params?.version ?? 'cloud'}/${resolvedPlatformPrefix}`;
|
$: prefix = `/docs/references/${$preferredVersion ?? page.params?.version ?? 'cloud'}/${resolvedPlatformPrefix}`;
|
||||||
|
|
||||||
$: navigation = [
|
$: navigation = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import type { SDKMethod } from '$lib/utils/specs';
|
import type { SDKMethod } from '$lib/utils/specs';
|
||||||
|
|
||||||
export let method: SDKMethod;
|
export let method: SDKMethod;
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
class="web-link"
|
class="web-link"
|
||||||
href={`/docs/references/${$page.params.version}/models/${model.id}`}
|
href={`/docs/references/${page.params.version}/models/${model.id}`}
|
||||||
>
|
>
|
||||||
{model.name}
|
{model.name}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { MainFooter, Select } from '$lib/components';
|
import { MainFooter, Select } from '$lib/components';
|
||||||
import { DEFAULT_HOST } from '$lib/utils/metadata';
|
import { DEFAULT_HOST } from '$lib/utils/metadata';
|
||||||
import { layoutState, toggleReferences } from '$lib/layouts/Docs.svelte';
|
import { layoutState, toggleReferences } from '$lib/layouts/Docs.svelte';
|
||||||
@@ -48,7 +48,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
function selectPlatform(event: CustomEvent<unknown>) {
|
function selectPlatform(event: CustomEvent<unknown>) {
|
||||||
const { version, service } = $page.params;
|
const { version, service } = page.params;
|
||||||
const platform = event.detail as Platform;
|
const platform = event.detail as Platform;
|
||||||
|
|
||||||
// except nodejs, all other server sided need to be saved as without `server-` prefix
|
// except nodejs, all other server sided need to be saved as without `server-` prefix
|
||||||
@@ -68,7 +68,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function selectVersion(event: CustomEvent<unknown>) {
|
function selectVersion(event: CustomEvent<unknown>) {
|
||||||
const { platform, service } = $page.params;
|
const { platform, service } = page.params;
|
||||||
const version = event.detail as Version;
|
const version = event.detail as Version;
|
||||||
preferredVersion.set(version);
|
preferredVersion.set(version);
|
||||||
goto(`/docs/references/${version}/${platform}/${service}`, {
|
goto(`/docs/references/${version}/${platform}/${service}`, {
|
||||||
@@ -97,9 +97,9 @@
|
|||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
preferredPlatform.set(platform);
|
preferredPlatform.set(platform);
|
||||||
preferredVersion.set($page.params.version as Version);
|
preferredVersion.set(page.params.version as Version);
|
||||||
|
|
||||||
const isSame = $preferredPlatform === $page.params.platform;
|
const isSame = $preferredPlatform === page.params.platform;
|
||||||
const hasPlatformPrefix =
|
const hasPlatformPrefix =
|
||||||
$preferredPlatform.startsWith('client-') || $preferredPlatform.startsWith('server-');
|
$preferredPlatform.startsWith('client-') || $preferredPlatform.startsWith('server-');
|
||||||
|
|
||||||
@@ -109,7 +109,7 @@
|
|||||||
? $preferredPlatform
|
? $preferredPlatform
|
||||||
: `server-${$preferredPlatform}`;
|
: `server-${$preferredPlatform}`;
|
||||||
|
|
||||||
goto(`/docs/references/${$preferredVersion}/${platformMode}/${$page.params.service}`, {
|
goto(`/docs/references/${$preferredVersion}/${platformMode}/${page.params.service}`, {
|
||||||
noScroll: true,
|
noScroll: true,
|
||||||
replaceState: false
|
replaceState: false
|
||||||
});
|
});
|
||||||
@@ -128,8 +128,8 @@
|
|||||||
serviceDescription.substring(0, serviceDescription.indexOf('.') + 1)
|
serviceDescription.substring(0, serviceDescription.indexOf('.') + 1)
|
||||||
);
|
);
|
||||||
|
|
||||||
let platformBindingForSelect = $derived($page.params.platform as Platform);
|
let platformBindingForSelect = $derived(page.params.platform as Platform);
|
||||||
let platform = $derived(($preferredPlatform ?? $page.params.platform) as Platform);
|
let platform = $derived(($preferredPlatform ?? page.params.platform) as Platform);
|
||||||
let platformType = $derived(platform.startsWith('client-') ? 'CLIENT' : 'SERVER');
|
let platformType = $derived(platform.startsWith('client-') ? 'CLIENT' : 'SERVER');
|
||||||
let serviceName = $derived(serviceMap[data.service?.name]);
|
let serviceName = $derived(serviceMap[data.service?.name]);
|
||||||
let title = $derived(serviceName + API_REFERENCE_TITLE_SUFFIX);
|
let title = $derived(serviceName + API_REFERENCE_TITLE_SUFFIX);
|
||||||
@@ -153,10 +153,10 @@
|
|||||||
<meta name="twitter:image" content={ogImage} />
|
<meta name="twitter:image" content={ogImage} />
|
||||||
<meta name="twitter:card" content="summary_large_image" />
|
<meta name="twitter:card" content="summary_large_image" />
|
||||||
|
|
||||||
{#if $page.params.version !== 'cloud'}
|
{#if page.params.version !== 'cloud'}
|
||||||
<link
|
<link
|
||||||
rel="canonical"
|
rel="canonical"
|
||||||
href={`https://appwrite.io/docs/references/cloud/${$page.params.platform}/${$page.params.service}`}
|
href={`https://appwrite.io/docs/references/cloud/${page.params.platform}/${page.params.service}`}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
@@ -202,7 +202,7 @@
|
|||||||
<Select
|
<Select
|
||||||
nativeMobile
|
nativeMobile
|
||||||
on:change={selectVersion}
|
on:change={selectVersion}
|
||||||
value={$page.params.version}
|
value={page.params.version}
|
||||||
options={[
|
options={[
|
||||||
{ value: 'cloud', label: 'Cloud' },
|
{ value: 'cloud', label: 'Cloud' },
|
||||||
...versions.map((version) => ({
|
...versions.map((version) => ({
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import Article from '$markdoc/layouts/Article.svelte';
|
import Article from '$markdoc/layouts/Article.svelte';
|
||||||
import { Table, Thead, Tr, Th, Tbody, Td, Heading, Fence } from '$markdoc/nodes/_Module.svelte';
|
import { Table, Thead, Tr, Th, Tbody, Td, Heading, Fence } from '$markdoc/nodes/_Module.svelte';
|
||||||
import { parse } from '$lib/utils/markdown';
|
import { parse } from '$lib/utils/markdown';
|
||||||
@@ -10,10 +10,10 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
{#if $page.params.version !== 'cloud'}
|
{#if page.params.version !== 'cloud'}
|
||||||
<link
|
<link
|
||||||
rel="canonical"
|
rel="canonical"
|
||||||
href={`https://appwrite.io/docs/references/cloud/models/${$page.params.model}`}
|
href={`https://appwrite.io/docs/references/cloud/models/${page.params.model}`}
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
</svelte:head>
|
</svelte:head>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import Docs, { type DocsLayoutVariant } from '$lib/layouts/Docs.svelte';
|
import Docs, { type DocsLayoutVariant } from '$lib/layouts/Docs.svelte';
|
||||||
import Sidebar from '../Sidebar.svelte';
|
import Sidebar from '../Sidebar.svelte';
|
||||||
|
|
||||||
$: variant =
|
$: variant =
|
||||||
$page.route.id === '/docs/tutorials' ? 'default' : ('two-side-navs' as DocsLayoutVariant);
|
page.route.id === '/docs/tutorials' ? 'default' : ('two-side-navs' as DocsLayoutVariant);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Docs {variant}>
|
<Docs {variant}>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import FooterNav from '$lib/components/FooterNav.svelte';
|
import FooterNav from '$lib/components/FooterNav.svelte';
|
||||||
import MainFooter from '$lib/components/MainFooter.svelte';
|
import MainFooter from '$lib/components/MainFooter.svelte';
|
||||||
import Main from '$lib/layouts/Main.svelte';
|
import Main from '$lib/layouts/Main.svelte';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import FooterNav from '$lib/components/FooterNav.svelte';
|
import FooterNav from '$lib/components/FooterNav.svelte';
|
||||||
import MainFooter from '$lib/components/MainFooter.svelte';
|
import MainFooter from '$lib/components/MainFooter.svelte';
|
||||||
import Main from '$lib/layouts/Main.svelte';
|
import Main from '$lib/layouts/Main.svelte';
|
||||||
@@ -10,9 +10,9 @@
|
|||||||
let { data } = $props();
|
let { data } = $props();
|
||||||
|
|
||||||
let firstName = data.ticket?.name?.split(/\s/)[0] ?? '';
|
let firstName = data.ticket?.name?.split(/\s/)[0] ?? '';
|
||||||
const ogImage = `${$page.url.origin}/init-0/tickets/${data.ticket.$id}/og`;
|
const ogImage = `${page.url.origin}/init-0/tickets/${data.ticket.$id}/og`;
|
||||||
|
|
||||||
const { copied, copy } = createCopy($page.url.href);
|
const { copied, copy } = createCopy(page.url.href);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import FooterNav from '$lib/components/FooterNav.svelte';
|
import FooterNav from '$lib/components/FooterNav.svelte';
|
||||||
import MainFooter from '$lib/components/MainFooter.svelte';
|
import MainFooter from '$lib/components/MainFooter.svelte';
|
||||||
import Main from '$lib/layouts/Main.svelte';
|
import Main from '$lib/layouts/Main.svelte';
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
saveTicket();
|
saveTicket();
|
||||||
}
|
}
|
||||||
|
|
||||||
const ticketUrl = `${$page.url.origin}/init-0/tickets/${data.ticket.$id}`;
|
const ticketUrl = `${page.url.origin}/init-0/tickets/${data.ticket.$id}`;
|
||||||
const { copied, copy } = createCopy(ticketUrl);
|
const { copied, copy } = createCopy(ticketUrl);
|
||||||
let twitterText = $derived(
|
let twitterText = $derived(
|
||||||
encodeURIComponent(
|
encodeURIComponent(
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { browser, dev } from '$app/environment';
|
import { browser, dev } from '$app/environment';
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { appwriteInit } from '$lib/appwrite/init';
|
import { appwriteInit } from '$lib/appwrite/init';
|
||||||
import { Switch } from '$lib/components';
|
import { Switch } from '$lib/components';
|
||||||
import { loginGithub } from '$routes/init-0/helpers';
|
import { loginGithub } from '$routes/init-0/helpers';
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
export let tribe: string | null = null;
|
export let tribe: string | null = null;
|
||||||
export let showGitHub = true;
|
export let showGitHub = true;
|
||||||
export let variant: TicketVariant = 'default';
|
export let variant: TicketVariant = 'default';
|
||||||
$: ({ ticket } = $page.data as PageData);
|
$: ({ ticket } = page.data as PageData);
|
||||||
|
|
||||||
const variants: TicketVariant[] = ['default', 'pink', 'rainbow'] as const;
|
const variants: TicketVariant[] = ['default', 'pink', 'rainbow'] as const;
|
||||||
</script>
|
</script>
|
||||||
@@ -135,7 +135,7 @@
|
|||||||
Sign in with your Appwrite account and see the magic happen in your ticket.
|
Sign in with your Appwrite account and see the magic happen in your ticket.
|
||||||
</p>
|
</p>
|
||||||
<a
|
<a
|
||||||
href={getAppwriteDashboardUrl(`/login?forceRedirect=${$page.url.origin}/init-0/tickets`)}
|
href={getAppwriteDashboardUrl(`/login?forceRedirect=${page.url.origin}/init-0/tickets`)}
|
||||||
class="web-button is-full-width is-secondary u-margin-block-start-24"
|
class="web-button is-full-width is-secondary u-margin-block-start-24"
|
||||||
>
|
>
|
||||||
<div class="web-icon-appwrite text-primary"></div>
|
<div class="web-icon-appwrite text-primary"></div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { Switch } from '$lib/components';
|
import { Switch } from '$lib/components';
|
||||||
import { createCopy } from '$lib/utils/copy';
|
import { createCopy } from '$lib/utils/copy';
|
||||||
import { loginGithub } from '$routes/init/helpers';
|
import { loginGithub } from '$routes/init/helpers';
|
||||||
@@ -14,9 +14,9 @@
|
|||||||
export let modified = false;
|
export let modified = false;
|
||||||
export let saving = false;
|
export let saving = false;
|
||||||
export let saveTicket: () => void;
|
export let saveTicket: () => void;
|
||||||
let { ticket } = $page.data;
|
let { ticket } = page.data;
|
||||||
|
|
||||||
const ticketUrl = `${$page.url.origin}/init/tickets/${ticket?.$id}`;
|
const ticketUrl = `${page.url.origin}/init/tickets/${ticket?.$id}`;
|
||||||
const shareTextOptions = [
|
const shareTextOptions = [
|
||||||
`Join us during the week of August 19–23 to celebrate everything new with @appwrite. Claim your ticket here 👇 ${ticketUrl}`,
|
`Join us during the week of August 19–23 to celebrate everything new with @appwrite. Claim your ticket here 👇 ${ticketUrl}`,
|
||||||
`Come celebrate everything new with @appwrite from August 19–23! Don't miss out on the latest features and updates. Get your ticket ASAP! 📅 ${ticketUrl}`,
|
`Come celebrate everything new with @appwrite from August 19–23! Don't miss out on the latest features and updates. Get your ticket ASAP! 📅 ${ticketUrl}`,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import FooterNav from '$lib/components/FooterNav.svelte';
|
import FooterNav from '$lib/components/FooterNav.svelte';
|
||||||
import MainFooter from '$lib/components/MainFooter.svelte';
|
import MainFooter from '$lib/components/MainFooter.svelte';
|
||||||
import Main from '$lib/layouts/Main.svelte';
|
import Main from '$lib/layouts/Main.svelte';
|
||||||
@@ -9,9 +9,9 @@
|
|||||||
let { data } = $props();
|
let { data } = $props();
|
||||||
|
|
||||||
let firstName = data.ticket?.name?.split(/\s/)[0] ?? '';
|
let firstName = data.ticket?.name?.split(/\s/)[0] ?? '';
|
||||||
const ogImage = `${$page.url.origin}/init/tickets/${data.ticket.$id}/og`;
|
const ogImage = `${page.url.origin}/init/tickets/${data.ticket.$id}/og`;
|
||||||
|
|
||||||
const { copied, copy } = createCopy($page.url.href);
|
const { copied, copy } = createCopy(page.url.href);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { browser } from '$app/environment';
|
import { browser } from '$app/environment';
|
||||||
import { goto } from '$app/navigation';
|
import { goto } from '$app/navigation';
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { autoHash } from '$lib/actions/autoHash';
|
import { autoHash } from '$lib/actions/autoHash';
|
||||||
import FooterNav from '$lib/components/FooterNav.svelte';
|
import FooterNav from '$lib/components/FooterNav.svelte';
|
||||||
import MainFooter from '$lib/components/MainFooter.svelte';
|
import MainFooter from '$lib/components/MainFooter.svelte';
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
|
|
||||||
let result: ResultType<Integration> = $state([]);
|
let result: ResultType<Integration> = $state([]);
|
||||||
|
|
||||||
let query = $state(decodeURIComponent($page.url.searchParams.get('search') ?? ''));
|
let query = $state(decodeURIComponent(page.url.searchParams.get('search') ?? ''));
|
||||||
let hasQuery = $derived(query.length > 0);
|
let hasQuery = $derived(query.length > 0);
|
||||||
|
|
||||||
// platform filters
|
// platform filters
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { page } from '$app/stores';
|
import { page } from '$app/state';
|
||||||
import { FooterNav, MainFooter } from '$lib/components';
|
import { FooterNav, MainFooter } from '$lib/components';
|
||||||
import { Main } from '$lib/layouts';
|
import { Main } from '$lib/layouts';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
@@ -8,8 +8,8 @@
|
|||||||
let error: string | undefined;
|
let error: string | undefined;
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
const email = $page.url.searchParams.get('email');
|
const email = page.url.searchParams.get('email');
|
||||||
const key = $page.url.searchParams.get('key');
|
const key = page.url.searchParams.get('key');
|
||||||
const response = await fetch(`${PUBLIC_GROWTH_ENDPOINT}/newsletter/verify`, {
|
const response = await fetch(`${PUBLIC_GROWTH_ENDPOINT}/newsletter/verify`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
|||||||
Reference in New Issue
Block a user