Merge branch 'main' into feat/saved-links

This commit is contained in:
Tom Rogers 2023-09-01 17:43:37 +02:00 committed by GitHub
commit 86544f5610
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 35 additions and 32 deletions

View file

@ -201,10 +201,10 @@ describe('Subscriptions API', () => {
}
}
`
const user2 = await createTestUser('fakeUser2')
const user3 = await createTestUser('fakeUser3')
try {
await createTestSubscription(
user2,
user3,
'sub_other',
undefined,
SubscriptionStatus.Unsubscribed,
@ -222,7 +222,7 @@ describe('Subscriptions API', () => {
}))
)
} finally {
deleteTestUser(user2.id)
deleteTestUser(user3.id)
}
})

View file

@ -142,7 +142,7 @@ const GridImage = (props: GridImageProps): JSX.Element => {
{props.isLoading && (
<LoadingBarOverlay
width="100%"
top={95}
top={145}
bottomRadius={'0px'}
fillColor={'rgba(60, 179, 113, 1)'}
/>
@ -150,7 +150,7 @@ const GridImage = (props: GridImageProps): JSX.Element => {
{(props.readingProgress ?? 0) > 0 && !props.isLoading && (
<ProgressBarOverlay
width="100%"
top={95}
top={145}
value={props.readingProgress ?? 0}
bottomRadius={'0px'}
/>
@ -159,14 +159,14 @@ const GridImage = (props: GridImageProps): JSX.Element => {
<FallbackImage
title={props.title ?? 'Omnivore Fallback'}
width="100%"
height="100px"
height="150px"
fontSize="128px"
/>
) : (
<CoverImage
src={props.src}
width="100%"
height={100}
height="150px"
css={{
bg: '$thBackground',
}}
@ -191,7 +191,7 @@ const LibraryGridCardContent = (props: LinkedItemCardProps): JSX.Element => {
return (
<VStack css={{ p: '0px', m: '0px', width: '100%' }}>
<Box css={{ position: 'relative', width: '100%', height: '100px' }}>
<Box css={{ position: 'relative', width: '100%', height: '150px' }}>
<GridImage
src={props.item.image}
title={props.item.title}
@ -256,7 +256,7 @@ const LibraryGridCardContent = (props: LinkedItemCardProps): JSX.Element => {
<Box
css={{
...TitleStyle,
mt: '10px',
mt: '5px',
}}
>
{props.item.title}
@ -265,7 +265,7 @@ const LibraryGridCardContent = (props: LinkedItemCardProps): JSX.Element => {
css={{
...AuthorInfoStyle,
mt: '5px',
mb: '20px',
mb: '15px',
}}
>
{props.item.author}
@ -276,13 +276,13 @@ const LibraryGridCardContent = (props: LinkedItemCardProps): JSX.Element => {
<HStack
distribution="start"
alignment="start"
css={{ width: '100%', minHeight: '50px', pb: '10px' }}
css={{ width: '100%', minHeight: '50px', pb: '15px' }}
>
<HStack
css={{
display: 'block',
minHeight: '35px',
marginLeft: '-2px', // offset because the chips have margin
marginLeft: '-4px', // offset because the chips have margin
}}
>
{sortedLabels(props.item.labels).map(({ name, color }, index) => (

View file

@ -76,12 +76,6 @@ const readerCommands = () => {
shortcutKeyDescription: 'f',
callback: () => {},
},
{
shortcutKeys: ['escape'],
actionDescription: 'End multi select',
shortcutKeyDescription: 'Escape',
callback: () => {},
},
{
actionDescription: 'Return to library',
shortcutKeys: ['u'],

View file

@ -101,7 +101,8 @@ export const ErrorBox = (props: HelpMessageProps) => {
fontFamily: '$inter',
fontWeight: '500',
color: '$thTextContrast',
padding: '10px',
py: '10px',
px: '15px',
'@smDown': {
width: '100%',
},

View file

@ -938,7 +938,7 @@ function HomeFeedGrid(props: HomeFeedContentProps): JSX.Element {
const { viewerData } = useGetViewerQuery()
const [layout, setLayout] = usePersistedState<LayoutType>({
key: 'libraryLayout',
initialValue: 'GRID_LAYOUT',
initialValue: 'LIST_LAYOUT',
})
const updateLayout = useCallback(

View file

@ -2,7 +2,7 @@ import { ReactNode, useMemo } from 'react'
import { StyledText } from '../../elements/StyledText'
import { Box, HStack, SpanBox, VStack } from '../../elements/LayoutPrimitives'
import { Button } from '../../elements/Button'
import { CaretRight, Circle } from 'phosphor-react'
import { Circle } from 'phosphor-react'
import { useGetSubscriptionsQuery } from '../../../lib/networking/queries/useGetSubscriptionsQuery'
import { useGetLabelsQuery } from '../../../lib/networking/queries/useGetLabelsQuery'
import { Label } from '../../../lib/networking/fragments/labelFragment'
@ -13,9 +13,7 @@ import { usePersistedState } from '../../../lib/hooks/usePersistedState'
import { useGetSavedSearchQuery} from '../../../lib/networking/queries/useGetSavedSearchQuery'
import { SavedSearch } from "../../../lib/networking/fragments/savedSearchFragment"
import { ToggleCaretDownIcon } from '../../elements/icons/ToggleCaretDownIcon'
import { ToggleCaretLeftIcon } from '../../elements/icons/ToggleCaretLeftIcon'
import Link from 'next/link'
import { ArrowRightIcon } from '../../elements/icons/ArrowRightIcon'
import { ToggleCaretRightIcon } from '../../elements/icons/ToggleCaretRightIcon'
export const LIBRARY_LEFT_MENU_WIDTH = '233px'

View file

@ -15,7 +15,9 @@ export function navigationCommands(
shortcutKeys: ['b'],
actionDescription: 'Go back',
shortcutKeyDescription: 'b',
callback: () => router?.back(),
callback: () => {
router?.back()
},
},
]
}

View file

@ -1,6 +1,6 @@
import { gql } from 'graphql-request'
import useSWR from 'swr'
import { publicGqlFetcher } from '../networkHelpers'
import { makeGqlFetcher } from '../networkHelpers'
export type SubscriptionStatus = 'ACTIVE' | 'DELETED' | 'UNSUBSCRIBED'
@ -39,11 +39,12 @@ type SubscriptionsData = {
}
export function useGetSubscriptionsQuery(
type: SubscriptionType | undefined = undefined,
sortBy = 'UPDATED_TIME'
): SubscriptionsQueryResponse {
const query = gql`
query GetSubscriptions {
subscriptions(sort: { by: ${sortBy} }) {
query GetSubscriptions($type: SubscriptionType, $sort: SortParams) {
subscriptions(type: $type, sort: $sort) {
... on SubscriptionsSuccess {
subscriptions {
id
@ -67,7 +68,16 @@ export function useGetSubscriptionsQuery(
}
`
const { data, mutate, isValidating } = useSWR(query, publicGqlFetcher)
const variables = {
type,
sort: {
by: sortBy,
},
}
const { data, mutate, isValidating } = useSWR(
[query, variables],
makeGqlFetcher(variables)
)
try {
if (data) {

View file

@ -79,8 +79,6 @@ export default function Home(): JSX.Element {
})
}, [articleData?.article.article])
useKeyboardShortcuts(navigationCommands(router))
const actionHandler = useCallback(
async (action: string, arg?: unknown) => {
switch (action) {

View file

@ -90,7 +90,7 @@ export default function Rss(): JSX.Element {
return (
<SettingsTable
pageId={'feeds'}
pageInfoLink="https://docs.omnivore.app/settings/feeds.html"
pageInfoLink="https://docs.omnivore.app/using/feeds.html"
headerTitle="Subscribed feeds"
createTitle="Add feed"
createAction={() => {

View file

@ -96,7 +96,7 @@ export default function SubscriptionsPage(): JSX.Element {
})
) : (
<EmptySettingsRow
text={isValidating ? '-' : 'No Email Subscriptions Found'}
text={isValidating ? '-' : 'No Subscriptions Found'}
/>
)}