File tree Expand file tree Collapse file tree 1 file changed +26
-13
lines changed
app/pages/package/[[org]] Expand file tree Collapse file tree 1 file changed +26
-13
lines changed Original file line number Diff line number Diff line change @@ -63,20 +63,33 @@ const { data: readmeData } = useLazyFetch<ReadmeResponse>(
6363 },
6464)
6565
66- const playgroundLinks = computed (() => [
67- ... readmeData .value .playgroundLinks ,
66+ const playgroundLinks = computed (() => {
67+ const links = [... readmeData .value .playgroundLinks ]
68+
69+ const packageData = pkg .value
70+ if (! packageData ) {
71+ return links
72+ }
73+
6874 // Libraries with a storybook field in package.json contain a link to their deployed playground
69- ... (pkg .value ?.storybook ?.url
70- ? [
71- {
72- url: pkg .value .storybook .url ,
73- provider: ' storybook' ,
74- providerName: ' Storybook' ,
75- label: ' Storybook' ,
76- },
77- ]
78- : []),
79- ])
75+ if (packageData .storybook ?.url ) {
76+ links .push ({
77+ url: packageData .storybook .url ,
78+ provider: ' storybook' ,
79+ providerName: ' Storybook' ,
80+ label: ' Storybook' ,
81+ })
82+ }
83+
84+ links .push ({
85+ url: ` https://npmjs.dev/${packageData .name } ` ,
86+ provider: ' npmjs.dev' ,
87+ providerName: ' npmjs.dev' ,
88+ label: ' npmjs.dev' ,
89+ })
90+
91+ return links
92+ })
8093
8194const {
8295 data : readmeMarkdownData,
You can’t perform that action at this time.
0 commit comments