fix: syntaxes.

This commit is contained in:
ItzNotABug
2024-10-08 13:23:47 +05:30
parent 2fbc38099b
commit cd0f99d124
5 changed files with 20 additions and 17 deletions
@@ -3,14 +3,14 @@
import Id from '$lib/components/id.svelte';
import { WizardStep } from '$lib/layout';
import { sdk } from '$lib/stores/sdk';
import { isSelfHosted } from '$lib/system';
import { isCloud } from '$lib/system';
const { endpoint, project } = sdk.forProject.client.config;
const code = `import io.appwrite.Client
import io.appwrite.services.Account
${
!isSelfHosted
isCloud
? `val client = Client(context).setProject("${project}")`
: `val client = Client(context)
.setEndpoint("${endpoint}")
@@ -1,7 +1,7 @@
<script lang="ts">
import { Alert, Code } from '$lib/components';
import { WizardStep } from '$lib/layout';
import { isSelfHosted } from '$lib/system';
import { isCloud } from '$lib/system';
import { sdk } from '$lib/stores/sdk';
import Id from '$lib/components/id.svelte';
@@ -9,7 +9,7 @@
const code = `import Appwrite
${
!isSelfHosted
isCloud
? `let client = Client().setProject("${project}")`
: `let client = Client()
.setEndpoint("${endpoint}")
@@ -34,7 +34,7 @@ ${
Before sending any API calls to your new Appwrite project, make sure your device or emulator
has network access to your Appwrite project's hostname or IP address.
</p>
{#if showAlert && isSelfHosted}
{#if showAlert && !isCloud}
<div class="common-section">
<Alert type="info" dismissible on:dismiss={() => (showAlert = false)}>
<svelte:fragment slot="title">For self-hosted solutions</svelte:fragment>
@@ -1,7 +1,7 @@
<script lang="ts">
import { Alert, Code } from '$lib/components';
import { WizardStep } from '$lib/layout';
import { isSelfHosted } from '$lib/system';
import { isCloud } from '$lib/system';
import { sdk } from '$lib/stores/sdk';
import Id from '$lib/components/id.svelte';
@@ -10,7 +10,7 @@
Client client = Client();
${
!isSelfHosted
isCloud
? `client.setProject('${project}');`
: `client
.setEndpoint('${endpoint}')
@@ -43,7 +43,7 @@ ${
Before sending any API calls to your new Appwrite project, make sure your device or emulator
has network access to your Appwrite project's hostname or IP address.
</p>
{#if showAlert && isSelfHosted}
{#if showAlert && !isCloud}
<div class="common-section">
<Alert type="info" on:dismiss={() => (showAlert = false)}>
<svelte:fragment slot="title">For self-hosted solutions</svelte:fragment>
@@ -1,7 +1,7 @@
<script lang="ts">
import { Alert, Code } from '$lib/components';
import { WizardStep } from '$lib/layout';
import { isSelfHosted } from '$lib/system';
import { isCloud } from '$lib/system';
import { sdk } from '$lib/stores/sdk';
import { createPlatform } from '../store';
import Id from '$lib/components/id.svelte';
@@ -9,11 +9,15 @@
const { endpoint, project } = sdk.forProject.client.config;
const code = `import { Client, Account, ID } from 'react-native-appwrite';
const client = new Client();
const client
.setEndpoint('${endpoint}')
const client = new Client()${
isCloud
? ''
: `
.setEndpoint('${endpoint}')`
}
.setProject('${project}')
.setPlatform('${$createPlatform.key}');`;
.setPlatform('${$createPlatform.key}');
`;
let showAlert = true;
</script>
@@ -40,7 +44,7 @@ const client
Before sending any API calls to your new Appwrite project, make sure your device or emulator
has network access to your Appwrite project's hostname or IP address.
</p>
{#if showAlert && isSelfHosted}
{#if showAlert && !isCloud}
<div class="common-section">
<Alert type="info" on:dismiss={() => (showAlert = false)}>
<svelte:fragment slot="title">For self-hosted solutions</svelte:fragment>
@@ -3,13 +3,12 @@
import Id from '$lib/components/id.svelte';
import { WizardStep } from '$lib/layout';
import { sdk } from '$lib/stores/sdk';
import { isSelfHosted } from '$lib/system';
import { isCloud } from '$lib/system';
const { endpoint, project } = sdk.forProject.client.config;
const code = `const client = new Client();
${
!isSelfHosted
isCloud
? `client.setProject('${project}');`
: `client
.setEndpoint('${endpoint}')