refactor: replace 'preact' with 'react' (#1048)

This commit is contained in:
Aman Harwara
2022-05-30 12:42:52 +05:30
committed by GitHub
parent e74b4953ea
commit 8c368dd96b
231 changed files with 4794 additions and 4302 deletions

View File

@@ -1,11 +1,9 @@
import { WebApplication } from '@/UIModels/Application'
import { FeatureStatus } from '@standardnotes/snjs'
import { FunctionComponent } from 'preact'
import { useCallback, useMemo } from 'preact/hooks'
import { JSXInternal } from 'preact/src/jsx'
import { Icon } from '@/Components/Icon/Icon'
import { FunctionComponent, MouseEventHandler, useCallback, useMemo } from 'react'
import Icon from '@/Components/Icon/Icon'
import { usePremiumModal } from '@/Hooks/usePremiumModal'
import { Switch } from '@/Components/Switch/Switch'
import Switch from '@/Components/Switch/Switch'
import { ThemeItem } from './ThemeItem'
type Props = {
@@ -14,7 +12,7 @@ type Props = {
onBlur: (event: { relatedTarget: EventTarget | null }) => void
}
export const ThemesMenuButton: FunctionComponent<Props> = ({ application, item, onBlur }) => {
const ThemesMenuButton: FunctionComponent<Props> = ({ application, item, onBlur }) => {
const premiumModal = usePremiumModal()
const isThirdPartyTheme = useMemo(
@@ -27,7 +25,7 @@ export const ThemesMenuButton: FunctionComponent<Props> = ({ application, item,
)
const canActivateTheme = useMemo(() => isEntitledToTheme || isThirdPartyTheme, [isEntitledToTheme, isThirdPartyTheme])
const toggleTheme: JSXInternal.MouseEventHandler<HTMLButtonElement> = useCallback(
const toggleTheme: MouseEventHandler<HTMLButtonElement> = useCallback(
(e) => {
e.preventDefault()
@@ -79,3 +77,5 @@ export const ThemesMenuButton: FunctionComponent<Props> = ({ application, item,
</button>
)
}
export default ThemesMenuButton