Skip to content

Commit

Permalink
Merge pull request #1470 from appwrite/fix-back-button-tutorials
Browse files Browse the repository at this point in the history
Reinstate the back button on tutorials
  • Loading branch information
ernstmul authored Nov 5, 2024
2 parents 77bf748 + 0e8b068 commit 7731173
Show file tree
Hide file tree
Showing 17 changed files with 43 additions and 4 deletions.
26 changes: 25 additions & 1 deletion src/lib/layouts/DocsTutorial.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { onMount } from 'svelte';
export let toc: Array<TocItem>;
export let back: string;
export let currentStep: number;
export let date: string;
Expand Down Expand Up @@ -44,6 +45,15 @@
<article class="web-article contents">
<header class="web-article-header">
<div class="web-article-header-start web-u-cross-start flex flex-col">
{#if back}
<a
href={back}
class="web-icon-button web-is-only-mobile"
aria-label="previous page"
>
<span class="icon-cheveron-left" aria-hidden="true" />
</a>
{/if}
<ul class="web-metadata web-caption-400">
{#if currentStepItem.difficulty}
<li>{currentStepItem.difficulty}</li>
Expand All @@ -53,7 +63,21 @@
{/if}
</ul>
<div class="u-cross-center relative flex">
<h1 class="web-title">{firstStepItem?.title}</h1>
{#if back}
<a
href={back}
class="
web-button is-text is-only-icon web-u-cross-center
web-is-not-mobile -translate-x-1/2"
aria-label="previous page"
>
<span
class="icon-cheveron-left web-u-font-size-24 web-u-color-text-primary"
aria-hidden="true"
/>
</a>
{/if}
<h1 class="web-title lg:-ml-5">{firstStepItem?.title}</h1>
</div>
</div>
<div class="web-article-header-end" />
Expand Down
4 changes: 3 additions & 1 deletion src/markdoc/layouts/Tutorial.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
draft?: boolean;
difficulty?: string;
readtime?: string;
back: string;
};
</script>

Expand All @@ -25,6 +26,7 @@
export let description: string;
export let step: number;
export let date: string;
export let back: string;
setContext<LayoutContext>('headings', writable({}));
Expand Down Expand Up @@ -76,7 +78,7 @@
<meta name="twitter:card" content="summary_large_image" />
</svelte:head>

<DocsTutorial {toc} {tutorials} {date} currentStep={step}>
<DocsTutorial {toc} {back} {tutorials} {date} currentStep={step}>
<slot />
</DocsTutorial>
<MainFooter variant="docs" />
1 change: 1 addition & 0 deletions src/routes/docs/tutorials/android/step-1/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: tutorial
title: Build an ideas tracker with Android
description: Learn to build an Android app with no backend code using an Appwrite backend.
framework: Android
back: /docs/tutorials
category: Mobile and native
step: 1
---
Expand Down
1 change: 1 addition & 0 deletions src/routes/docs/tutorials/apple/step-1/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: tutorial
title: Coming soon
description: Learn to build an Apple app with no backend code using an Appwrite backend.
framework: Apple
back: /docs/tutorials
category: Mobile and native
step: 1
draft: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Server-side authentication with Astro
description: Add SSR authentication to your Astro app with Appwrite
step: 1
difficulty: beginner
back: /docs/tutorials
readtime: 20
framework: Astro SSR
category: Auth
Expand Down
1 change: 1 addition & 0 deletions src/routes/docs/tutorials/flutter/step-1/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ layout: tutorial
title: Coming soon
description: Learn to build an Flutter app with no backend code using an Appwrite backend.
framework: Flutter
back: /docs/tutorials
category: Mobile and native
step: 1
draft: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Server-side authentication with Next.js
description: Add SSR authentication to your Next.js app with Appwrite
step: 1
difficulty: beginner
back: /docs/tutorials
readtime: 20
framework: Next.js SSR
category: Auth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Server-side authentication with Nuxt
description: Add SSR authentication to your Nuxt app with Appwrite
step: 1
difficulty: beginner
back: /docs/tutorials
draft: true
readtime: 20
framework: Nuxt SSR
Expand Down
2 changes: 1 addition & 1 deletion src/routes/docs/tutorials/nuxt/step-1/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ difficulty: beginner
readtime: 25
framework: Nuxt
category: Web
back: /docs
back: /docs/tutorials
---

**Idea tracker**: an app to track all the side project ideas that you'll start, but probably never finish.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Build an ideas tracker with React Native
description: Learn to build a React Native app with no backend code using an Appwrite backend.
step: 1
difficulty: beginner
back: /docs/tutorials
readtime: 10
category: Mobile and native
framework: React Native
Expand Down
1 change: 1 addition & 0 deletions src/routes/docs/tutorials/react/step-1/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Build an ideas tracker with React
description: Learn to build a React app with no backend code using an Appwrite backend.
step: 1
difficulty: beginner
back: /docs/tutorials
readtime: 10
category: Web
framework: React
Expand Down
1 change: 1 addition & 0 deletions src/routes/docs/tutorials/refine/step-1/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Build a blog admin panel with Refine
description: Learn to build a Refine app with no backend code using an Appwrite backend.
step: 1
difficulty: beginner
back: /docs/tutorials
readtime: 10
framework: Refine
category: Web
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Add app subscriptions with Stripe
description: Add paid app subscription plans to your app with Stripe and Appwrite Functions.
step: 1
difficulty: easy
back: /docs/tutorials
readtime: 10
framework: Stripe
category: Functions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Authentication with SvelteKit
description: Add Authentication to a SvelteKit project using Appwrite.
step: 1
difficulty: beginner
back: /docs/tutorials
readtime: 20
framework: SvelteKit
category: Auth
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Server-side authentication with SvelteKit
description: Add SSR authentication to your SvelteKit app with Appwrite
step: 1
difficulty: beginner
back: /docs/tutorials
readtime: 20
framework: SvelteKit SSR
category: Auth
Expand Down
1 change: 1 addition & 0 deletions src/routes/docs/tutorials/sveltekit/step-1/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: Build an ideas tracker with SvelteKit
description: Build a SvelteKit project using Appwrite.
step: 1
difficulty: beginner
back: /docs/tutorials
readtime: 10
framework: SvelteKit
category: Web
Expand Down
2 changes: 1 addition & 1 deletion src/routes/docs/tutorials/vue/step-1/+page.markdoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layout: tutorial
title: Build an ideas tracker with Vue.js
description: Learn to build an idea tracker app with Appwrite and Vue with authentication, databases and collections, queries, pagination, and file storage.
step: 1
back: /docs
back: /docs/tutorials
framework: Vue
category: Web
---
Expand Down

0 comments on commit 7731173

Please sign in to comment.