feat: added edit button to admin mode
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
const { data } = $props();
|
||||
const { space, supabase } = $derived(data);
|
||||
|
||||
let adminMode = $state(true);
|
||||
|
||||
const place = $derived(space.building_location as google.maps.places.PlaceResult);
|
||||
const imgUrls = $derived(
|
||||
space.study_space_images.length === 0
|
||||
@@ -85,7 +87,9 @@
|
||||
{/each}
|
||||
</p>
|
||||
<div class="addrMap" bind:this={mapElem}></div>
|
||||
|
||||
{#if adminMode}
|
||||
<a href={`/space/${space.id}/edit`} class="editButton">Edit</a>
|
||||
{:else}
|
||||
<button
|
||||
type="button"
|
||||
class="reportButton"
|
||||
@@ -93,6 +97,7 @@
|
||||
isReportVisible = true;
|
||||
}}>Report</button
|
||||
>
|
||||
{/if}
|
||||
</main>
|
||||
|
||||
<style>
|
||||
@@ -201,4 +206,18 @@
|
||||
cursor: pointer;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
.editButton {
|
||||
width: 100%;
|
||||
padding: 0.4rem;
|
||||
border-radius: 0.5rem;
|
||||
border: none;
|
||||
background-color: #49bd85;
|
||||
color: #ffffff;
|
||||
font-size: 1rem;
|
||||
cursor: pointer;
|
||||
margin-top: 1rem;
|
||||
text-decoration: none;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user