Feat/admin mode #42

Merged
al4423 merged 5 commits from feat/admin-mode into master 2025-06-11 18:00:55 +00:00
9 changed files with 355 additions and 43 deletions
Showing only changes of commit 6bae8bb361 - Show all commits

View File

@@ -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,14 +87,17 @@
{/each}
</p>
<div class="addrMap" bind:this={mapElem}></div>
<button
type="button"
class="reportButton"
onclick={() => {
isReportVisible = true;
}}>Report</button
>
{#if adminMode}
<a href={`/space/${space.id}/edit`} class="editButton">Edit</a>
{:else}
<button
type="button"
class="reportButton"
onclick={() => {
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>