|
1 | 1 | <script lang="ts">
|
2 |
| - import { Navbar, Markdown } from '$components'; |
| 2 | + import { Navbar } from '$components'; |
3 | 3 | import { IconCard, RepoCard, PackageCard, CardList } from '$components/card';
|
| 4 | + import { ItemChipList } from '$components/chip'; |
4 | 5 | import Background from '$components/Background.svelte';
|
5 | 6 | import Paper from '$components/Paper.svelte';
|
6 |
| - import EditableMarkdown from '$components/markdown'; |
7 |
| - import api from '$endpoints'; |
| 7 | + import EditableMarkdown from '$components/markdown'; |
| 8 | + import api from '$endpoints'; |
8 | 9 | // import AsciinemaPlayer from "$components";
|
9 | 10 |
|
10 | 11 | export let data: import('./$types').PageData;
|
|
41 | 42 | editable={data.loggedIn}
|
42 | 43 | onSave={text => api().group.withId(data.groupId).item.withId(data.itemId).readme.set(text)}
|
43 | 44 | />
|
44 |
| - <!-- TODO: Display linked items as chips --> |
| 45 | + <!-- Display linked items as chips --> |
| 46 | + <div id="chip-links"> |
| 47 | + {#each itemData.info.links.filter(([l]) => l.style === 'chip') as [linkOptions, linkedItems]} |
| 48 | + <div class="chip-link-row"> |
| 49 | + <h2>{linkOptions.title}</h2> |
| 50 | + <ItemChipList |
| 51 | + globals={data.globals} |
| 52 | + items={[linkedItems.map(i => ({ groupId: linkOptions.groupId, itemId: i, selected: false }))]} |
| 53 | + link={true} |
| 54 | + /> |
| 55 | + </div> |
| 56 | + {/each} |
| 57 | + </div> |
45 | 58 | </div>
|
46 | 59 | </Paper>
|
47 | 60 |
|
48 | 61 | <!-- Display URLs if needed -->
|
49 |
| - <div id="links-list"> |
| 62 | + <div id="urls-list"> |
50 | 63 | <CardList>
|
51 | 64 | {#if itemData.info.urls.site}
|
52 | 65 | <IconCard
|
|
108 | 121 | border-radius: 10px 10px 0 0;
|
109 | 122 | }
|
110 | 123 |
|
111 |
| - /* .association-chip-row { |
| 124 | + .chip-link-row { |
112 | 125 | display: flex;
|
113 | 126 | align-items: baseline;
|
114 | 127 | gap: 5px;
|
115 | 128 | margin: 10px 0;
|
116 | 129 | }
|
117 |
| - .association-chip-row > h3 { |
| 130 | + .chip-link-row > h2 { |
118 | 131 | margin: 0;
|
119 | 132 | height: min-content;
|
120 |
| - } */ |
| 133 | + } |
121 | 134 |
|
122 |
| - #links-list { |
| 135 | + #urls-list { |
123 | 136 | width: 80%;
|
124 | 137 | }
|
125 | 138 |
|
|
0 commit comments