mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
replace rss with feeds on the settings page
This commit is contained in:
parent
81e54f0be6
commit
a326a5ff95
2 changed files with 21 additions and 21 deletions
|
|
@ -32,7 +32,7 @@ export default function AddRssFeed(): JSX.Element {
|
|||
|
||||
const subscribe = useCallback(async () => {
|
||||
if (!feedUrl) {
|
||||
setErrorMessage('Please enter a valid RSS feed URL')
|
||||
setErrorMessage('Please enter a valid feed URL')
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +41,7 @@ export default function AddRssFeed(): JSX.Element {
|
|||
try {
|
||||
normailizedUrl = new URL(feedUrl).toString()
|
||||
} catch (e) {
|
||||
setErrorMessage('Please enter a valid RSS feed URL')
|
||||
setErrorMessage('Please enter a valid feed URL')
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -54,17 +54,17 @@ export default function AddRssFeed(): JSX.Element {
|
|||
const errorMessage = formatMessage({
|
||||
id: `error.${result.subscribe.errorCodes[0]}`,
|
||||
})
|
||||
setErrorMessage(`There was an error adding new RSS feed: ${errorMessage}`)
|
||||
setErrorMessage(`There was an error adding new feed: ${errorMessage}`)
|
||||
return
|
||||
}
|
||||
|
||||
router.push(`/settings/rss`)
|
||||
showSuccessToast('New RSS feed has been added.')
|
||||
router.push(`/settings/feeds`)
|
||||
showSuccessToast('New feed has been added.')
|
||||
}, [feedUrl, router])
|
||||
|
||||
return (
|
||||
<>
|
||||
<PageMetaData title="Add new RSS Feed" path="/settings/rss/add" />
|
||||
<PageMetaData title="Add new Feed" path="/settings/feeds/add" />
|
||||
<SettingsLayout>
|
||||
<VStack
|
||||
distribution={'start'}
|
||||
|
|
@ -85,14 +85,14 @@ export default function AddRssFeed(): JSX.Element {
|
|||
pr: '$1',
|
||||
}}
|
||||
>
|
||||
<Header>Add new RSS Feed</Header>
|
||||
<Header>Add new Feed</Header>
|
||||
</HStack>
|
||||
|
||||
<FormInput
|
||||
type="url"
|
||||
key="feedUrl"
|
||||
value={feedUrl}
|
||||
placeholder={'Enter the RSS feed URL here'}
|
||||
placeholder={'Enter the feed URL here'}
|
||||
onChange={(e) => {
|
||||
setErrorMessage(undefined)
|
||||
setFeedUrl(e.target.value)
|
||||
|
|
@ -128,7 +128,7 @@ export default function AddRssFeed(): JSX.Element {
|
|||
style="ctaGray"
|
||||
css={{}}
|
||||
onClick={async () => {
|
||||
router.push('/settings/rss')
|
||||
router.push('/settings/feeds')
|
||||
}}
|
||||
>
|
||||
Back
|
||||
|
|
@ -136,7 +136,7 @@ export default function AddRssFeed(): JSX.Element {
|
|||
</HStack>
|
||||
</VStack>
|
||||
</SettingsLayout>
|
||||
<div data-testid="settings-rss-subscribe-page-tag" />
|
||||
<div data-testid="settings-feeds-subscribe-page-tag" />
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,14 +50,14 @@ export default function Rss(): JSX.Element {
|
|||
return
|
||||
}
|
||||
|
||||
showSuccessToast('RSS feed updated', { position: 'bottom-right' })
|
||||
showSuccessToast('Feed updated', { position: 'bottom-right' })
|
||||
revalidate()
|
||||
}
|
||||
|
||||
async function onDelete(id: string): Promise<void> {
|
||||
const result = await unsubscribeMutation('', id)
|
||||
if (result) {
|
||||
showSuccessToast('RSS feed unsubscribed', { position: 'bottom-right' })
|
||||
showSuccessToast('Feed unsubscribed', { position: 'bottom-right' })
|
||||
} else {
|
||||
showErrorToast('Failed to unsubscribe', { position: 'bottom-right' })
|
||||
}
|
||||
|
|
@ -76,7 +76,7 @@ export default function Rss(): JSX.Element {
|
|||
const action = status == 'UNSUBSCRIBED' ? 'pause' : 'resume'
|
||||
|
||||
if (result) {
|
||||
showSuccessToast(`RSS feed ${action}d`, {
|
||||
showSuccessToast(`Feed ${action}d`, {
|
||||
position: 'bottom-right',
|
||||
})
|
||||
} else {
|
||||
|
|
@ -89,17 +89,17 @@ export default function Rss(): JSX.Element {
|
|||
|
||||
return (
|
||||
<SettingsTable
|
||||
pageId={'rss'}
|
||||
pageInfoLink={''} // TODO: https://docs.omnivore.app/integrations/rss.html
|
||||
headerTitle={'Subscribed RSS feeds'}
|
||||
createTitle={'Add RSS feed'}
|
||||
pageId={'feeds'}
|
||||
pageInfoLink={''} // TODO: https://docs.omnivore.app/settings/feeds.html
|
||||
headerTitle={'Subscribed feeds'}
|
||||
createTitle={'Add feed'}
|
||||
createAction={() => {
|
||||
router.push('/settings/rss/add')
|
||||
router.push('/settings/feeds/add')
|
||||
}}
|
||||
>
|
||||
{subscriptions.length === 0 ? (
|
||||
<EmptySettingsRow
|
||||
text={isValidating ? '-' : 'No RSS feeds subscribed'}
|
||||
text={isValidating ? '-' : 'No feeds subscribed'}
|
||||
/>
|
||||
) : (
|
||||
subscriptions.map((subscription, i) => {
|
||||
|
|
@ -219,7 +219,7 @@ export default function Rss(): JSX.Element {
|
|||
{onDeleteId && (
|
||||
<ConfirmationModal
|
||||
message={
|
||||
'RSS feed will be unsubscribed. This action cannot be undone.'
|
||||
'Feed will be unsubscribed. This action cannot be undone.'
|
||||
}
|
||||
onAccept={async () => {
|
||||
await onDelete(onDeleteId)
|
||||
|
|
@ -231,7 +231,7 @@ export default function Rss(): JSX.Element {
|
|||
|
||||
{onPauseId && (
|
||||
<ConfirmationModal
|
||||
message={`RSS feed will be ${
|
||||
message={`Feed will be ${
|
||||
onEditStatus === 'UNSUBSCRIBED' ? 'paused' : 'resumed'
|
||||
}. You can ${
|
||||
onEditStatus === 'UNSUBSCRIBED' ? 'resume' : 'pause'
|
||||
|
|
|
|||
Loading…
Reference in a new issue