diff --git a/packages/web/components/patterns/HighlightView.tsx b/packages/web/components/patterns/HighlightView.tsx index e69cda301..e6c5d631d 100644 --- a/packages/web/components/patterns/HighlightView.tsx +++ b/packages/web/components/patterns/HighlightView.tsx @@ -6,9 +6,9 @@ import { styled } from '../tokens/stitches.config' type HighlightViewProps = { highlight: Highlight - scrollToHighlight?: (arg: string) => void; author?: string title?: string + scrollToHighlight?: (arg: string) => void; } export function HighlightView(props: HighlightViewProps): JSX.Element { @@ -16,23 +16,30 @@ export function HighlightView(props: HighlightViewProps): JSX.Element { () => props.highlight.quote.split('\n'), [props.highlight.quote] ) + const annotation = props.highlight.annotation ?? ''; const StyledQuote = styled(Blockquote, { - margin: '0px 0px 24px 0px', - fontSize: '14px', - lineHeight: '1.5', - fontFamily: 'Inter', - color: '$omnivoreGray', + margin: '0px 24px 16px 24px', + fontSize: '18px', + lineHeight: '27px', + color: '$textDefault', cursor: 'pointer', }) - const scrollToHighlight = () => props.scrollToHighlight ? props.scrollToHighlight(props.highlight.id) : null - return ( - - + + {annotation && ( + + {annotation} + ) + } + { + if (props.scrollToHighlight) { + props.scrollToHighlight(props.highlight.id) + } + }}> {props.highlight.prefix} - + {lines.map((line: string, index: number) => ( {line} @@ -47,11 +54,10 @@ export function HighlightView(props: HighlightViewProps): JSX.Element { {props.highlight.suffix} - - {props.author && ( - {props.author} + + {props.author && props.title &&( + {props.title + props.author} )} - {props.title} ) diff --git a/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx b/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx index faad41b5e..37c97210f 100644 --- a/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx +++ b/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx @@ -40,7 +40,7 @@ import { Label } from '../../../lib/networking/fragments/labelFragment' import { isVipUser } from '../../../lib/featureFlag' import { EmptyLibrary } from './EmptyLibrary' import TopBarProgress from 'react-topbar-progress-indicator' -import { State } from '../../../lib/networking/fragments/articleFragment' +import { State, PageType } from '../../../lib/networking/fragments/articleFragment' export type LayoutType = 'LIST_LAYOUT' | 'GRID_LAYOUT' @@ -262,7 +262,8 @@ export function HomeFeedContainer(props: HomeFeedContainerProps): JSX.Element { if (item.node.state === State.PROCESSING) { router.push(`/${username}/links/${item.node.id}`) } else { - router.push(`/${username}/${item.node.slug}`) + const dl = item.node.pageType === PageType.HIGHLIGHTS ? `#${item.node.id}` : '' + router.push(`/${username}/${item.node.slug}` + dl) } } break diff --git a/packages/web/lib/networking/queries/useGetLibraryItemsQuery.tsx b/packages/web/lib/networking/queries/useGetLibraryItemsQuery.tsx index fefa32b22..3cc484de8 100644 --- a/packages/web/lib/networking/queries/useGetLibraryItemsQuery.tsx +++ b/packages/web/lib/networking/queries/useGetLibraryItemsQuery.tsx @@ -85,31 +85,6 @@ export type PageInfo = { totalCount: number } -const libraryItemFragment = gql` - fragment ArticleFields on Article { - id - title - url - author - image - savedAt - createdAt - publishedAt - contentReader - originalArticleUrl - readingProgressPercent - readingProgressAnchorIndex - slug - isArchived - description - linkId - state - labels { - ...LabelFields - } - } -` - export function useGetLibraryItemsQuery({ limit, sortDescending, @@ -197,8 +172,6 @@ export function useGetLibraryItemsQuery({ let responseError = error let responsePages = data as LibraryItemsData[] | undefined - console.log('data', data) - // We need to check the response errors here and return the error // it will be nested in the data pages, if there is one error, // we invalidate the data and return the error. We also zero out @@ -334,8 +307,7 @@ export function useGetLibraryItemsQuery({ } } - - const res = { + return { isValidating, itemsPages: responsePages || undefined, itemsDataError: responseError, @@ -344,8 +316,4 @@ export function useGetLibraryItemsQuery({ size, setSize, } - - console.log('itemsPages', responsePages, 'error:', responseError) - - return res }