-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
per report [here](https://github.com/orgs/pi-base/discussions/464#discussioncomment-7560692)
- Loading branch information
1 parent
57d30ee
commit d5e6a69
Showing
4 changed files
with
55 additions
and
64 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export { default as Proof } from './Proof.svelte' | ||
export { default as Related } from './Related.svelte' | ||
export { default as Show } from './Show.svelte' | ||
export { default as Table } from './Table.svelte' | ||
export { default as Value } from './Value.svelte' |
35 changes: 32 additions & 3 deletions
35
packages/viewer/src/routes/(app)/spaces/[id]/properties/[propertyId]/+page.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 |
---|---|---|
@@ -1,6 +1,35 @@ | ||
<script lang="ts"> | ||
import { page } from '$app/stores' | ||
import { Show } from '@/components/Traits' | ||
import { | ||
Icons, | ||
Link, | ||
References, | ||
Title, | ||
Typeset | ||
} from '@/components/Shared' | ||
import { Proof } from '@/components/Traits' | ||
import type { PageData } from './$types' | ||
export let data: PageData | ||
</script> | ||
|
||
<Show spaceId={$page.params.id} propertyId={$page.params.propertyId} /> | ||
<Title title={`${data.space.name}: ${data.property.name}`} /> | ||
|
||
<h1> | ||
{#if data.proof} | ||
<Icons.Robot /> | ||
{/if} | ||
<Link.Space space={data.space} /> | ||
is | ||
{data.trait.value ? '' : 'not'} | ||
<Link.Property property={data.property} /> | ||
</h1> | ||
|
||
{#if data.proof} | ||
<Proof space={data.space} {...data.proof} /> | ||
{:else if data.meta} | ||
<section class="description"> | ||
<Typeset body={data.meta.description} /> | ||
</section> | ||
<h3>References</h3> | ||
<References references={data.meta.refs} /> | ||
{/if} |
22 changes: 22 additions & 0 deletions
22
packages/viewer/src/routes/(app)/spaces/[id]/properties/[propertyId]/+page.ts
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 @@ | ||
import { get } from 'svelte/store' | ||
import { error } from '@sveltejs/kit' | ||
|
||
import type { PageLoad } from './$types' | ||
|
||
export const load: PageLoad = async function ({ params: { id: spaceId, propertyId }, parent }) { | ||
const { load, spaces, properties, theorems, traits, checked } = await parent() | ||
|
||
return load( | ||
traits, | ||
ts => ts.lookup({ | ||
spaceId, | ||
propertyId, | ||
spaces: get(spaces), | ||
properties: get(properties), | ||
theorems: get(theorems), | ||
}), | ||
checked(spaceId) | ||
).catch(() => { | ||
throw(error(404, `Trait not found ${spaceId} / ${propertyId}`)) | ||
}) | ||
} |