From 0859002c0c677eb5e18230148869a3155334c7a0 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Fri, 25 Mar 2022 13:25:59 -0700 Subject: [PATCH 1/5] Remove next dependencies from the article components This pulls next related deps up into the page instead of the component and allows us to pull next out of the app reader dependency. --- packages/appreader/src/index.jsx | 1 - .../templates/article/ArticleContainer.tsx | 43 +------------------ .../templates/article/HighlightsLayer.tsx | 1 - .../web/pages/[username]/[slug]/index.tsx | 43 +++++++++++++++++-- .../web/pages/app/[username]/[slug]/index.tsx | 1 - 5 files changed, 41 insertions(+), 48 deletions(-) diff --git a/packages/appreader/src/index.jsx b/packages/appreader/src/index.jsx index 0b151f5e6..5453b3cd2 100644 --- a/packages/appreader/src/index.jsx +++ b/packages/appreader/src/index.jsx @@ -33,7 +33,6 @@ const App = () => { className="disable-webkit-callout" > @@ -35,7 +30,6 @@ type ArticleContainerProps = { } export function ArticleContainer(props: ArticleContainerProps): JSX.Element { - const router = useRouter() const [showShareModal, setShowShareModal] = useState(false) const [showLabelsModal, setShowLabelsModal] = useState(false) const [showNotesSidebar, setShowNotesSidebar] = useState(false) @@ -50,28 +44,6 @@ export function ArticleContainer(props: ArticleContainerProps): JSX.Element { await userPersonalizationMutation({ fontSize: newFontSize }) } - useKeyboardShortcuts( - articleKeyboardCommands(router, async (action) => { - switch (action) { - case 'openOriginalArticle': - const url = props.article.url - if (url) { - window.open(url, '_blank') - } - break - case 'incrementFontSize': - await updateFontSize(Math.min(fontSize + 2, 28)) - break - case 'decrementFontSize': - await updateFontSize(Math.max(fontSize - 2, 10)) - break - case 'editLabels': - setShowLabelsModal(true) - break - } - }) - ) - // Listen for font size and color mode change events sent from host apps (ios, macos...) useEffect(() => { const increaseFontSize = async () => { @@ -123,16 +95,6 @@ export function ArticleContainer(props: ArticleContainerProps): JSX.Element { return ( <> - {!props.isAppleAppEmbed && ( - <> -