fix: rename component

This commit is contained in:
Arman
2022-06-29 13:32:57 +02:00
parent cce91dfae8
commit 703896cdfd
9 changed files with 49 additions and 15 deletions
+34
View File
@@ -0,0 +1,34 @@
<script lang="ts">
import { addNotification } from '$lib/stores/notifications';
export let value: string;
let showTooltip = false;
const copy = async () => {
try {
await navigator.clipboard.writeText(value);
showTooltip = true;
setTimeout(() => {
showTooltip = false;
}, 1000);
} catch (error) {
addNotification({
message: error.message,
type: 'error'
});
}
};
</script>
<div class="input-text-wrapper is-with-end-button">
<input {value} type="text" class="input-text" disabled />
<button type="button" class="input-button tooltip" aria-label="Click to copy." on:click={copy}>
<span class="icon-duplicate" aria-hidden="true" />
<div class="tootip">
{#if showTooltip}
<span class="tooltip-popup" style={`display: block`} role="tooltip"> Copied </span>
{/if}
</div>
</button>
</div>
+1 -1
View File
@@ -5,7 +5,7 @@ export { default as CardGrid } from './cardGrid.svelte';
export { default as Tile } from './tile.svelte';
export { default as Tiles } from './tiles.svelte';
export { default as Back } from './back.svelte';
export { default as Copy } from './copy.svelte';
export { default as CopyInput } from './copyInput.svelte';
export { default as UploadBox } from './uploadBox.svelte';
export { default as List } from './list.svelte';
export { default as ListItem } from './listItem.svelte';
@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import { Card, Copy } from '$lib/components';
import { Card, CopyInput } from '$lib/components';
import { Button, Form } from '$lib/elements/forms';
import { sdkForProject } from '$lib/stores/sdk';
import { onMount } from 'svelte';
@@ -45,7 +45,7 @@
<Card>
{#if $doc}
<Form on:submit={updateDocument}>
<Copy value={$doc.$id} />
<CopyInput value={$doc.$id} />
<Document />
<Button submit>Update</Button>
</Form>
@@ -1,5 +1,5 @@
<script lang="ts">
import { Copy, Modal } from '$lib/components';
import { CopyInput, Modal } from '$lib/components';
import { Button, Form, InputTags } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForProject } from '$lib/stores/sdk';
@@ -33,7 +33,7 @@
<Form on:submit={updateFile}>
<Modal bind:show={showUpdate}>
<svelte:fragment slot="header">Update File</svelte:fragment>
<Copy value={file.$id} />
<CopyInput value={file.$id} />
<InputTags
bind:tags={file.$read}
label="Read Access"
@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import { Modal, Copy, Alert } from '$lib/components';
import { Modal, CopyInput, Alert } from '$lib/components';
import {
Button,
InputText,
@@ -79,7 +79,7 @@
</Alert>
<div>
<p>URI</p>
<Copy
<CopyInput
value={`${
sdkForConsole.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import { Modal, Copy, Alert } from '$lib/components';
import { Modal, CopyInput, Alert } from '$lib/components';
import {
Button,
InputPassword,
@@ -78,7 +78,7 @@
</Alert>
<div>
<p>URI</p>
<Copy
<CopyInput
value={`${
sdkForConsole.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import { Modal, Copy, Alert } from '$lib/components';
import { Modal, CopyInput, Alert } from '$lib/components';
import {
Button,
InputPassword,
@@ -69,7 +69,7 @@
</Alert>
<div>
<p>URI</p>
<Copy
<CopyInput
value={`${
sdkForConsole.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import { Modal, Copy, Alert } from '$lib/components';
import { Modal, CopyInput, Alert } from '$lib/components';
import {
Button,
InputPassword,
@@ -78,7 +78,7 @@
</Alert>
<div>
<p>URI</p>
<Copy
<CopyInput
value={`${
sdkForConsole.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />
@@ -1,6 +1,6 @@
<script lang="ts">
import { page } from '$app/stores';
import { Modal, Copy, Alert } from '$lib/components';
import { Modal, CopyInput, Alert } from '$lib/components';
import {
Button,
InputPassword,
@@ -86,7 +86,7 @@
</Alert>
<div>
<p>URI</p>
<Copy
<CopyInput
value={`${
sdkForConsole.config.endpoint
}/account/session/oauth2/callback/${provider.name.toLocaleLowerCase()}/${projectId}`} />