Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cdedreuille committed Jul 19, 2024
1 parent 09c0f43 commit d9ad891
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
5 changes: 3 additions & 2 deletions apps/addon-catalog/app/[...addonName]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { Highlight } from '../../components/highlight';
import { type Database } from '../../types/database.types';
import { createMarkdownProcessor } from '../../lib/create-markdown-processor';
import { AddonSidebar } from '../../components/addon/addon-sidebar';
import type { Author } from '../../types/types';

interface AddonDetailsProps {
params: {
Expand Down Expand Up @@ -48,7 +49,7 @@ export default async function AddonDetails({ params }: AddonDetailsProps) {
.select('*, author (*)')
.eq('addon', addon.id);

const authors = addonAuthors ? addonAuthors.map((a) => a.author) : [];
const authors = addonAuthors?.map((a) => a.author) as unknown as Author[];

const baseLink = `${addon.repository_url ?? addon.npm_url ?? ''}/`;
const processor = createMarkdownProcessor(baseLink);
Expand Down Expand Up @@ -134,7 +135,7 @@ export default async function AddonDetails({ params }: AddonDetailsProps) {
</Highlight>
) : null}
</div>
<AddonSidebar addon={addon} authors={authors} />
<AddonSidebar authors={authors} />
</div>
</main>
);
Expand Down
10 changes: 5 additions & 5 deletions apps/addon-catalog/components/addon/addon-sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
'use client';

import { Pill } from '@repo/ui';
// import { Pill } from '@repo/ui';
import { BookIcon, EditIcon } from '@storybook/icons';
import Image from 'next/image';
import Link from 'next/link';
// import Link from 'next/link';
import { useState } from 'react';
import { url } from 'gravatar';
import type { Addon, Author } from '../../types/types';
import type { Author } from '../../types/types';

export function AddonSidebar({
addon,
// addon,
authors,
}: {
addon: Addon;
// addon: Addon;
authors: Author[];
}) {
const [moreAuthorsVisible, setMoreAuthorsVisible] = useState(false);
Expand Down
5 changes: 5 additions & 0 deletions apps/addon-catalog/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ import type { Database } from './database.types';

export type Addon = Database['public']['Tables']['addons']['Row'];
export type Author = Database['public']['Tables']['authors']['Row'];

export type AddonAuthor = Database['public']['Tables']['addon_author']['Row'];
// export interface AddonAuthorFull extends AddonAuthor {
// author: Author;
// }

0 comments on commit d9ad891

Please sign in to comment.