deleted noused library

This commit is contained in:
Philip Cheung 2024-10-07 12:44:34 +08:00
parent 152404d681
commit daf301ee73
15 changed files with 29 additions and 118 deletions

View File

@ -18,28 +18,20 @@ import type {
UserUpdate, UserUpdate,
UserUpdateMe, UserUpdateMe,
UsersPublic, UsersPublic,
ClientMessagePublic,
ClientMessagesPublic, ClientMessagesPublic,
WebSettingPublic, WebSettingPublic,
WebSettingUpdate, WebSettingUpdate,
AboutUssPublic, AboutUssPublic,
AboutUsPublic,
AboutUsUpdate, AboutUsUpdate,
AboutUsCreate, AboutUsCreate,
CoursesPublic, CoursesPublic,
CourseCreate, CourseCreate,
CourseDetailsPublic, CourseDetailsPublic,
CourseUpdate, CourseUpdate,
CoursePublic,
ImagePublic, ImagePublic,
Info_imagePublic,
SchedulePublic,
ScheduleCreate, ScheduleCreate,
ScheduleUpdate, ScheduleUpdate,
ImageCreate, ImageCreate,
ImageUpdate,
Info_imagesCreate,
Info_imageUpdate,
} from "./models" } from "./models"
export type TDataLoginAccessToken = { export type TDataLoginAccessToken = {

View File

@ -1,10 +1,9 @@
import React, { useRef, ReactNode, useState } from 'react'; import { useRef, ReactNode, useState } from 'react';
import { import {
Button, Button,
FormControl, FormControl,
FormErrorMessage, FormErrorMessage,
FormLabel, FormLabel,
Input,
Modal, Modal,
ModalBody, ModalBody,
ModalCloseButton, ModalCloseButton,
@ -19,16 +18,15 @@ import {
NumberIncrementStepper, NumberIncrementStepper,
NumberDecrementStepper, NumberDecrementStepper,
} from "@chakra-ui/react" } from "@chakra-ui/react"
import { writeFileSync, createReadStream } from "fs";
import { useMutation, useQueryClient } from "@tanstack/react-query" import { useMutation, useQueryClient } from "@tanstack/react-query"
import { type SubmitHandler, useForm, UseFormRegisterReturn } from "react-hook-form" import { type SubmitHandler, useForm, UseFormRegisterReturn } from "react-hook-form"
import { type ApiError, type AboutUsCreate, AboutUsService } from "../../client" import { type ApiError, type AboutUsCreate, AboutUsService } from "../../client"
import useCustomToast from "../../hooks/useCustomToast" import useCustomToast from "../../hooks/useCustomToast"
import { handleError } from "../../utils" import { handleError } from "../../utils"
import { EditorState, ContentState, convertToRaw } from 'draft-js'; import { EditorState, convertToRaw } from 'draft-js';
import { Editor } from "react-draft-wysiwyg"; import { Editor } from "react-draft-wysiwyg";
import draftToHtml from 'draftjs-to-html'; import draftToHtml from 'draftjs-to-html';
import htmlToDraft from 'html-to-draftjs';
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
interface AddAboutUsProps { interface AddAboutUsProps {
@ -134,7 +132,7 @@ const AddAboutUs = ({ isOpen, onClose }: AddAboutUsProps) => {
} }
mutation.mutate(data) mutation.mutate(data)
console.log(data) console.log(data)
} }
@ -152,20 +150,6 @@ const AddAboutUs = ({ isOpen, onClose }: AddAboutUsProps) => {
<ModalCloseButton /> <ModalCloseButton />
<ModalBody pb={30}> <ModalBody pb={30}>
<FormControl isRequired isInvalid={!!errors.title}>
<FormLabel htmlFor="title">Title</FormLabel>
<Input
id="title"
{...register("title", {
required: "Title is required.",
})}
placeholder="Title"
type="text"
/>
{errors.title && (
<FormErrorMessage>{errors.title.message}</FormErrorMessage>
)}
</FormControl>
<FormControl isRequired isInvalid={!!errors.description}> <FormControl isRequired isInvalid={!!errors.description}>
<Editor <Editor
editorState={editorState} editorState={editorState}
@ -200,7 +184,7 @@ const AddAboutUs = ({ isOpen, onClose }: AddAboutUsProps) => {
<NumberDecrementStepper /> <NumberDecrementStepper />
</NumberInputStepper> </NumberInputStepper>
</NumberInput> </NumberInput>
{errors.index && ( {errors.index && (
<FormErrorMessage>{errors.index.message}</FormErrorMessage> <FormErrorMessage>{errors.index.message}</FormErrorMessage>
)} )}
@ -209,7 +193,7 @@ const AddAboutUs = ({ isOpen, onClose }: AddAboutUsProps) => {
<FormControl isInvalid={!!errors.image} isRequired> <FormControl isInvalid={!!errors.image} isRequired>
<FormLabel>{'Image Upload'}</FormLabel> <FormLabel>{'Image Upload'}</FormLabel>
<input type="file" {...register("image", { <input type="file" {...register("image", {
required: "index is required.", required: "index is required.",
})} /> })} />

View File

@ -1,4 +1,4 @@
import React, { useRef, ReactNode, useState } from 'react'; import { useRef, ReactNode, useState } from 'react';
import { import {
Button, Button,
FormControl, FormControl,
@ -21,10 +21,10 @@ import {
Box, Box,
Image, Image,
} from "@chakra-ui/react" } from "@chakra-ui/react"
import { writeFileSync, createReadStream } from "fs";
import { useMutation, useQueryClient } from "@tanstack/react-query" import { useMutation, useQueryClient } from "@tanstack/react-query"
import { type SubmitHandler, useForm, UseFormRegisterReturn } from "react-hook-form" import { type SubmitHandler, useForm, UseFormRegisterReturn } from "react-hook-form"
import { type ApiError, type AboutUsCreate, AboutUsService, AboutUsUpdate, AboutUsPublic } from "../../client" import { type ApiError, AboutUsService, AboutUsUpdate, AboutUsPublic } from "../../client"
import useCustomToast from "../../hooks/useCustomToast" import useCustomToast from "../../hooks/useCustomToast"
import { handleError } from "../../utils" import { handleError } from "../../utils"
import { EditorState, ContentState, convertToRaw } from 'draft-js'; import { EditorState, ContentState, convertToRaw } from 'draft-js';

View File

@ -8,8 +8,8 @@ import {
} from "@chakra-ui/react" } from "@chakra-ui/react"
import { BsThreeDotsVertical } from "react-icons/bs" import { BsThreeDotsVertical } from "react-icons/bs"
import { FiEdit, FiTrash } from "react-icons/fi" import { FiEdit, FiTrash } from "react-icons/fi"
import { Link } from "@tanstack/react-router"
import type { ItemPublic, UserPublic, AboutUsPublic, AboutUsUpdate, CoursePublic, ImagePublic, SchedulePublic } from "../../client" import type { ItemPublic, UserPublic, AboutUsPublic, CoursePublic, ImagePublic, SchedulePublic } from "../../client"
import EditUser from "../Admin/EditUser" import EditUser from "../Admin/EditUser"
import EditItem from "../Items/EditItem" import EditItem from "../Items/EditItem"
import EditCourseImage from "../CourseImage/editCourseImage" import EditCourseImage from "../CourseImage/editCourseImage"

View File

@ -1,10 +1,8 @@
import React, { useRef, ReactNode, useState } from 'react';
import { import {
Button, Button,
FormControl, FormControl,
FormErrorMessage,
FormLabel, FormLabel,
Input,
Modal, Modal,
ModalBody, ModalBody,
ModalCloseButton, ModalCloseButton,
@ -12,7 +10,6 @@ import {
ModalFooter, ModalFooter,
ModalHeader, ModalHeader,
ModalOverlay, ModalOverlay,
InputGroup,
NumberInput, NumberInput,
NumberInputField, NumberInputField,
NumberInputStepper, NumberInputStepper,
@ -20,7 +17,7 @@ import {
NumberDecrementStepper, NumberDecrementStepper,
} from "@chakra-ui/react" } from "@chakra-ui/react"
import { useMutation, useQueryClient } from "@tanstack/react-query" import { useMutation, useQueryClient } from "@tanstack/react-query"
import { type SubmitHandler, useForm, UseFormRegisterReturn } from "react-hook-form" import { type SubmitHandler, useForm } from "react-hook-form"
import { type ApiError, ImageService, Info_imageService, ImageUpdate, ImagePublic } from "../../client" import { type ApiError, ImageService, Info_imageService, ImageUpdate, ImagePublic } from "../../client"
import useCustomToast from "../../hooks/useCustomToast" import useCustomToast from "../../hooks/useCustomToast"
import { handleError } from "../../utils" import { handleError } from "../../utils"

View File

@ -5,19 +5,11 @@ import {
FormLabel, FormLabel,
Input, Input,
Textarea, Textarea,
Modal,
ModalBody,
ModalCloseButton,
ModalContent,
ModalFooter,
ModalHeader,
ModalOverlay,
Container, Container,
Heading, Heading,
Box Box
} from "@chakra-ui/react" } from "@chakra-ui/react"
import { useQuery, useQueryClient, useMutation, QueryClient } from "@tanstack/react-query" import { useQueryClient, useMutation } from "@tanstack/react-query"
import { createFileRoute, useNavigate, Await, useRouter } from "@tanstack/react-router"
import { useEffect, useState } from "react" import { useEffect, useState } from "react"
import useCustomToast from "../../hooks/useCustomToast" import useCustomToast from "../../hooks/useCustomToast"
import { CoursesService, type ApiError, CourseCreate, CourseDetailsPublic } from "../../client" import { CoursesService, type ApiError, CourseCreate, CourseDetailsPublic } from "../../client"

View File

@ -3,15 +3,6 @@ import {
FormControl, FormControl,
FormErrorMessage, FormErrorMessage,
FormLabel, FormLabel,
Input,
Textarea,
Modal,
ModalBody,
ModalCloseButton,
ModalContent,
ModalFooter,
ModalHeader,
ModalOverlay,
Container, Container,
Heading, Heading,
Box, Box,
@ -29,10 +20,8 @@ import {
Icon, Icon,
Grid Grid
} from "@chakra-ui/react" } from "@chakra-ui/react"
import { useQuery, useQueryClient, useMutation } from "@tanstack/react-query" import { useQueryClient, useMutation } from "@tanstack/react-query"
import { createFileRoute, useNavigate, Await, useRouter } from "@tanstack/react-router" import { useEffect } from "react"
import { FaPlus, FaPen, FaTrashAlt } from "react-icons/fa"
import { useEffect, useState } from "react"
import useCustomToast from "../../hooks/useCustomToast" import useCustomToast from "../../hooks/useCustomToast"
import { ImageService, type ApiError, CourseDetailsPublic, ImageCreate } from "../../client" import { ImageService, type ApiError, CourseDetailsPublic, ImageCreate } from "../../client"
import { handleError } from "../../utils" import { handleError } from "../../utils"

View File

@ -3,15 +3,6 @@ import {
FormControl, FormControl,
FormErrorMessage, FormErrorMessage,
FormLabel, FormLabel,
Input,
Textarea,
Modal,
ModalBody,
ModalCloseButton,
ModalContent,
ModalFooter,
ModalHeader,
ModalOverlay,
Container, Container,
Heading, Heading,
Box, Box,
@ -21,18 +12,13 @@ import {
NumberIncrementStepper, NumberIncrementStepper,
NumberDecrementStepper, NumberDecrementStepper,
Image, Image,
Flex,
HStack, HStack,
VStack, VStack,
Text, Text,
Td,
Icon,
Grid Grid
} from "@chakra-ui/react" } from "@chakra-ui/react"
import { useQuery, useQueryClient, useMutation } from "@tanstack/react-query" import { useQueryClient, useMutation } from "@tanstack/react-query"
import { createFileRoute, useNavigate, Await, useRouter } from "@tanstack/react-router" import { useEffect } from "react"
import { FaPlus, FaPen, FaTrashAlt } from "react-icons/fa"
import { useEffect, useState } from "react"
import useCustomToast from "../../hooks/useCustomToast" import useCustomToast from "../../hooks/useCustomToast"
import { Info_imageService, type ApiError, CourseDetailsPublic, ImageCreate } from "../../client" import { Info_imageService, type ApiError, CourseDetailsPublic, ImageCreate } from "../../client"
import { handleError } from "../../utils" import { handleError } from "../../utils"

View File

@ -12,12 +12,12 @@ import {
ModalHeader, ModalHeader,
ModalOverlay, ModalOverlay,
} from "@chakra-ui/react" } from "@chakra-ui/react"
import { useEffect, useState } from "react" import {useState } from "react"
import { useMutation, useQueryClient } from "@tanstack/react-query" import { useMutation, useQueryClient } from "@tanstack/react-query"
import { type SubmitHandler, useForm } from "react-hook-form" import { type SubmitHandler, useForm } from "react-hook-form"
import DateTimePicker from 'react-datetime-picker'; import DateTimePicker from 'react-datetime-picker';
import 'react-calendar/dist/Calendar.css'; import 'react-calendar/dist/Calendar.css';
import { type ApiError, type ScheduleCreate, SchedulePublic, ScheduleUpdate, secheduleService } from "../../client" import { type ApiError, SchedulePublic, ScheduleUpdate, secheduleService } from "../../client"
import useCustomToast from "../../hooks/useCustomToast" import useCustomToast from "../../hooks/useCustomToast"
import { handleError } from "../../utils" import { handleError } from "../../utils"
import moment from "moment"; import moment from "moment";

View File

@ -1,9 +1,5 @@
import { import {
Button,
Container, Container,
Flex,
Heading,
SkeletonText,
Table, Table,
TableContainer, TableContainer,
Tbody, Tbody,
@ -13,16 +9,10 @@ import {
Tr, Tr,
} from "@chakra-ui/react" } from "@chakra-ui/react"
import moment from 'moment'; import moment from 'moment';
import { useQuery, useQueryClient, useMutation } from "@tanstack/react-query" import { useQueryClient, } from "@tanstack/react-query"
import { createFileRoute, useNavigate, Await, useRouter } from "@tanstack/react-router"
import { FaPlus, FaPen, FaTrashAlt } from "react-icons/fa"
import { useEffect, useState } from "react"
import useCustomToast from "../../hooks/useCustomToast" import useCustomToast from "../../hooks/useCustomToast"
import { Info_imageService, type ApiError, CourseDetailsPublic, ImageCreate } from "../../client" import { CourseDetailsPublic } from "../../client"
import { handleError } from "../../utils"
import { type SubmitHandler, useForm } from "react-hook-form"
import ActionsMenu from "../../components/Common/ActionsMenu" import ActionsMenu from "../../components/Common/ActionsMenu"
import DateTimePicker from 'react-datetime-picker';
import 'react-datetime-picker/dist/DateTimePicker.css'; import 'react-datetime-picker/dist/DateTimePicker.css';
import Navbar from "../../components/Common/Navbar" import Navbar from "../../components/Common/Navbar"
import AddSechedule from "./AddSechedule"; import AddSechedule from "./AddSechedule";

View File

@ -3,7 +3,6 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query"
import { RouterProvider, createRouter } from "@tanstack/react-router" import { RouterProvider, createRouter } from "@tanstack/react-router"
import ReactDOM from "react-dom/client" import ReactDOM from "react-dom/client"
import { routeTree } from "./routeTree.gen" import { routeTree } from "./routeTree.gen"
import { StrictMode } from "react"
import { OpenAPI } from "./client" import { OpenAPI } from "./client"
import theme from "./theme" import theme from "./theme"

View File

@ -5,26 +5,18 @@ import {
FormLabel, FormLabel,
Input, Input,
Textarea, Textarea,
Modal,
ModalBody,
ModalCloseButton,
ModalContent,
ModalFooter,
ModalHeader,
ModalOverlay,
Container Container
} from "@chakra-ui/react" } from "@chakra-ui/react"
import { useQuery, useQueryClient, useMutation } from "@tanstack/react-query" import {useQueryClient, useMutation } from "@tanstack/react-query"
import { createFileRoute, useNavigate, Await, useRouter } from "@tanstack/react-router" import { createFileRoute } from "@tanstack/react-router"
import { useEffect, useState } from "react" import {useState } from "react"
import useCustomToast from "../../../hooks/useCustomToast" import useCustomToast from "../../../hooks/useCustomToast"
import { CoursesService, type ApiError, CourseCreate, } from "../../../client" import { CoursesService, type ApiError, CourseCreate, } from "../../../client"
import { handleError } from "../../../utils" import { handleError } from "../../../utils"
import { type SubmitHandler, useForm } from "react-hook-form" import { type SubmitHandler, useForm } from "react-hook-form"
import { EditorState, ContentState, convertToRaw } from 'draft-js'; import { EditorState, convertToRaw } from 'draft-js';
import { Editor } from "react-draft-wysiwyg"; import { Editor } from "react-draft-wysiwyg";
import draftToHtml from 'draftjs-to-html'; import draftToHtml from 'draftjs-to-html';
import htmlToDraft from 'html-to-draftjs';
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";

View File

@ -21,8 +21,6 @@ import { z } from "zod"
import { FaPlus, FaPen, FaTrashAlt } from "react-icons/fa" import { FaPlus, FaPen, FaTrashAlt } from "react-icons/fa"
import { CoursesService } from "../../../client" import { CoursesService } from "../../../client"
import Delete from "../../../components/Common/DeleteAlert" import Delete from "../../../components/Common/DeleteAlert"
import ActionsMenu from "../../../components/Common/ActionsMenu"
import Navbar from "../../../components/Common/Navbar"
//import Addcourse from "../../components/courses/Addcourse" //import Addcourse from "../../components/courses/Addcourse"
import { Link } from "@tanstack/react-router" import { Link } from "@tanstack/react-router"
const CoursesSearchSchema = z.object({ const CoursesSearchSchema = z.object({

View File

@ -14,7 +14,7 @@ import {
} from "@chakra-ui/react" } from "@chakra-ui/react"
import { useQuery, useQueryClient } from "@tanstack/react-query" import { useQuery, useQueryClient } from "@tanstack/react-query"
import { createFileRoute, useNavigate } from "@tanstack/react-router" import { createFileRoute, useNavigate } from "@tanstack/react-router"
import { useEffect, useState } from "react" import { useEffect } from "react"
import { z } from "zod" import { z } from "zod"
import parse from 'html-react-parser'; import parse from 'html-react-parser';
import { AboutUsService } from "../../client" import { AboutUsService } from "../../client"

View File

@ -4,18 +4,10 @@ import {
FormErrorMessage, FormErrorMessage,
FormLabel, FormLabel,
Input, Input,
Modal,
ModalBody,
ModalCloseButton,
ModalContent,
ModalFooter,
ModalHeader,
ModalOverlay,
Container Container
} from "@chakra-ui/react" } from "@chakra-ui/react"
import { useQuery, useQueryClient, useMutation } from "@tanstack/react-query" import { useQueryClient, useMutation } from "@tanstack/react-query"
import { createFileRoute, useNavigate, Await } from "@tanstack/react-router" import { createFileRoute } from "@tanstack/react-router"
import { useEffect, useState } from "react"
import useCustomToast from "../../hooks/useCustomToast" import useCustomToast from "../../hooks/useCustomToast"
import { WebSettingsService, type WebSettingUpdate, type ApiError, } from "../../client" import { WebSettingsService, type WebSettingUpdate, type ApiError, } from "../../client"
import { handleError } from "../../utils" import { handleError } from "../../utils"