Skip to content

Commit

Permalink
Change how aliases appear in Show components
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenClontz committed Oct 10, 2024
1 parent a46006d commit af32134
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
9 changes: 6 additions & 3 deletions packages/viewer/src/components/Properties/Show.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@

<h1>
<Typeset body={property.name} />
{#if property?.aliases}
<Aliases aliases={property.aliases} />
{/if}
</h1>

{#if property.aliases.length > 0}
<h4 class="text-muted lead">
Also known as: <Aliases aliases={property.aliases} />
</h4>
{/if}

<section class="description">
<Typeset body={property.description} />
</section>
Expand Down
17 changes: 6 additions & 11 deletions packages/viewer/src/components/Shared/Aliases.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,9 @@
export let aliases: string[]
</script>

{#if aliases.length > 0}
<small>
<span class="text-muted">or</span>
{#each aliases as alias, i (i)}
<Typeset body={alias} />{#if i !== aliases.length - 1}<span
class="text-muted comma"
>,
</span>{/if}
{/each}
</small>
{/if}
{#each aliases as alias, i (i)}
<Typeset body={alias} />{#if i !== aliases.length - 1}<span
class="comma"
>,
</span>{/if}
{/each}
9 changes: 4 additions & 5 deletions packages/viewer/src/components/Spaces/Show.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@
export let tab: 'properties' | 'theorems' | 'references'
export let rel: string | undefined = undefined
let showMarkdown = false
const tabs = ['properties', 'theorems', 'references'] as const
</script>

<h3>Space <Link.Space {space} content="idLong" /></h3>

<h1>
<Typeset body={space.name} />
{#if space?.aliases}
<Aliases aliases={space.aliases} />
{/if}
</h1>

{#if space.aliases.length > 0}
<h4 class="text-muted lead">Also known as: <Aliases aliases={space.aliases} /></h4>
{/if}

<section class="description">
<Typeset body={space.description} />
</section>
Expand Down

0 comments on commit af32134

Please sign in to comment.