adds trail edit
This commit is contained in:
27
web/src/lib/components/base/toast.svelte
Normal file
27
web/src/lib/components/base/toast.svelte
Normal file
@@ -0,0 +1,27 @@
|
||||
<script lang="ts">
|
||||
import { toast } from "$lib/stores/toast_store";
|
||||
|
||||
$: getBackgroundColor = () => {
|
||||
if ($toast && $toast.type == "success") {
|
||||
return "green-200";
|
||||
}
|
||||
return "";
|
||||
};
|
||||
|
||||
$: getBorderColor = () => {
|
||||
if ($toast && $toast.type == "success") {
|
||||
return "green-500";
|
||||
}
|
||||
return "";
|
||||
};
|
||||
</script>
|
||||
|
||||
{#if $toast}
|
||||
<div
|
||||
class="fixed px-8 py-4 shadow-xl rounded-xl border bottom-4 right-4 bg-{getBackgroundColor()} border-{getBorderColor()}"
|
||||
style="z-index: 1000;"
|
||||
>
|
||||
<i class="fa fa-{$toast.icon} mr-2"></i>
|
||||
<span>{$toast.text}</span>
|
||||
</div>
|
||||
{/if}
|
||||
@@ -12,7 +12,7 @@
|
||||
<a class="font-semibold" href="">Favorites</a>
|
||||
</menu>
|
||||
<div class="flex gap-6 items-center">
|
||||
<a class="btn-primary btn-large" href="/new"><i class="fa fa-plus mr-2"></i>New Trail</a>
|
||||
<a class="btn-primary btn-large" href="/trail/edit/new"><i class="fa fa-plus mr-2"></i>New Trail</a>
|
||||
<Avatar></Avatar>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
const { form, errors, handleChange, handleSubmit } = createForm<SummitLog>({
|
||||
initialValues: $summitLog,
|
||||
validationSchema: summitLogSchema,
|
||||
onSubmit: async (submittedValues) => {
|
||||
onSubmit: async (submittedValues) => {
|
||||
dispatch("save", submittedValues);
|
||||
closeModal!();
|
||||
},
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
<script lang="ts">
|
||||
import type { Trail } from "$lib/models/trail";
|
||||
import { getFileURL } from "$lib/util/file_util";
|
||||
import { formatMeters, formatTimeHHMM } from "$lib/util/format_util";
|
||||
import Dropdown from "../base/dropdown.svelte";
|
||||
|
||||
@@ -14,7 +13,7 @@
|
||||
|
||||
<div class="trail-card rounded-2xl shadow-md w-72 cursor-pointer">
|
||||
<div class="w-full h-48 overflow-hidden rounded-t-2xl">
|
||||
<img src={getFileURL(trail, trail.thumbnail)} alt="" />
|
||||
<img src={trail.thumbnail} alt="" />
|
||||
</div>
|
||||
<div class="p-4">
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user