From 89d4259a8ebfdc3163df2baf943bc66cca2231e3 Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 22 Nov 2022 12:33:15 +0800 Subject: [PATCH 1/4] Hide google storage URLs and stub URLs on library cards --- .../patterns/LibraryCards/LinkedItemCard.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/packages/web/components/patterns/LibraryCards/LinkedItemCard.tsx b/packages/web/components/patterns/LibraryCards/LinkedItemCard.tsx index a163e4f98..71d42747c 100644 --- a/packages/web/components/patterns/LibraryCards/LinkedItemCard.tsx +++ b/packages/web/components/patterns/LibraryCards/LinkedItemCard.tsx @@ -4,7 +4,19 @@ import type { LinkedItemCardProps } from './CardTypes' import { HighlightItemCard } from './HighlightItemCard' import { PageType } from '../../../lib/networking/fragments/articleFragment' +const shouldHideUrl = (url: string): boolean => { + const origin = new URL(url).origin + const hideHosts = ['https://storage.googleapis.com', 'https://omnivore.app'] + if (hideHosts.indexOf(origin) != -1) { + return true + } + return false +} + const siteName = (originalArticleUrl: string, itemUrl: string): string => { + if (shouldHideUrl(originalArticleUrl)) { + return '' + } try { return new URL(originalArticleUrl).hostname.replace(/^www\./, '') } catch {} From 3c6526cf8bdeb9555006a05ed158e4a09d12b2ad Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 22 Nov 2022 12:41:56 +0800 Subject: [PATCH 2/4] Set the width of the drop container to 100% so it doesn't compress the list view --- .../web/components/templates/homeFeed/HomeFeedContainer.tsx | 3 ++- packages/web/components/templates/library/LibraryList.tsx | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx b/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx index 9c53341a6..e5811ab1d 100644 --- a/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx +++ b/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx @@ -908,7 +908,8 @@ function HomeFeedGrid(props: HomeFeedContentProps): JSX.Element { fontSize: '$4', }} > - Drop PDF document here to add to your library + Drag PDF document to this area to upload and add to your + library )} diff --git a/packages/web/components/templates/library/LibraryList.tsx b/packages/web/components/templates/library/LibraryList.tsx index b701c34b5..ebea7d71a 100644 --- a/packages/web/components/templates/library/LibraryList.tsx +++ b/packages/web/components/templates/library/LibraryList.tsx @@ -97,7 +97,10 @@ export function LibraryList(props: LibraryListProps): JSX.Element { noDragEventsBubbling={true} > {({ getRootProps, getInputProps, acceptedFiles, fileRejections }) => ( - + Date: Tue, 22 Nov 2022 13:00:37 +0800 Subject: [PATCH 3/4] Put the drag and drop style in a container so it can be centred --- .../templates/homeFeed/HomeFeedContainer.tsx | 110 ++++++++++-------- 1 file changed, 63 insertions(+), 47 deletions(-) diff --git a/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx b/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx index e5811ab1d..f3eb9a768 100644 --- a/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx +++ b/packages/web/components/templates/homeFeed/HomeFeedContainer.tsx @@ -695,18 +695,31 @@ function HomeFeedGrid(props: HomeFeedContentProps): JSX.Element { }, }) - const DragnDropStyle = styled('div', { - border: '3px dashed gray', - backgroundColor: 'aliceblue', - borderRadius: '5px', - width: '95%', + const DragnDropContainer = styled('div', { + width: '100%', height: '80%', position: 'absolute', - opacity: '0.9', display: 'flex', justifyContent: 'center', alignItems: 'center', zIndex: '1', + alignSelf: 'center', + left: 0, + }) + + const DragnDropStyle = styled('div', { + border: '3px dashed gray', + backgroundColor: 'aliceblue', + borderRadius: '5px', + width: '100%', + height: '100%', + opacity: '0.9', + display: 'flex', + justifyContent: 'center', + alignItems: 'center', + alignSelf: 'center', + left: 0, + margin: '16px', }) const removeItem = () => { @@ -900,50 +913,53 @@ function HomeFeedGrid(props: HomeFeedContentProps): JSX.Element { {({ getRootProps, getInputProps, acceptedFiles, fileRejections }) => (
{inDragOperation && uploadingFiles.length < 1 && ( - - - Drag PDF document to this area to upload and add to your - library - - - )} - {uploadingFiles.length > 0 && ( - - - - - - + + - Uploading file - - - + Drop PDF document to to upload and add to your library + + + + )} + {uploadingFiles.length > 0 && ( + + + + + + + + Uploading file + + + + )} {!props.isValidating && props.items.length == 0 ? ( From 9183319ba5c3cba263ac9cbe7118df900ff7201e Mon Sep 17 00:00:00 2001 From: Jackson Harper Date: Tue, 22 Nov 2022 13:01:30 +0800 Subject: [PATCH 4/4] Update dependencies --- yarn.lock | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index b98128878..a09d9b65a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4853,6 +4853,13 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-compose-refs@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.0.tgz#37595b1f16ec7f228d698590e78eeed18ff218ae" + integrity sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-context@0.1.1": version "0.1.1" resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-0.1.1.tgz#06996829ea124d9a1bc1dbe3e51f33588fab0875" @@ -4860,6 +4867,13 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-context@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-1.0.0.tgz#f38e30c5859a9fb5e9aa9a9da452ee3ed9e0aee0" + integrity sha512-1pVM9RfOQ+n/N5PJK33kRSKsr1glNxomxONs5c49MliinBY6Yw2Q995qfBUUo0/Mbg05B/sGA0gkgPI7kmSHBg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-dialog@^0.1.1": version "0.1.7" resolved "https://registry.yarnpkg.com/@radix-ui/react-dialog/-/react-dialog-0.1.7.tgz#285414cf66f5bbf42bc9935314e0381abe01e7d0" @@ -5038,6 +5052,23 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-slot" "0.1.2" +"@radix-ui/react-primitive@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-1.0.1.tgz#c1ebcce283dd2f02e4fbefdaa49d1cb13dbc990a" + integrity sha512-fHbmislWVkZaIdeF6GZxF0A/NH/3BjrGIYj+Ae6eTmTCr7EB0RQAAVEiqsXK6p3/JcRqVSBQoceZroj30Jj3XA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-slot" "1.0.1" + +"@radix-ui/react-progress@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-progress/-/react-progress-1.0.1.tgz#49ec2f729a67ba3b580a90356fc1d871466a4212" + integrity sha512-QbDf9eguM5QtkvGcGHe/nUgloM9yfRGpJTB/Te5cn4WmVHvcbhHyHw39/rbCZxNX4E+GEPp5Vs6+mEoyIotUbg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-context" "1.0.0" + "@radix-ui/react-primitive" "1.0.1" + "@radix-ui/react-roving-focus@0.1.5": version "0.1.5" resolved "https://registry.yarnpkg.com/@radix-ui/react-roving-focus/-/react-roving-focus-0.1.5.tgz#cc48d17a36b56f253d54905b0fd60ee134cb97ee" @@ -5069,6 +5100,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-compose-refs" "0.1.0" +"@radix-ui/react-slot@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-slot/-/react-slot-1.0.1.tgz#e7868c669c974d649070e9ecbec0b367ee0b4d81" + integrity sha512-avutXAFL1ehGvAXtPquu0YK5oz6ctS474iM3vNGQIkswrVhdrS52e3uoMQBzZhNRAIE0jBnUyXWNmSjGHhCFcw== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "1.0.0" + "@radix-ui/react-tooltip@^0.1.7": version "0.1.7" resolved "https://registry.yarnpkg.com/@radix-ui/react-tooltip/-/react-tooltip-0.1.7.tgz#6f8c00d6e489565d14abf209ce0fb8853c8c8ee3" @@ -5172,11 +5211,6 @@ dependencies: "@babel/runtime" "^7.13.10" -"@ramonak/react-progress-bar@^5.0.3": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@ramonak/react-progress-bar/-/react-progress-bar-5.0.3.tgz#a3518fb19e6650e593a208dd429dca7cb6b63d52" - integrity sha512-VxXGKN74q94jYoeYuFNJm3xvWhVz9dy+alFZ8S4ZmTTr/05CCq9PjwthT8JB27UdAvn8pHvKBmemV8JU2cZi6A== - "@reach/observe-rect@^1.1.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@reach/observe-rect/-/observe-rect-1.2.0.tgz#d7a6013b8aafcc64c778a0ccb83355a11204d3b2"