Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: platform input tooltips #141

Merged
merged 1 commit into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/lib/elements/forms/inputText.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script lang="ts">
import { tooltip as tooltipAction } from '$lib/actions/tooltip';
import { onMount } from 'svelte';
import { FormItem, Helper } from '.';

Expand All @@ -13,6 +14,7 @@
export let autofocus = false;
export let autocomplete = false;
export let maxlength: number = null;
export let tooltip: string = null;

let element: HTMLInputElement;
let error: string;
Expand Down Expand Up @@ -40,7 +42,17 @@
</script>

<FormItem>
<label class:u-hide={!showLabel} class="label" for={id}>{label}</label>
<label class:u-hide={!showLabel} class="label" for={id}
>{label}
{#if tooltip}
<span
class="icon-info"
aria-hidden="true"
use:tooltipAction={{
content: tooltip
}} />
{/if}
</label>
<div class="input-text-wrapper">
<input
{id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
id="hostname"
label="Package Name"
placeholder="com.company.appname"
tooltip="Your package name is generally the applicationId in your app-level build.gradle file."
required
bind:value={$createPlatform.hostname} />
</FormList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
id="hostname"
label="Bundle ID"
placeholder="com.company.appname"
tooltip="You can find your Bundle Identifier in the General tab for your app's primary target in Xcode."
required
bind:value={$createPlatform.hostname} />
</FormList>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,42 @@
{
name: string;
hostname: string;
tooltip: string;
}
> = {
[Platform.Android]: {
name: 'My Android App',
hostname: 'com.company.appname'
hostname: 'com.company.appname',
tooltip:
"You can find your Bundle Identifier in the General tab for your app's primary target in Xcode."
},
[Platform.Ios]: {
name: 'My iOS App',
hostname: 'com.company.appname'
hostname: 'com.company.appname',
tooltip:
'Your package name is generally the applicationId in your app-level build.gradle file.'
},
[Platform.Linux]: {
name: 'My Linux App',
hostname: 'appname'
hostname: 'appname',
tooltip: 'Your application name'
},
[Platform.Macos]: {
name: 'My mac OS App',
hostname: 'com.company.appname'
hostname: 'com.company.appname',
tooltip:
"You can find your Bundle Identifier in the General tab for your app's primary target in Xcode."
},
[Platform.Web]: {
name: 'My Web App',
hostname: 'com.company.appname'
hostname: 'com.company.appname',
tooltip:
'The hostname that your website will use to interact with the Appwrite APIs in production or development environments. No protocol or port number required.'
},
[Platform.Windows]: {
name: 'My Windows App',
hostname: 'appname'
hostname: 'appname',
tooltip: 'Your application name'
}
};

Expand Down Expand Up @@ -154,6 +165,7 @@
id="hostname"
label={hostname[platform]}
placeholder={placeholder[platform].hostname}
tooltip={placeholder[platform].tooltip}
required
bind:value={$createPlatform.hostname} />
{#if platform === Platform.Web}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
id="hostname"
label="Hostname"
placeholder="localhost"
tooltip="The hostname that your website will use to interact with the Appwrite APIs in production or development environments. No protocol or port number required."
required
bind:value={$createPlatform.hostname} />
<div class="u-flex u-gap-16 u-margin-block-start-8">
Expand Down