Merge pull request #195 from omnivore-app/fix/settings-theme

Set theme on emails and labels pages
This commit is contained in:
Jackson Harper
2022-03-07 11:01:40 -08:00
committed by GitHub
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) {