From 4f2d05d3beb4ecb02f0142b17c15c6eb043e04ce Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Thu, 2 Feb 2023 16:55:23 +0800 Subject: [PATCH] Remove highlightsBaseURL as it is no longer used --- packages/appreader/src/index.jsx | 1 - .../templates/article/ArticleContainer.tsx | 2 -- .../templates/article/HighlightsLayer.tsx | 36 ------------------- .../web/pages/[username]/[slug]/index.tsx | 1 - .../web/pages/app/[username]/[slug]/index.tsx | 1 - 5 files changed, 41 deletions(-) diff --git a/packages/appreader/src/index.jsx b/packages/appreader/src/index.jsx index cd95c928e..e56371e41 100644 --- a/packages/appreader/src/index.jsx +++ b/packages/appreader/src/index.jsx @@ -94,7 +94,6 @@ const App = () => { labels={window.omnivoreArticle.labels} isAppleAppEmbed={true} highlightBarDisabled={!window.enableHighlightBar} - highlightsBaseURL="https://example.com" fontSize={window.fontSize ?? 18} fontFamily={window.fontFamily ?? 'inter'} margin={window.margin} diff --git a/packages/web/components/templates/article/ArticleContainer.tsx b/packages/web/components/templates/article/ArticleContainer.tsx index 33d488b72..31b486e86 100644 --- a/packages/web/components/templates/article/ArticleContainer.tsx +++ b/packages/web/components/templates/article/ArticleContainer.tsx @@ -23,7 +23,6 @@ type ArticleContainerProps = { articleMutations: ArticleMutations isAppleAppEmbed: boolean highlightBarDisabled: boolean - highlightsBaseURL: string margin?: number fontSize?: number fontFamily?: string @@ -378,7 +377,6 @@ export function ArticleContainer(props: ArticleContainerProps): JSX.Element { articleAuthor={props.article.author ?? ''} articleId={props.article.id} isAppleAppEmbed={props.isAppleAppEmbed} - highlightsBaseURL={props.highlightsBaseURL} highlightBarDisabled={props.highlightBarDisabled} showHighlightsModal={props.showHighlightsModal} setShowHighlightsModal={props.setShowHighlightsModal} diff --git a/packages/web/components/templates/article/HighlightsLayer.tsx b/packages/web/components/templates/article/HighlightsLayer.tsx index fc1fbaaff..ac098201b 100644 --- a/packages/web/components/templates/article/HighlightsLayer.tsx +++ b/packages/web/components/templates/article/HighlightsLayer.tsx @@ -36,7 +36,6 @@ type HighlightsLayerProps = { isAppleAppEmbed: boolean highlightBarDisabled: boolean showHighlightsModal: boolean - highlightsBaseURL: string scrollToHighlight: MutableRefObject setShowHighlightsModal: React.Dispatch> articleMutations: ArticleMutations @@ -142,24 +141,6 @@ export function HighlightsLayer(props: HighlightsLayerProps): JSX.Element { [highlights, highlightLocations] ) - const handleNativeShare = useCallback( - (highlightID: string) => { - navigator - ?.share({ - title: props.articleTitle, - url: `${props.highlightsBaseURL}/${highlightID}`, - }) - .then(() => { - setFocusedHighlight(undefined) - }) - .catch((error) => { - console.log(error) - setFocusedHighlight(undefined) - }) - }, - [props.articleTitle, props.highlightsBaseURL] - ) - const openNoteModal = useCallback( (inputs: HighlightActionProps) => { // First try to send a signal to the ios app @@ -615,23 +596,6 @@ export function HighlightsLayer(props: HighlightsLayerProps): JSX.Element { ) } - if ( - highlightModalAction?.highlightModalAction == 'share' && - highlightModalAction.highlight - ) { - return ( - { - setHighlightModalAction({ highlightModalAction: 'none' }) - }} - /> - ) - } - // Display the button bar if we are not in the native app and there // is a focused highlight or selection data if (!props.highlightBarDisabled && (focusedHighlight || selectionData)) { diff --git a/packages/web/pages/[username]/[slug]/index.tsx b/packages/web/pages/[username]/[slug]/index.tsx index eb9647df4..e93610013 100644 --- a/packages/web/pages/[username]/[slug]/index.tsx +++ b/packages/web/pages/[username]/[slug]/index.tsx @@ -339,7 +339,6 @@ export default function Home(): JSX.Element { article={article} isAppleAppEmbed={false} highlightBarDisabled={false} - highlightsBaseURL={`${webBaseURL}/${viewerData.me?.profile?.username}/${slug}/highlights`} fontSize={readerSettings.fontSize} margin={readerSettings.marginWidth} lineHeight={readerSettings.lineHeight} diff --git a/packages/web/pages/app/[username]/[slug]/index.tsx b/packages/web/pages/app/[username]/[slug]/index.tsx index f7498acc4..d69f39f75 100644 --- a/packages/web/pages/app/[username]/[slug]/index.tsx +++ b/packages/web/pages/app/[username]/[slug]/index.tsx @@ -95,7 +95,6 @@ function AppArticleEmbedContent( article={articleData.article.article} isAppleAppEmbed={true} highlightBarDisabled={props.highlightBarDisabled} - highlightsBaseURL={`${webBaseURL}/${props.username}/${props.slug}/highlights`} fontSize={props.fontSize} margin={props.margin} fontFamily={props.fontFamily}