diff --git a/.vscode/settings.json b/.vscode/settings.json index d0e1a8c6d..fb1281f14 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -7,10 +7,5 @@ ["style \\=([^;]*);", "\"([^\"]*)\""], ["style \\=([^;]*);", "\\`([^\\`]*)\\`"] ], - "tailwindCSS.classAttributes": [ - "class", - "className", - "style", - ".*Style" - ] + "tailwindCSS.classAttributes": ["class", "className", "style", ".*Style"] } diff --git a/src/components/DocumentView/BlockContentRef.tsx b/src/components/DocumentView/BlockContentRef.tsx index ca71fc18b..fff986f51 100644 --- a/src/components/DocumentView/BlockContentRef.tsx +++ b/src/components/DocumentView/BlockContentRef.tsx @@ -33,11 +33,15 @@ export async function BlockContentRef(props: BlockProps ); } -async function SpaceRefCard(props: { resolved: ResolvedContentRef } & BlockProps) { +async function SpaceRefCard( + props: { resolved: ResolvedContentRef } & BlockProps, +) { const { context, style, resolved } = props; const spaceId = context.contentRefContext?.space.id; - if (!spaceId) { return null; } + if (!spaceId) { + return null; + } const spaceCustomization = await ignoreAPIError(getSpaceCustomization(spaceId)); const customFavicon = spaceCustomization?.favicon; @@ -46,7 +50,15 @@ async function SpaceRefCard(props: { resolved: ResolvedContentRef } & BlockProps return ( } + leadingIcon={ + + } href={resolved.href} title={resolved.text} style={style} diff --git a/src/components/Header/HeaderLogo.tsx b/src/components/Header/HeaderLogo.tsx index 5904b7644..015912e9f 100644 --- a/src/components/Header/HeaderLogo.tsx +++ b/src/components/Header/HeaderLogo.tsx @@ -100,7 +100,14 @@ function LogoFallback(props: HeaderLogoProps) { const customEmoji = 'emoji' in customization.favicon ? customization.favicon.emoji : undefined; return ( <> - +

, 'sources'>) { +export function LogoIcon( + props: { icon?: CustomizationThemedURL; emoji?: string } & Omit< + React.ComponentProps, + 'sources' + >, +) { const { icon, emoji, alt, ...imageProps } = props; if (emoji && !icon) { return ; } - return {alt; + return ( + {alt + ); } diff --git a/src/lib/references.ts b/src/lib/references.ts index e701b62ec..f0d819fc3 100644 --- a/src/lib/references.ts +++ b/src/lib/references.ts @@ -15,7 +15,6 @@ import { getBlockById, getBlockTitle } from './document'; import { gitbookAppHref, pageHref, PageHrefContext } from './links'; import { getPagePath, resolvePageId } from './pages'; - export interface ResolvedContentRef { /** Text to render in the content ref */ text: string; @@ -165,7 +164,7 @@ export async function resolveContentRef( contentRef.space === space.id ? space : await ignoreAPIError(getSpace(contentRef.space)); - + if (!targetSpace) { return { href: gitbookAppHref(`/s/${contentRef.space}`), @@ -177,7 +176,7 @@ export async function resolveContentRef( return { href: targetSpace.urls.published ?? targetSpace.urls.app, text: targetSpace.title, - active: true + active: true, }; }