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