Move the newsletters settings page to settings/emails

This naming makes more sense because emails can also be used
for PDF attachments.
This commit is contained in:
Jackson Harper
2022-02-22 19:38:59 -08:00
parent 610c9c6348
commit 62073290ff
2 changed files with 14 additions and 10 deletions

View File

@ -38,6 +38,11 @@ const moduleExports = {
destination: '/support',
permanent: true,
},
{
source: '/settings/subscriptions/newsletters',
destination: '/settings/emails',
permanent: true,
},
{
source: '/static/icons/default/favicon-dark.ico',
destination: '/favicon-dark.ico',

View File

@ -1,12 +1,11 @@
import { PrimaryLayout } from '../../../components/templates/PrimaryLayout'
import { Button } from '../../../components/elements/Button'
import { useGetNewsletterEmailsQuery } from '../../../lib/networking/queries/useGetNewsletterEmailsQuery'
import { createNewsletterEmailMutation } from '../../../lib/networking/mutations/createNewsletterEmailMutation'
import { CopyLinkIcon } from '../../../components/elements/images/CopyLinkIcon'
import { theme } from '../../../components/tokens/stitches.config'
import { StyledText } from '../../../components/elements/StyledText'
import { Box, HStack, VStack } from '../../../components/elements/LayoutPrimitives'
import { useCopyLink } from '../../../lib/hooks/useCopyLink'
import { PrimaryLayout } from '../../components/templates/PrimaryLayout'
import { Button } from '../../components/elements/Button'
import { useGetNewsletterEmailsQuery } from '../../lib/networking/queries/useGetNewsletterEmailsQuery'
import { createNewsletterEmailMutation } from '../../lib/networking/mutations/createNewsletterEmailMutation'
import { CopyLinkIcon } from '../../components/elements/images/CopyLinkIcon'
import { theme } from '../../components/tokens/stitches.config'
import { Box, HStack, VStack } from '../../components/elements/LayoutPrimitives'
import { useCopyLink } from '../../lib/hooks/useCopyLink'
import { toast, Toaster } from 'react-hot-toast'
import { useCallback } from 'react'
import Link from 'next/link'
@ -36,7 +35,7 @@ function CopyTextButton(props: CopyTextButtonProps): JSX.Element {
)
}
export default function NewsletterEmailsPage(): JSX.Element {
export default function EmailsPage(): JSX.Element {
const { emailAddresses, revalidate, isValidating } = useGetNewsletterEmailsQuery()
async function createEmail(): Promise<void> {