feat:admin mode display
This commit is contained in:
@@ -202,7 +202,8 @@
|
||||
<span class="checkReports">
|
||||
<Button href="/space/reports" type="link" style="red">Check Reports</Button>
|
||||
</span>
|
||||
{:else if session}
|
||||
{/if}
|
||||
{#if session}
|
||||
<button class="fav-button" onclick={() => (showFavourites = !showFavourites)} type="button">
|
||||
{showFavourites ? "All spaces" : "My favourites"}
|
||||
</button>
|
||||
@@ -232,9 +233,7 @@
|
||||
imgSrc={imgUrl}
|
||||
space={studySpace}
|
||||
isFavourite={favouriteIds.includes(studySpace.id)}
|
||||
onToggleFavourite={session && !adminMode
|
||||
? () => handleToggleFavourite(studySpace.id)
|
||||
: undefined}
|
||||
onToggleFavourite={session ? () => handleToggleFavourite(studySpace.id) : undefined}
|
||||
isAvailable={studySpace.study_space_hours.length === 0
|
||||
? undefined
|
||||
: isOpenNow(studySpace.study_space_hours).isOpen}
|
||||
@@ -257,6 +256,9 @@
|
||||
<Button href="/auth" type="link">Login / Signup</Button>
|
||||
{/if}
|
||||
</footer>
|
||||
{#if adminMode}
|
||||
<div class="adminMode">You are in admin mode</div>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
main {
|
||||
@@ -327,4 +329,24 @@
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.adminMode {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
position: sticky;
|
||||
left: 0;
|
||||
gap: 0.5rem;
|
||||
padding: 0.75rem;
|
||||
font-size: 1rem;
|
||||
background-color: #182125;
|
||||
bottom: 0;
|
||||
border-radius: 0.5rem;
|
||||
box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.1);
|
||||
color: #eaffeb;
|
||||
border: 2px solid #eaffeb;
|
||||
z-index: 1000;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
<main>
|
||||
<div class="imgContainer">
|
||||
{#await supabase.auth.getSession() then resp}
|
||||
{#if resp.data.session && !adminMode}
|
||||
{#if resp.data.session}
|
||||
<div class="title-fav">
|
||||
<Favourite
|
||||
{isFavourite}
|
||||
|
||||
Reference in New Issue
Block a user