adds gpx upload for summit logs
This commit is contained in:
23
web/src/lib/components/base/file_input.svelte
Normal file
23
web/src/lib/components/base/file_input.svelte
Normal file
@@ -0,0 +1,23 @@
|
||||
<script lang="ts">
|
||||
export let label: string = "";
|
||||
export let name: string = "";
|
||||
export let accept: string = "*";
|
||||
|
||||
export let files: FileList | null = null;
|
||||
</script>
|
||||
|
||||
<div>
|
||||
{#if label.length}
|
||||
<label for={name} class="text-sm font-medium pb-1">
|
||||
{label}
|
||||
</label>
|
||||
{/if}
|
||||
<input
|
||||
{name}
|
||||
{accept}
|
||||
bind:files
|
||||
class="cursor-pointer bg-input-background border border-input-border rounded-md p-3 transition-colors focus:border-input-border-focus focus:outline-none focus:ring-0 w-full file:rounded-lg file:px-4 file:py-2 file:border file:border-input-border-focus file:font-medium file:mr-4"
|
||||
type="file"
|
||||
on:change
|
||||
/>
|
||||
</div>
|
||||
@@ -5,6 +5,7 @@
|
||||
export let rows: number = 3;
|
||||
export let label: string = "";
|
||||
export let error: string = "";
|
||||
export let extraClasses: string = "";
|
||||
</script>
|
||||
|
||||
<div>
|
||||
@@ -15,7 +16,7 @@
|
||||
{/if}
|
||||
<textarea
|
||||
{name}
|
||||
class="bg-input-background border border-input-border rounded-md p-3 resize-none transition-colors focus:border-input-border-focus focus:outline-none focus:ring-0 w-full"
|
||||
class="bg-input-background border border-input-border rounded-md p-3 resize-none transition-colors focus:border-input-border-focus focus:outline-none focus:ring-0 w-full {extraClasses}"
|
||||
{rows}
|
||||
{placeholder}
|
||||
class:border-red-400={error.length > 0}
|
||||
|
||||
Reference in New Issue
Block a user