🔧 Configure path alias for cleaner imports (#1497)
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
||||||
import { Controller, type SubmitHandler, useForm } from "react-hook-form"
|
import { Controller, type SubmitHandler, useForm } from "react-hook-form"
|
||||||
|
|
||||||
|
import { type UserCreate, UsersService } from "@/client"
|
||||||
|
import type { ApiError } from "@/client/core/ApiError"
|
||||||
|
import useCustomToast from "@/hooks/useCustomToast"
|
||||||
|
import { emailPattern, handleError } from "@/utils"
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
DialogActionTrigger,
|
DialogActionTrigger,
|
||||||
@@ -12,10 +16,6 @@ import {
|
|||||||
} from "@chakra-ui/react"
|
} from "@chakra-ui/react"
|
||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
import { FaPlus } from "react-icons/fa"
|
import { FaPlus } from "react-icons/fa"
|
||||||
import { type UserCreate, UsersService } from "../../client"
|
|
||||||
import type { ApiError } from "../../client/core/ApiError"
|
|
||||||
import useCustomToast from "../../hooks/useCustomToast"
|
|
||||||
import { emailPattern, handleError } from "../../utils"
|
|
||||||
import { Checkbox } from "../ui/checkbox"
|
import { Checkbox } from "../ui/checkbox"
|
||||||
import {
|
import {
|
||||||
DialogBody,
|
DialogBody,
|
||||||
|
@@ -3,7 +3,8 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"
|
|||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
import { useForm } from "react-hook-form"
|
import { useForm } from "react-hook-form"
|
||||||
import { FiTrash2 } from "react-icons/fi"
|
import { FiTrash2 } from "react-icons/fi"
|
||||||
import { UsersService } from "../../client"
|
|
||||||
|
import { UsersService } from "@/client"
|
||||||
import {
|
import {
|
||||||
DialogActionTrigger,
|
DialogActionTrigger,
|
||||||
DialogBody,
|
DialogBody,
|
||||||
@@ -13,8 +14,8 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogRoot,
|
DialogRoot,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from "../../components/ui/dialog"
|
} from "@/components/ui/dialog"
|
||||||
import useCustomToast from "../../hooks/useCustomToast"
|
import useCustomToast from "@/hooks/useCustomToast"
|
||||||
|
|
||||||
const DeleteUser = ({ id }: { id: string }) => {
|
const DeleteUser = ({ id }: { id: string }) => {
|
||||||
const [isOpen, setIsOpen] = useState(false)
|
const [isOpen, setIsOpen] = useState(false)
|
||||||
|
@@ -13,10 +13,11 @@ import {
|
|||||||
} from "@chakra-ui/react"
|
} from "@chakra-ui/react"
|
||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
import { FaExchangeAlt } from "react-icons/fa"
|
import { FaExchangeAlt } from "react-icons/fa"
|
||||||
import { type UserPublic, type UserUpdate, UsersService } from "../../client"
|
|
||||||
import type { ApiError } from "../../client/core/ApiError"
|
import { type UserPublic, type UserUpdate, UsersService } from "@/client"
|
||||||
import useCustomToast from "../../hooks/useCustomToast"
|
import type { ApiError } from "@/client/core/ApiError"
|
||||||
import { emailPattern, handleError } from "../../utils"
|
import useCustomToast from "@/hooks/useCustomToast"
|
||||||
|
import { emailPattern, handleError } from "@/utils"
|
||||||
import { Checkbox } from "../ui/checkbox"
|
import { Checkbox } from "../ui/checkbox"
|
||||||
import {
|
import {
|
||||||
DialogBody,
|
DialogBody,
|
||||||
|
@@ -2,7 +2,7 @@ import { IconButton } from "@chakra-ui/react"
|
|||||||
import { BsThreeDotsVertical } from "react-icons/bs"
|
import { BsThreeDotsVertical } from "react-icons/bs"
|
||||||
import { MenuContent, MenuRoot, MenuTrigger } from "../ui/menu"
|
import { MenuContent, MenuRoot, MenuTrigger } from "../ui/menu"
|
||||||
|
|
||||||
import type { ItemPublic } from "../../client"
|
import type { ItemPublic } from "@/client"
|
||||||
import DeleteItem from "../Items/DeleteItem"
|
import DeleteItem from "../Items/DeleteItem"
|
||||||
import EditItem from "../Items/EditItem"
|
import EditItem from "../Items/EditItem"
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
import { Flex, Image, useBreakpointValue } from "@chakra-ui/react"
|
import { Flex, Image, useBreakpointValue } from "@chakra-ui/react"
|
||||||
import { Link } from "@tanstack/react-router"
|
import { Link } from "@tanstack/react-router"
|
||||||
|
|
||||||
import Logo from "/assets/images/fastapi-logo.svg"
|
import Logo from "/assets/images/fastapi-logo.svg"
|
||||||
import UserMenu from "./UserMenu"
|
import UserMenu from "./UserMenu"
|
||||||
|
|
||||||
|
@@ -2,10 +2,10 @@ import { Box, Flex, IconButton, Text } from "@chakra-ui/react"
|
|||||||
import { useQueryClient } from "@tanstack/react-query"
|
import { useQueryClient } from "@tanstack/react-query"
|
||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
import { FaBars } from "react-icons/fa"
|
import { FaBars } from "react-icons/fa"
|
||||||
|
|
||||||
import { FiLogOut } from "react-icons/fi"
|
import { FiLogOut } from "react-icons/fi"
|
||||||
import type { UserPublic } from "../../client"
|
|
||||||
import useAuth from "../../hooks/useAuth"
|
import type { UserPublic } from "@/client"
|
||||||
|
import useAuth from "@/hooks/useAuth"
|
||||||
import {
|
import {
|
||||||
DrawerBackdrop,
|
DrawerBackdrop,
|
||||||
DrawerBody,
|
DrawerBody,
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
import { Box, Flex, Icon, Text } from "@chakra-ui/react"
|
import { Box, Flex, Icon, Text } from "@chakra-ui/react"
|
||||||
import { useQueryClient } from "@tanstack/react-query"
|
import { useQueryClient } from "@tanstack/react-query"
|
||||||
import { Link as RouterLink } from "@tanstack/react-router"
|
import { Link as RouterLink } from "@tanstack/react-router"
|
||||||
|
|
||||||
import { FiBriefcase, FiHome, FiSettings, FiUsers } from "react-icons/fi"
|
import { FiBriefcase, FiHome, FiSettings, FiUsers } from "react-icons/fi"
|
||||||
import type { IconType } from "react-icons/lib"
|
import type { IconType } from "react-icons/lib"
|
||||||
import type { UserPublic } from "../../client"
|
|
||||||
|
import type { UserPublic } from "@/client"
|
||||||
|
|
||||||
const items = [
|
const items = [
|
||||||
{ icon: FiHome, title: "Dashboard", path: "/" },
|
{ icon: FiHome, title: "Dashboard", path: "/" },
|
||||||
|
@@ -2,7 +2,7 @@ import { IconButton } from "@chakra-ui/react"
|
|||||||
import { BsThreeDotsVertical } from "react-icons/bs"
|
import { BsThreeDotsVertical } from "react-icons/bs"
|
||||||
import { MenuContent, MenuRoot, MenuTrigger } from "../ui/menu"
|
import { MenuContent, MenuRoot, MenuTrigger } from "../ui/menu"
|
||||||
|
|
||||||
import type { UserPublic } from "../../client"
|
import type { UserPublic } from "@/client"
|
||||||
import DeleteUser from "../Admin/DeleteUser"
|
import DeleteUser from "../Admin/DeleteUser"
|
||||||
import EditUser from "../Admin/EditUser"
|
import EditUser from "../Admin/EditUser"
|
||||||
|
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import { Box, Button, Flex, Text } from "@chakra-ui/react"
|
import { Box, Button, Flex, Text } from "@chakra-ui/react"
|
||||||
import { Link } from "@tanstack/react-router"
|
import { Link } from "@tanstack/react-router"
|
||||||
import { FaUserAstronaut } from "react-icons/fa"
|
import { FaUserAstronaut } from "react-icons/fa"
|
||||||
|
|
||||||
import { FiLogOut, FiUser } from "react-icons/fi"
|
import { FiLogOut, FiUser } from "react-icons/fi"
|
||||||
import useAuth from "../../hooks/useAuth"
|
|
||||||
|
import useAuth from "@/hooks/useAuth"
|
||||||
import { MenuContent, MenuItem, MenuRoot, MenuTrigger } from "../ui/menu"
|
import { MenuContent, MenuItem, MenuRoot, MenuTrigger } from "../ui/menu"
|
||||||
|
|
||||||
const UserMenu = () => {
|
const UserMenu = () => {
|
||||||
|
@@ -11,10 +11,11 @@ import {
|
|||||||
} from "@chakra-ui/react"
|
} from "@chakra-ui/react"
|
||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
import { FaPlus } from "react-icons/fa"
|
import { FaPlus } from "react-icons/fa"
|
||||||
import { type ItemCreate, ItemsService } from "../../client"
|
|
||||||
import type { ApiError } from "../../client/core/ApiError"
|
import { type ItemCreate, ItemsService } from "@/client"
|
||||||
import useCustomToast from "../../hooks/useCustomToast"
|
import type { ApiError } from "@/client/core/ApiError"
|
||||||
import { handleError } from "../../utils"
|
import useCustomToast from "@/hooks/useCustomToast"
|
||||||
|
import { handleError } from "@/utils"
|
||||||
import {
|
import {
|
||||||
DialogBody,
|
DialogBody,
|
||||||
DialogCloseTrigger,
|
DialogCloseTrigger,
|
||||||
|
@@ -3,7 +3,8 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"
|
|||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
import { useForm } from "react-hook-form"
|
import { useForm } from "react-hook-form"
|
||||||
import { FiTrash2 } from "react-icons/fi"
|
import { FiTrash2 } from "react-icons/fi"
|
||||||
import { ItemsService } from "../../client"
|
|
||||||
|
import { ItemsService } from "@/client"
|
||||||
import {
|
import {
|
||||||
DialogActionTrigger,
|
DialogActionTrigger,
|
||||||
DialogBody,
|
DialogBody,
|
||||||
@@ -13,8 +14,8 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogRoot,
|
DialogRoot,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from "../../components/ui/dialog"
|
} from "@/components/ui/dialog"
|
||||||
import useCustomToast from "../../hooks/useCustomToast"
|
import useCustomToast from "@/hooks/useCustomToast"
|
||||||
|
|
||||||
const DeleteItem = ({ id }: { id: string }) => {
|
const DeleteItem = ({ id }: { id: string }) => {
|
||||||
const [isOpen, setIsOpen] = useState(false)
|
const [isOpen, setIsOpen] = useState(false)
|
||||||
|
@@ -10,9 +10,10 @@ import { useMutation, useQueryClient } from "@tanstack/react-query"
|
|||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
import { type SubmitHandler, useForm } from "react-hook-form"
|
import { type SubmitHandler, useForm } from "react-hook-form"
|
||||||
import { FaExchangeAlt } from "react-icons/fa"
|
import { FaExchangeAlt } from "react-icons/fa"
|
||||||
import { type ApiError, type ItemPublic, ItemsService } from "../../client"
|
|
||||||
import useCustomToast from "../../hooks/useCustomToast"
|
import { type ApiError, type ItemPublic, ItemsService } from "@/client"
|
||||||
import { handleError } from "../../utils"
|
import useCustomToast from "@/hooks/useCustomToast"
|
||||||
|
import { handleError } from "@/utils"
|
||||||
import {
|
import {
|
||||||
DialogBody,
|
DialogBody,
|
||||||
DialogCloseTrigger,
|
DialogCloseTrigger,
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
import { Container, Heading, Stack } from "@chakra-ui/react"
|
import { Container, Heading, Stack } from "@chakra-ui/react"
|
||||||
import { useTheme } from "next-themes"
|
import { useTheme } from "next-themes"
|
||||||
import { Radio, RadioGroup } from "../../components/ui/radio"
|
|
||||||
|
import { Radio, RadioGroup } from "@/components/ui/radio"
|
||||||
|
|
||||||
const Appearance = () => {
|
const Appearance = () => {
|
||||||
const { theme, setTheme } = useTheme()
|
const { theme, setTheme } = useTheme()
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
import { Box, Button, Container, Heading, VStack } from "@chakra-ui/react"
|
import { Box, Button, Container, Heading, VStack } from "@chakra-ui/react"
|
||||||
import { useMutation } from "@tanstack/react-query"
|
import { useMutation } from "@tanstack/react-query"
|
||||||
import { type SubmitHandler, useForm } from "react-hook-form"
|
import { type SubmitHandler, useForm } from "react-hook-form"
|
||||||
|
|
||||||
import { FiLock } from "react-icons/fi"
|
import { FiLock } from "react-icons/fi"
|
||||||
import { type ApiError, type UpdatePassword, UsersService } from "../../client"
|
|
||||||
import useCustomToast from "../../hooks/useCustomToast"
|
import { type ApiError, type UpdatePassword, UsersService } from "@/client"
|
||||||
import { confirmPasswordRules, handleError, passwordRules } from "../../utils"
|
import useCustomToast from "@/hooks/useCustomToast"
|
||||||
|
import { confirmPasswordRules, handleError, passwordRules } from "@/utils"
|
||||||
import { PasswordInput } from "../ui/password-input"
|
import { PasswordInput } from "../ui/password-input"
|
||||||
|
|
||||||
interface UpdatePasswordForm extends UpdatePassword {
|
interface UpdatePasswordForm extends UpdatePassword {
|
||||||
|
@@ -2,7 +2,8 @@ import { Button, ButtonGroup, Text } from "@chakra-ui/react"
|
|||||||
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
import { useMutation, useQueryClient } from "@tanstack/react-query"
|
||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
import { useForm } from "react-hook-form"
|
import { useForm } from "react-hook-form"
|
||||||
import { type ApiError, UsersService } from "../../client"
|
|
||||||
|
import { type ApiError, UsersService } from "@/client"
|
||||||
import {
|
import {
|
||||||
DialogActionTrigger,
|
DialogActionTrigger,
|
||||||
DialogBody,
|
DialogBody,
|
||||||
@@ -13,10 +14,10 @@ import {
|
|||||||
DialogRoot,
|
DialogRoot,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
DialogTrigger,
|
DialogTrigger,
|
||||||
} from "../../components/ui/dialog"
|
} from "@/components/ui/dialog"
|
||||||
import useAuth from "../../hooks/useAuth"
|
import useAuth from "@/hooks/useAuth"
|
||||||
import useCustomToast from "../../hooks/useCustomToast"
|
import useCustomToast from "@/hooks/useCustomToast"
|
||||||
import { handleError } from "../../utils"
|
import { handleError } from "@/utils"
|
||||||
|
|
||||||
const DeleteConfirmation = () => {
|
const DeleteConfirmation = () => {
|
||||||
const [isOpen, setIsOpen] = useState(false)
|
const [isOpen, setIsOpen] = useState(false)
|
||||||
|
@@ -16,10 +16,10 @@ import {
|
|||||||
type UserPublic,
|
type UserPublic,
|
||||||
type UserUpdateMe,
|
type UserUpdateMe,
|
||||||
UsersService,
|
UsersService,
|
||||||
} from "../../client"
|
} from "@/client"
|
||||||
import useAuth from "../../hooks/useAuth"
|
import useAuth from "@/hooks/useAuth"
|
||||||
import useCustomToast from "../../hooks/useCustomToast"
|
import useCustomToast from "@/hooks/useCustomToast"
|
||||||
import { emailPattern, handleError } from "../../utils"
|
import { emailPattern, handleError } from "@/utils"
|
||||||
import { Field } from "../ui/field"
|
import { Field } from "../ui/field"
|
||||||
|
|
||||||
const UserInformation = () => {
|
const UserInformation = () => {
|
||||||
|
@@ -9,8 +9,8 @@ import {
|
|||||||
type UserPublic,
|
type UserPublic,
|
||||||
type UserRegister,
|
type UserRegister,
|
||||||
UsersService,
|
UsersService,
|
||||||
} from "../client"
|
} from "@/client"
|
||||||
import { handleError } from "../utils"
|
import { handleError } from "@/utils"
|
||||||
|
|
||||||
const isLoggedIn = () => {
|
const isLoggedIn = () => {
|
||||||
return localStorage.getItem("access_token") !== null
|
return localStorage.getItem("access_token") !== null
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import { toaster } from "../components/ui/toaster"
|
import { toaster } from "@/components/ui/toaster"
|
||||||
|
|
||||||
const useCustomToast = () => {
|
const useCustomToast = () => {
|
||||||
const showSuccessToast = (description: string) => {
|
const showSuccessToast = (description: string) => {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { Outlet, createRootRoute } from "@tanstack/react-router"
|
import { Outlet, createRootRoute } from "@tanstack/react-router"
|
||||||
import React, { Suspense } from "react"
|
import React, { Suspense } from "react"
|
||||||
|
|
||||||
import NotFound from "../components/Common/NotFound"
|
import NotFound from "@/components/Common/NotFound"
|
||||||
|
|
||||||
const loadDevtools = () =>
|
const loadDevtools = () =>
|
||||||
Promise.all([
|
Promise.all([
|
||||||
|
@@ -1,9 +1,9 @@
|
|||||||
import { Flex } from "@chakra-ui/react"
|
import { Flex } from "@chakra-ui/react"
|
||||||
import { Outlet, createFileRoute, redirect } from "@tanstack/react-router"
|
import { Outlet, createFileRoute, redirect } from "@tanstack/react-router"
|
||||||
|
|
||||||
import Navbar from "../components/Common/Navbar"
|
import Navbar from "@/components/Common/Navbar"
|
||||||
import Sidebar from "../components/Common/Sidebar"
|
import Sidebar from "@/components/Common/Sidebar"
|
||||||
import { isLoggedIn } from "../hooks/useAuth"
|
import { isLoggedIn } from "@/hooks/useAuth"
|
||||||
|
|
||||||
export const Route = createFileRoute("/_layout")({
|
export const Route = createFileRoute("/_layout")({
|
||||||
component: Layout,
|
component: Layout,
|
||||||
|
@@ -3,16 +3,16 @@ import { useQuery, useQueryClient } from "@tanstack/react-query"
|
|||||||
import { createFileRoute, useNavigate } from "@tanstack/react-router"
|
import { createFileRoute, useNavigate } from "@tanstack/react-router"
|
||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
|
|
||||||
import { type UserPublic, UsersService } from "../../client"
|
import { type UserPublic, UsersService } from "@/client"
|
||||||
import AddUser from "../../components/Admin/AddUser"
|
import AddUser from "@/components/Admin/AddUser"
|
||||||
import { UserActionsMenu } from "../../components/Common/UserActionsMenu"
|
import { UserActionsMenu } from "@/components/Common/UserActionsMenu"
|
||||||
import PendingUsers from "../../components/Pending/PendingUsers"
|
import PendingUsers from "@/components/Pending/PendingUsers"
|
||||||
import {
|
import {
|
||||||
PaginationItems,
|
PaginationItems,
|
||||||
PaginationNextTrigger,
|
PaginationNextTrigger,
|
||||||
PaginationPrevTrigger,
|
PaginationPrevTrigger,
|
||||||
PaginationRoot,
|
PaginationRoot,
|
||||||
} from "../../components/ui/pagination.tsx"
|
} from "@/components/ui/pagination.tsx"
|
||||||
|
|
||||||
const usersSearchSchema = z.object({
|
const usersSearchSchema = z.object({
|
||||||
page: z.number().catch(1),
|
page: z.number().catch(1),
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { Box, Container, Text } from "@chakra-ui/react"
|
import { Box, Container, Text } from "@chakra-ui/react"
|
||||||
import { createFileRoute } from "@tanstack/react-router"
|
import { createFileRoute } from "@tanstack/react-router"
|
||||||
|
|
||||||
import useAuth from "../../hooks/useAuth"
|
import useAuth from "@/hooks/useAuth"
|
||||||
|
|
||||||
export const Route = createFileRoute("/_layout/")({
|
export const Route = createFileRoute("/_layout/")({
|
||||||
component: Dashboard,
|
component: Dashboard,
|
||||||
|
@@ -6,21 +6,21 @@ import {
|
|||||||
Table,
|
Table,
|
||||||
VStack,
|
VStack,
|
||||||
} from "@chakra-ui/react"
|
} from "@chakra-ui/react"
|
||||||
|
import { useQuery } from "@tanstack/react-query"
|
||||||
import { createFileRoute, useNavigate } from "@tanstack/react-router"
|
import { createFileRoute, useNavigate } from "@tanstack/react-router"
|
||||||
import { FiSearch } from "react-icons/fi"
|
import { FiSearch } from "react-icons/fi"
|
||||||
import { z } from "zod"
|
import { z } from "zod"
|
||||||
|
|
||||||
import { useQuery } from "@tanstack/react-query"
|
import { ItemsService } from "@/client"
|
||||||
import { ItemsService } from "../../client"
|
import { ItemActionsMenu } from "@/components/Common/ItemActionsMenu"
|
||||||
import { ItemActionsMenu } from "../../components/Common/ItemActionsMenu"
|
import AddItem from "@/components/Items/AddItem"
|
||||||
import AddItem from "../../components/Items/AddItem"
|
import PendingItems from "@/components/Pending/PendingItems"
|
||||||
import PendingItems from "../../components/Pending/PendingItems"
|
|
||||||
import {
|
import {
|
||||||
PaginationItems,
|
PaginationItems,
|
||||||
PaginationNextTrigger,
|
PaginationNextTrigger,
|
||||||
PaginationPrevTrigger,
|
PaginationPrevTrigger,
|
||||||
PaginationRoot,
|
PaginationRoot,
|
||||||
} from "../../components/ui/pagination.tsx"
|
} from "@/components/ui/pagination.tsx"
|
||||||
|
|
||||||
const itemsSearchSchema = z.object({
|
const itemsSearchSchema = z.object({
|
||||||
page: z.number().catch(1),
|
page: z.number().catch(1),
|
||||||
|
@@ -1,11 +1,11 @@
|
|||||||
import { Container, Heading, Tabs } from "@chakra-ui/react"
|
import { Container, Heading, Tabs } from "@chakra-ui/react"
|
||||||
import { createFileRoute } from "@tanstack/react-router"
|
import { createFileRoute } from "@tanstack/react-router"
|
||||||
|
|
||||||
import Appearance from "../../components/UserSettings/Appearance"
|
import Appearance from "@/components/UserSettings/Appearance"
|
||||||
import ChangePassword from "../../components/UserSettings/ChangePassword"
|
import ChangePassword from "@/components/UserSettings/ChangePassword"
|
||||||
import DeleteAccount from "../../components/UserSettings/DeleteAccount"
|
import DeleteAccount from "@/components/UserSettings/DeleteAccount"
|
||||||
import UserInformation from "../../components/UserSettings/UserInformation"
|
import UserInformation from "@/components/UserSettings/UserInformation"
|
||||||
import useAuth from "../../hooks/useAuth"
|
import useAuth from "@/hooks/useAuth"
|
||||||
|
|
||||||
const tabsConfig = [
|
const tabsConfig = [
|
||||||
{ value: "my-profile", title: "My profile", component: UserInformation },
|
{ value: "my-profile", title: "My profile", component: UserInformation },
|
||||||
|
@@ -5,15 +5,15 @@ import {
|
|||||||
redirect,
|
redirect,
|
||||||
} from "@tanstack/react-router"
|
} from "@tanstack/react-router"
|
||||||
import { type SubmitHandler, useForm } from "react-hook-form"
|
import { type SubmitHandler, useForm } from "react-hook-form"
|
||||||
|
|
||||||
import { FiLock, FiMail } from "react-icons/fi"
|
import { FiLock, FiMail } from "react-icons/fi"
|
||||||
|
|
||||||
|
import type { Body_login_login_access_token as AccessToken } from "@/client"
|
||||||
|
import { Button } from "@/components/ui/button"
|
||||||
|
import { Field } from "@/components/ui/field"
|
||||||
|
import { InputGroup } from "@/components/ui/input-group"
|
||||||
|
import { PasswordInput } from "@/components/ui/password-input"
|
||||||
|
import useAuth, { isLoggedIn } from "@/hooks/useAuth"
|
||||||
import Logo from "/assets/images/fastapi-logo.svg"
|
import Logo from "/assets/images/fastapi-logo.svg"
|
||||||
import type { Body_login_login_access_token as AccessToken } from "../client"
|
|
||||||
import { Button } from "../components/ui/button"
|
|
||||||
import { Field } from "../components/ui/field"
|
|
||||||
import { InputGroup } from "../components/ui/input-group"
|
|
||||||
import { PasswordInput } from "../components/ui/password-input"
|
|
||||||
import useAuth, { isLoggedIn } from "../hooks/useAuth"
|
|
||||||
import { emailPattern, passwordRules } from "../utils"
|
import { emailPattern, passwordRules } from "../utils"
|
||||||
|
|
||||||
export const Route = createFileRoute("/login")({
|
export const Route = createFileRoute("/login")({
|
||||||
|
@@ -2,15 +2,15 @@ import { Container, Heading, Input, Text } from "@chakra-ui/react"
|
|||||||
import { useMutation } from "@tanstack/react-query"
|
import { useMutation } from "@tanstack/react-query"
|
||||||
import { createFileRoute, redirect } from "@tanstack/react-router"
|
import { createFileRoute, redirect } from "@tanstack/react-router"
|
||||||
import { type SubmitHandler, useForm } from "react-hook-form"
|
import { type SubmitHandler, useForm } from "react-hook-form"
|
||||||
|
|
||||||
import { FiMail } from "react-icons/fi"
|
import { FiMail } from "react-icons/fi"
|
||||||
import { type ApiError, LoginService } from "../client"
|
|
||||||
import { Button } from "../components/ui/button"
|
import { type ApiError, LoginService } from "@/client"
|
||||||
import { Field } from "../components/ui/field"
|
import { Button } from "@/components/ui/button"
|
||||||
import { InputGroup } from "../components/ui/input-group"
|
import { Field } from "@/components/ui/field"
|
||||||
import { isLoggedIn } from "../hooks/useAuth"
|
import { InputGroup } from "@/components/ui/input-group"
|
||||||
import useCustomToast from "../hooks/useCustomToast"
|
import { isLoggedIn } from "@/hooks/useAuth"
|
||||||
import { emailPattern, handleError } from "../utils"
|
import useCustomToast from "@/hooks/useCustomToast"
|
||||||
|
import { emailPattern, handleError } from "@/utils"
|
||||||
|
|
||||||
interface FormData {
|
interface FormData {
|
||||||
email: string
|
email: string
|
||||||
|
@@ -2,14 +2,14 @@ import { Container, Heading, Text } from "@chakra-ui/react"
|
|||||||
import { useMutation } from "@tanstack/react-query"
|
import { useMutation } from "@tanstack/react-query"
|
||||||
import { createFileRoute, redirect, useNavigate } from "@tanstack/react-router"
|
import { createFileRoute, redirect, useNavigate } from "@tanstack/react-router"
|
||||||
import { type SubmitHandler, useForm } from "react-hook-form"
|
import { type SubmitHandler, useForm } from "react-hook-form"
|
||||||
|
|
||||||
import { FiLock } from "react-icons/fi"
|
import { FiLock } from "react-icons/fi"
|
||||||
import { type ApiError, LoginService, type NewPassword } from "../client"
|
|
||||||
import { Button } from "../components/ui/button"
|
import { type ApiError, LoginService, type NewPassword } from "@/client"
|
||||||
import { PasswordInput } from "../components/ui/password-input"
|
import { Button } from "@/components/ui/button"
|
||||||
import { isLoggedIn } from "../hooks/useAuth"
|
import { PasswordInput } from "@/components/ui/password-input"
|
||||||
import useCustomToast from "../hooks/useCustomToast"
|
import { isLoggedIn } from "@/hooks/useAuth"
|
||||||
import { confirmPasswordRules, handleError, passwordRules } from "../utils"
|
import useCustomToast from "@/hooks/useCustomToast"
|
||||||
|
import { confirmPasswordRules, handleError, passwordRules } from "@/utils"
|
||||||
|
|
||||||
interface NewPasswordForm extends NewPassword {
|
interface NewPasswordForm extends NewPassword {
|
||||||
confirm_password: string
|
confirm_password: string
|
||||||
|
@@ -5,16 +5,16 @@ import {
|
|||||||
redirect,
|
redirect,
|
||||||
} from "@tanstack/react-router"
|
} from "@tanstack/react-router"
|
||||||
import { type SubmitHandler, useForm } from "react-hook-form"
|
import { type SubmitHandler, useForm } from "react-hook-form"
|
||||||
|
|
||||||
import { FiLock, FiUser } from "react-icons/fi"
|
import { FiLock, FiUser } from "react-icons/fi"
|
||||||
|
|
||||||
|
import type { UserRegister } from "@/client"
|
||||||
|
import { Button } from "@/components/ui/button"
|
||||||
|
import { Field } from "@/components/ui/field"
|
||||||
|
import { InputGroup } from "@/components/ui/input-group"
|
||||||
|
import { PasswordInput } from "@/components/ui/password-input"
|
||||||
|
import useAuth, { isLoggedIn } from "@/hooks/useAuth"
|
||||||
|
import { confirmPasswordRules, emailPattern, passwordRules } from "@/utils"
|
||||||
import Logo from "/assets/images/fastapi-logo.svg"
|
import Logo from "/assets/images/fastapi-logo.svg"
|
||||||
import type { UserRegister } from "../client"
|
|
||||||
import { Button } from "../components/ui/button"
|
|
||||||
import { Field } from "../components/ui/field"
|
|
||||||
import { InputGroup } from "../components/ui/input-group"
|
|
||||||
import { PasswordInput } from "../components/ui/password-input"
|
|
||||||
import useAuth, { isLoggedIn } from "../hooks/useAuth"
|
|
||||||
import { confirmPasswordRules, emailPattern, passwordRules } from "../utils"
|
|
||||||
|
|
||||||
export const Route = createFileRoute("/signup")({
|
export const Route = createFileRoute("/signup")({
|
||||||
component: SignUp,
|
component: SignUp,
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||||
"module": "ESNext",
|
"module": "ESNext",
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
|
|
||||||
/* Bundler mode */
|
/* Bundler mode */
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler",
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true,
|
||||||
@@ -13,13 +12,19 @@
|
|||||||
"isolatedModules": true,
|
"isolatedModules": true,
|
||||||
"noEmit": true,
|
"noEmit": true,
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx",
|
||||||
|
|
||||||
/* Linting */
|
/* Linting */
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true,
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true,
|
||||||
"noFallthroughCasesInSwitch": true
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"paths": {
|
||||||
|
"@/*": ["./src/*"]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"include": ["src/**/*.ts", "tests/**/*.ts", "playwright.config.ts"],
|
"include": ["src/**/*.ts", "tests/**/*.ts", "playwright.config.ts"],
|
||||||
"references": [{ "path": "./tsconfig.node.json" }]
|
"references": [
|
||||||
|
{
|
||||||
|
"path": "./tsconfig.node.json"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,14 @@
|
|||||||
|
import path from "node:path"
|
||||||
import { TanStackRouterVite } from "@tanstack/router-vite-plugin"
|
import { TanStackRouterVite } from "@tanstack/router-vite-plugin"
|
||||||
import react from "@vitejs/plugin-react-swc"
|
import react from "@vitejs/plugin-react-swc"
|
||||||
import { defineConfig } from "vite"
|
import { defineConfig } from "vite"
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
resolve: {
|
||||||
|
alias: {
|
||||||
|
"@": path.resolve(__dirname, "./src"),
|
||||||
|
},
|
||||||
|
},
|
||||||
plugins: [react(), TanStackRouterVite()],
|
plugins: [react(), TanStackRouterVite()],
|
||||||
})
|
})
|
||||||
|
Reference in New Issue
Block a user