refactor: replace 'preact' with 'react' (#1048)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user