-
Notifications
You must be signed in to change notification settings - Fork 530
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a0bd28
commit 9414437
Showing
5 changed files
with
68 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
packages/shared/src/lib/cloud/patches/CloudPatchSections.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<script lang="ts"> | ||
import DiffSection from '$lib/cloud/patches/DiffSection.svelte'; | ||
import { CloudPatchService } from '$lib/cloud/patches/service'; | ||
import { getContext } from '$lib/context'; | ||
const cloudPatchService = getContext(CloudPatchService); | ||
const optionalPatch = cloudPatchService.patch; | ||
</script> | ||
|
||
{#if $optionalPatch.state === 'uninitialized'} | ||
<p>Loading...</p> | ||
{:else if $optionalPatch.state === 'not-found'} | ||
<p>Failed to find patch</p> | ||
{:else if $optionalPatch.state === 'found'} | ||
{@const patch = $optionalPatch.value} | ||
|
||
<h1 class="text-head-24 padding-bottom">{patch.title}</h1> | ||
|
||
{#each patch.sections as section} | ||
{#if section.sectionType === 'diff'} | ||
<DiffSection diffSection={section} /> | ||
{/if} | ||
{/each} | ||
{/if} | ||
|
||
<style lang="postcss"> | ||
.padding-bottom { | ||
margin-bottom: 16px; | ||
} | ||
.two-by-two { | ||
display: grid; | ||
grid-template-columns: 1fr 1fr; | ||
gap: 8px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<script lang="ts"> | ||
import type { CloudDiffSection } from '$lib/cloud/types'; | ||
interface Props { | ||
diffSection: CloudDiffSection; | ||
} | ||
const { diffSection }: Props = $props(); | ||
</script> | ||
|
||
<div class="card"> | ||
<p class="card__header text-15 text-bold">{diffSection.newPath || diffSection.oldPath}</p> | ||
<div class="card__content no-overflow"> | ||
<pre>{diffSection.diffPatch}</pre> | ||
</div> | ||
</div> | ||
|
||
<style lang="postcss"> | ||
.no-overflow { | ||
overflow: hidden; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters