Set theme on emails and labels pages

This commit is contained in:
Jackson Harper 2022-03-07 09:47:43 -08:00
parent fcdf8d3dd5
commit 4bafee4da2
2 changed files with 6 additions and 0 deletions

View file

@ -10,6 +10,7 @@ import { toast, Toaster } from 'react-hot-toast'
import { useCallback } from 'react'
import Link from 'next/link'
import { StyledText } from '../../components/elements/StyledText'
import { applyStoredTheme } from '../../lib/themeUpdater'
enum TextType {
EmailAddress,
@ -39,6 +40,8 @@ function CopyTextButton(props: CopyTextButtonProps): JSX.Element {
export default function EmailsPage(): JSX.Element {
const { emailAddresses, revalidate, isValidating } = useGetNewsletterEmailsQuery()
applyStoredTheme(false)
async function createEmail(): Promise<void> {
await createNewsletterEmailMutation()
revalidate()

View file

@ -6,6 +6,7 @@ import { useGetLabelsQuery } from '../../lib/networking/queries/useGetLabelsQuer
import { createLabelMutation } from '../../lib/networking/mutations/createLabelMutation'
import { deleteLabelMutation } from '../../lib/networking/mutations/deleteLabelMutation'
import { useState } from 'react'
import { applyStoredTheme } from '../../lib/themeUpdater'
export default function LabelsPage(): JSX.Element {
const { labels, revalidate, isValidating } = useGetLabelsQuery()
@ -13,6 +14,8 @@ export default function LabelsPage(): JSX.Element {
const [color, setColor] = useState('')
const [description, setDescription] = useState('')
applyStoredTheme(false)
async function createLabel(): Promise<void> {
const res = await createLabelMutation(name, color, description)
if (res) {