Skip to content

Commit 110c47e

Browse files
crthplbriansmiley
authored andcommitted
Make auction page visible to all users and set as default landing page
1 parent 89d0da3 commit 110c47e

3 files changed

Lines changed: 15 additions & 22 deletions

File tree

frontend/src/lib/components/appSideBar.svelte

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,18 +268,17 @@
268268
{/snippet}
269269
</Sidebar.MenuButton>
270270
</Sidebar.MenuItem>
271-
{#if serverState.isAdmin && serverState.sudoEnabled}
272-
<Sidebar.MenuItem>
273-
<Sidebar.MenuButton>
274-
{#snippet child({ props })}
275-
<a href="/auction" {...props} onclick={handleClick}>
276-
<Gavel />
277-
<span class="ml-3">Auction</span>
278-
</a>
279-
{/snippet}
280-
</Sidebar.MenuButton>
281-
</Sidebar.MenuItem>
282-
{/if}
271+
<Sidebar.MenuItem>
272+
<Sidebar.MenuButton>
273+
{#snippet tooltipContent()}Auction{/snippet}
274+
{#snippet child({ props })}
275+
<a href="/auction" {...props} onclick={handleClick}>
276+
<Gavel />
277+
<span class="ml-3">Auction</span>
278+
</a>
279+
{/snippet}
280+
</Sidebar.MenuButton>
281+
</Sidebar.MenuItem>
283282
<Sidebar.MenuItem>
284283
<Sidebar.MenuButton>
285284
{#snippet tooltipContent()}Docs{/snippet}

frontend/src/routes/+page.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { redirect } from '@sveltejs/kit';
22

33
export function load() {
4-
redirect(307, '/market');
4+
redirect(307, '/auction');
55
}

frontend/src/routes/auction/+page.svelte

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
import { goto } from '$app/navigation';
32
import CreateAuction from '$lib/components/forms/createAuction.svelte';
43
import AuctionLink from '$lib/components/auctionLink.svelte';
54
import AuctionModal from '$lib/components/auctionModal.svelte';
@@ -8,13 +7,6 @@
87
98
let selectedAuction: websocket_api.IAuction | null = $state(null);
109
11-
// Redirect to /market unless admin with sudo enabled
12-
$effect(() => {
13-
if (serverState.actingAs !== undefined && !(serverState.isAdmin && serverState.sudoEnabled)) {
14-
goto('/market');
15-
}
16-
});
17-
1810
// Close the modal if the selected auction is deleted
1911
$effect(() => {
2012
if (selectedAuction && !serverState.auctions.has(selectedAuction.id!)) {
@@ -25,7 +17,9 @@
2517

2618
<div class="mr-auto flex flex-col gap-8 pt-8">
2719
<h1 class="text-xl font-bold">Auction</h1>
28-
<CreateAuction />
20+
{#if serverState.isAdmin && serverState.sudoEnabled}
21+
<CreateAuction />
22+
{/if}
2923

3024
<div class="grid grid-cols-1 gap-6 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4">
3125
{#each Array.from(serverState.auctions.values()).sort((a, b) => (a.transactionTimestamp?.seconds ?? 0) - (b.transactionTimestamp?.seconds ?? 0)) as auction}

0 commit comments

Comments
 (0)