fix: remove unused imports and update conditional rendering in PullRequestPage component

This commit is contained in:
Kiril Videlov 2023-11-12 19:38:34 +01:00 committed by Kiril Videlov
parent 94ff6cb3b9
commit 1882b8e736

View File

@ -1,21 +1,18 @@
<script lang="ts">
import type { PageData } from './$types';
import { page } from '$app/stores';
import ProjectHeader from '../../ProjectHeader.svelte';
import PullRequestPreview from './PullRequestPreview.svelte';
export let data: PageData;
let { branchController, pullRequestsState, pullRequestsStore } = data;
let { branchController, pullRequestsStore } = data;
$: pr = $pullRequestsStore?.find((b) => b.number.toString() == $page.params.number);
</script>
<div class="bg-color-3 flex h-full flex-grow flex-col overflow-y-auto overscroll-none">
<div class="flex-grow px-8">
{#if $pullRequestsState?.isLoading}
{#if !$pullRequestsStore}
<p>Loading...</p>
{:else if $pullRequestsState?.isError}
<p>Error...</p>
{:else if pr}
<PullRequestPreview {branchController} pullrequest={pr} />
{:else}