feat: hide favs for admin
This commit is contained in:
@@ -202,8 +202,7 @@
|
||||
<span class="checkReports">
|
||||
<Button href="/space/reports" type="link" style="red">Check Reports</Button>
|
||||
</span>
|
||||
{/if}
|
||||
{#if session}
|
||||
{:else if session}
|
||||
<button class="fav-button" onclick={() => (showFavourites = !showFavourites)} type="button">
|
||||
{showFavourites ? "All spaces" : "My favourites"}
|
||||
</button>
|
||||
@@ -233,7 +232,9 @@
|
||||
imgSrc={imgUrl}
|
||||
space={studySpace}
|
||||
isFavourite={favouriteIds.includes(studySpace.id)}
|
||||
onToggleFavourite={session ? () => handleToggleFavourite(studySpace.id) : undefined}
|
||||
onToggleFavourite={session && !adminMode
|
||||
? () => handleToggleFavourite(studySpace.id)
|
||||
: undefined}
|
||||
isAvailable={studySpace.study_space_hours.length === 0
|
||||
? undefined
|
||||
: isOpenNow(studySpace.study_space_hours).isOpen}
|
||||
|
||||
@@ -116,7 +116,7 @@
|
||||
<main>
|
||||
<div class="imgContainer">
|
||||
{#await supabase.auth.getSession() then resp}
|
||||
{#if resp.data.session}
|
||||
{#if resp.data.session && !adminMode}
|
||||
<div class="title-fav">
|
||||
<Favourite
|
||||
{isFavourite}
|
||||
|
||||
Reference in New Issue
Block a user