Skip to content

Commit 5fd92db

Browse files
authored
Display documentation link in item details view (#669)
Signed-off-by: Cintia Sanchez Garcia <[email protected]>
1 parent 1c249e8 commit 5fd92db

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

ui/common/src/components/ItemModalContent.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,12 @@ export const ItemModalContent = (props: Props) => {
429429
</ExternalLink>
430430
</Show>
431431

432+
<Show when={!isUndefined(itemInfo()!.documentation_url)}>
433+
<ExternalLink title="Documenation" class={`ms-3 ${Link}`} href={itemInfo()!.documentation_url!}>
434+
<SVGIcon kind={SVGIconKind.Book} />
435+
</ExternalLink>
436+
</Show>
437+
432438
<Show when={!isUndefined(itemInfo()!.package_manager_url)}>
433439
<ExternalLink
434440
title="Package manager"

ui/common/src/components/SVGIcon.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,21 @@ const Blog = (props: IconProps) => (
7777
</svg>
7878
);
7979

80+
const Book = (props: IconProps) => (
81+
<svg
82+
class={props.class}
83+
stroke="currentColor"
84+
fill="currentColor"
85+
stroke-width="0"
86+
viewBox="0 0 448 512"
87+
height="1em"
88+
width="1em"
89+
xmlns="http://www.w3.org/2000/svg"
90+
>
91+
<path d="M448 360V24c0-13.3-10.7-24-24-24H96C43 0 0 43 0 96v320c0 53 43 96 96 96h328c13.3 0 24-10.7 24-24v-16c0-7.5-3.5-14.3-8.9-18.7-4.2-15.4-4.2-59.3 0-74.7 5.4-4.3 8.9-11.1 8.9-18.6zM128 134c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm0 64c0-3.3 2.7-6 6-6h212c3.3 0 6 2.7 6 6v20c0 3.3-2.7 6-6 6H134c-3.3 0-6-2.7-6-6v-20zm253.4 250H96c-17.7 0-32-14.3-32-32 0-17.6 14.4-32 32-32h285.4c-1.9 17.1-1.9 46.9 0 64z" />
92+
</svg>
93+
);
94+
8095
const Calendar = (props: IconProps) => (
8196
<svg
8297
class={props.class}
@@ -1153,6 +1168,7 @@ const icons: ValidComponent[] = [
11531168
ArrowTop,
11541169
Artwork,
11551170
Blog,
1171+
Book,
11561172
Calendar,
11571173
CaretDown,
11581174
CaretLeft,

ui/common/src/types/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ export interface Item extends BaseItem {
3232
devstats_url?: string;
3333
discord_url?: string;
3434
docker_url?: string;
35+
documentation_url?: string;
3536
enduser?: boolean;
3637
github_discussions_url?: string;
3738
graduated_at?: string;
@@ -162,6 +163,7 @@ export enum SVGIconKind {
162163
ArrowTop,
163164
Artwork,
164165
Blog,
166+
Book,
165167
Calendar,
166168
CaretDown,
167169
CaretLeft,

ui/webapp/src/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export interface Item extends BaseItem {
100100
devstats_url?: string;
101101
discord_url?: string;
102102
docker_url?: string;
103+
documentation_url?: string;
103104
enduser?: boolean;
104105
github_discussions_url?: string;
105106
graduated_at?: string;

0 commit comments

Comments
 (0)