♻️ Refactor and remove React.FC
(#1139)
This commit is contained in:
@@ -7,9 +7,8 @@ import {
|
||||
Stack,
|
||||
useColorMode,
|
||||
} from "@chakra-ui/react"
|
||||
import type React from "react"
|
||||
|
||||
const Appearance: React.FC = () => {
|
||||
const Appearance = () => {
|
||||
const { colorMode, toggleColorMode } = useColorMode()
|
||||
|
||||
return (
|
||||
|
@@ -9,18 +9,17 @@ import {
|
||||
Input,
|
||||
useColorModeValue,
|
||||
} from "@chakra-ui/react"
|
||||
import type React from "react"
|
||||
import { type SubmitHandler, useForm } from "react-hook-form"
|
||||
import { useForm, type SubmitHandler } from "react-hook-form"
|
||||
import { useMutation } from "react-query"
|
||||
|
||||
import { type ApiError, type UpdatePassword, UsersService } from "../../client"
|
||||
import { UsersService, type ApiError, type UpdatePassword } from "../../client"
|
||||
import useCustomToast from "../../hooks/useCustomToast"
|
||||
|
||||
interface UpdatePasswordForm extends UpdatePassword {
|
||||
confirm_password: string
|
||||
}
|
||||
|
||||
const ChangePassword: React.FC = () => {
|
||||
const ChangePassword = () => {
|
||||
const color = useColorModeValue("inherit", "ui.white")
|
||||
const showToast = useCustomToast()
|
||||
const {
|
||||
|
@@ -5,11 +5,10 @@ import {
|
||||
Text,
|
||||
useDisclosure,
|
||||
} from "@chakra-ui/react"
|
||||
import type React from "react"
|
||||
|
||||
import DeleteConfirmation from "./DeleteConfirmation"
|
||||
|
||||
const DeleteAccount: React.FC = () => {
|
||||
const DeleteAccount = () => {
|
||||
const confirmationModal = useDisclosure()
|
||||
|
||||
return (
|
||||
|
@@ -11,7 +11,7 @@ import React from "react"
|
||||
import { useForm } from "react-hook-form"
|
||||
import { useMutation, useQueryClient } from "react-query"
|
||||
|
||||
import { type ApiError, type UserOut, UsersService } from "../../client"
|
||||
import { UsersService, type ApiError, type UserOut } from "../../client"
|
||||
import useAuth from "../../hooks/useAuth"
|
||||
import useCustomToast from "../../hooks/useCustomToast"
|
||||
|
||||
@@ -20,7 +20,7 @@ interface DeleteProps {
|
||||
onClose: () => void
|
||||
}
|
||||
|
||||
const DeleteConfirmation: React.FC<DeleteProps> = ({ isOpen, onClose }) => {
|
||||
const DeleteConfirmation = ({ isOpen, onClose }: DeleteProps) => {
|
||||
const queryClient = useQueryClient()
|
||||
const showToast = useCustomToast()
|
||||
const cancelRef = React.useRef<HTMLButtonElement | null>(null)
|
||||
|
@@ -11,22 +11,21 @@ import {
|
||||
Text,
|
||||
useColorModeValue,
|
||||
} from "@chakra-ui/react"
|
||||
import type React from "react"
|
||||
import { useState } from "react"
|
||||
import { type SubmitHandler, useForm } from "react-hook-form"
|
||||
import { useForm, type SubmitHandler } from "react-hook-form"
|
||||
import { useMutation, useQueryClient } from "react-query"
|
||||
|
||||
import {
|
||||
UsersService,
|
||||
type ApiError,
|
||||
type UserOut,
|
||||
type UserUpdateMe,
|
||||
UsersService,
|
||||
} from "../../client"
|
||||
import useAuth from "../../hooks/useAuth"
|
||||
import useCustomToast from "../../hooks/useCustomToast"
|
||||
import { emailPattern } from "../../utils"
|
||||
|
||||
const UserInformation: React.FC = () => {
|
||||
const UserInformation = () => {
|
||||
const queryClient = useQueryClient()
|
||||
const color = useColorModeValue("inherit", "ui.white")
|
||||
const showToast = useCustomToast()
|
||||
|
Reference in New Issue
Block a user