Skip to content

Commit 97b11ce

Browse files
authored
UI changes
1 parent c96fe2d commit 97b11ce

5 files changed

Lines changed: 48 additions & 13 deletions

File tree

packages/viewer/src/components/Properties/Show.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@
1919
const tabs = ['theorems', 'spaces', 'references'] as const
2020
</script>
2121

22-
<h3>Property <Link.Property {property} content="idLong" /></h3>
22+
<h3>
23+
Property <Link.Property {property} content="idLong" />
24+
<LeanLink kind="property" id={property.id} />
25+
</h3>
2326

2427
<h1>
2528
<Typeset body={property.name} />
@@ -39,8 +42,6 @@
3942
<Source source={property.description} internal external />
4043
</section>
4144

42-
<LeanLink kind="property" id={property.id} />
43-
4445
<Tabs {tabs} {tab} {rel} />
4546

4647
{#if tab === 'spaces'}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<svg
2+
width="70"
3+
height="20"
4+
viewBox="0 0 486 169"
5+
xmlns="http://www.w3.org/2000/svg"
6+
stroke="auto"
7+
fill="transparent"
8+
stroke-width="10"
9+
><path
10+
d="M206.333 5.67949H105.667M206.333 5.67949L243.25 84.5M206.333 5.67949V84.5M243.25 84.5H317.549M243.25 84.5L279.667 163.321L280.889 163.318L317.549 84.5M206.333 84.5V163.321H5V5M206.333 84.5H105.667M317.549 84.5L353 5.67949M353 5.67949V164M353 5.67949H353.667L480.333 163.454H481V5"
11+
stroke-linecap="round"
12+
stroke-linejoin="round"
13+
/></svg
14+
>

packages/viewer/src/components/Shared/Icons/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export { default as Branch } from './Branch.svelte'
22
export { default as Check } from './Check.svelte'
33
export { default as Dice } from './Dice.svelte'
4+
export { default as Lean } from './Lean.svelte'
45
export { default as Question } from './Question.svelte'
56
export { default as Repeat } from './Repeat.svelte'
67
export { default as Search } from './Search.svelte'

packages/viewer/src/components/Shared/LeanLink.svelte

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
<script lang="ts">
2424
import { onMount } from 'svelte'
25+
import { Icons } from '@/components/Shared'
2526
2627
export let kind: 'property' | 'theorem'
2728
export let id: number
@@ -43,13 +44,30 @@
4344
</script>
4445

4546
{#if loaded}
46-
<p>
47-
{#if available}
47+
{#if available}
48+
<div>
4849
<a {href} target="_blank" rel="noopener noreferrer">
49-
Formalisation available.
50+
<Icons.Lean />
5051
</a>
51-
{:else}
52-
No formalisation available.
53-
{/if}
54-
</p>
52+
</div>
53+
{/if}
5554
{/if}
55+
56+
<style>
57+
div {
58+
display: inline-block;
59+
border: 1px solid white;
60+
padding: 2px;
61+
}
62+
div:hover {
63+
background: #f6fafe;
64+
border: 1px solid #e0edfb;
65+
border-radius: 5px;
66+
}
67+
a {
68+
padding: 5px;
69+
display: flex;
70+
align-items: center;
71+
justify-content: center;
72+
}
73+
</style>

packages/viewer/src/components/Theorems/Show.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
const tabs = ['converse', 'references'] as const
1212
</script>
1313

14-
<h3>Theorem <Link.Theorem {theorem} content="idLong" /></h3>
14+
<h3>
15+
Theorem <Link.Theorem {theorem} content="idLong" />
16+
<LeanLink kind="theorem" id={theorem.id} />
17+
</h3>
1518

1619
<h1>
1720
<Name {theorem} />
@@ -25,8 +28,6 @@
2528
<Source source={theorem.description} internal external />
2629
</section>
2730

28-
<LeanLink kind="theorem" id={theorem.id} />
29-
3031
<Tabs {tabs} {tab} {rel} />
3132

3233
{#if tab === 'converse'}

0 commit comments

Comments
 (0)