diff --git a/client/src/index.tsx b/client/src/index.tsx index 52d8f534..2cf28f4f 100644 --- a/client/src/index.tsx +++ b/client/src/index.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import { createRoot } from 'react-dom/client'; import { BrowserRouter } from 'react-router-dom'; import { AppRoutes } from './router/AppRoutes'; diff --git a/client/src/pages/auth/AdminLayout.tsx b/client/src/pages/auth/AdminLayout.tsx index ace39ed1..cc26ebca 100644 --- a/client/src/pages/auth/AdminLayout.tsx +++ b/client/src/pages/auth/AdminLayout.tsx @@ -1,4 +1,4 @@ -import React, { FC, PropsWithChildren } from 'react'; +import { FC, PropsWithChildren } from 'react'; export const AdminLayout: FC = ({ children }) => { return ( diff --git a/client/src/pages/auth/AdminPage.tsx b/client/src/pages/auth/AdminPage.tsx index 4be8a3be..30af063d 100644 --- a/client/src/pages/auth/AdminPage.tsx +++ b/client/src/pages/auth/AdminPage.tsx @@ -1,4 +1,4 @@ -import React, { FC, useEffect, useState } from 'react'; +import { ChangeEvent, FC, useEffect, useState } from 'react'; import { UserData } from '../../interfaces/User'; import { getAdminStatus, searchUsers } from '../../api/httpClient'; import AdminLayout from './AdminLayout'; @@ -9,7 +9,7 @@ export const AdminPage: FC = () => { const [inputValue, setInputValue] = useState(''); const [users, setUsers] = useState([]); - const onInput = (e: React.ChangeEvent) => { + const onInput = (e: ChangeEvent) => { setInputValue(e.target.value); }; diff --git a/client/src/pages/auth/AuthLayout.tsx b/client/src/pages/auth/AuthLayout.tsx index e2e7b5e2..955fc207 100644 --- a/client/src/pages/auth/AuthLayout.tsx +++ b/client/src/pages/auth/AuthLayout.tsx @@ -1,7 +1,7 @@ -import React, { useRef, useEffect, FC } from 'react'; +import { ReactNode, useRef, useEffect, FC } from 'react'; type Props = { - children?: React.ReactNode; + children?: ReactNode; logoBgColor?: string; }; diff --git a/client/src/pages/auth/Dashboard.tsx b/client/src/pages/auth/Dashboard.tsx index 3ae3f2ed..349d8446 100644 --- a/client/src/pages/auth/Dashboard.tsx +++ b/client/src/pages/auth/Dashboard.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import AuthLayout from './AuthLayout'; export const Dashboard: FC = () => { diff --git a/client/src/pages/auth/Login/Login.tsx b/client/src/pages/auth/Login/Login.tsx index 3458ccf3..9761cd46 100644 --- a/client/src/pages/auth/Login/Login.tsx +++ b/client/src/pages/auth/Login/Login.tsx @@ -1,6 +1,6 @@ import { AxiosRequestConfig } from 'axios'; import getBrowserFingerprint from 'get-browser-fingerprint'; -import React, { FC, FormEvent, useEffect, useState } from 'react'; +import { FC, FormEvent, useEffect, useState } from 'react'; import { Link, useLocation } from 'react-router-dom'; import { OidcClient } from '../../../interfaces/Auth'; import { RoutePath } from '../../../router/RoutePath'; diff --git a/client/src/pages/auth/Login/showLdapReponse.tsx b/client/src/pages/auth/Login/showLdapReponse.tsx index e0c12039..acc5d69a 100644 --- a/client/src/pages/auth/Login/showLdapReponse.tsx +++ b/client/src/pages/auth/Login/showLdapReponse.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import { RegistrationUser } from '../../../interfaces/User'; import showRegResponse from '../Register/showRegReponse'; diff --git a/client/src/pages/auth/Login/showLoginReponse.tsx b/client/src/pages/auth/Login/showLoginReponse.tsx index d698dd94..2f34fb2a 100644 --- a/client/src/pages/auth/Login/showLoginReponse.tsx +++ b/client/src/pages/auth/Login/showLoginReponse.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import InnerHTML from 'dangerously-set-html-content'; import { LoginResponse } from '../../../interfaces/User'; diff --git a/client/src/pages/auth/LoginNew/LoginNew.tsx b/client/src/pages/auth/LoginNew/LoginNew.tsx index 50de62f0..dfdb3b24 100644 --- a/client/src/pages/auth/LoginNew/LoginNew.tsx +++ b/client/src/pages/auth/LoginNew/LoginNew.tsx @@ -1,5 +1,5 @@ import { AxiosRequestConfig } from 'axios'; -import React, { FC, FormEvent, useState } from 'react'; +import { FC, FormEvent, useState } from 'react'; import { Link } from 'react-router-dom'; import { RoutePath } from '../../../router/RoutePath'; import { getUserData } from '../../../api/httpClient'; diff --git a/client/src/pages/auth/LoginNew/PasswordCheck.tsx b/client/src/pages/auth/LoginNew/PasswordCheck.tsx index f3871e0b..384aec2f 100644 --- a/client/src/pages/auth/LoginNew/PasswordCheck.tsx +++ b/client/src/pages/auth/LoginNew/PasswordCheck.tsx @@ -1,5 +1,5 @@ import { AxiosRequestConfig } from 'axios'; -import React, { FC, FormEvent, useEffect, useState } from 'react'; +import { FC, FormEvent, useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; import { RoutePath } from '../../../router/RoutePath'; import { getUser, getUserData } from '../../../api/httpClient'; diff --git a/client/src/pages/auth/Register/Register.tsx b/client/src/pages/auth/Register/Register.tsx index 5cfe9989..a255f307 100644 --- a/client/src/pages/auth/Register/Register.tsx +++ b/client/src/pages/auth/Register/Register.tsx @@ -1,4 +1,4 @@ -import React, { FC, FormEvent, useState } from 'react'; +import { FC, FormEvent, useState } from 'react'; import { postUser } from '../../../api/httpClient'; import { RegistrationUser, LoginFormMode } from '../../../interfaces/User'; import AuthLayout from '../AuthLayout'; diff --git a/client/src/pages/auth/Register/showRegReponse.tsx b/client/src/pages/auth/Register/showRegReponse.tsx index aa2ab85e..b188be94 100644 --- a/client/src/pages/auth/Register/showRegReponse.tsx +++ b/client/src/pages/auth/Register/showRegReponse.tsx @@ -1,4 +1,3 @@ -import React from 'react'; import InnerHTML from 'dangerously-set-html-content'; import { RegistrationUser } from '../../../interfaces/User'; diff --git a/client/src/pages/chat/Chat.tsx b/client/src/pages/chat/Chat.tsx index aa380abf..20daa155 100644 --- a/client/src/pages/chat/Chat.tsx +++ b/client/src/pages/chat/Chat.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import Header from '../main/Header/Header'; import ChatWidget from './ChatWidget'; diff --git a/client/src/pages/chat/ChatWidget.tsx b/client/src/pages/chat/ChatWidget.tsx index afdf4a7f..cd927b1d 100644 --- a/client/src/pages/chat/ChatWidget.tsx +++ b/client/src/pages/chat/ChatWidget.tsx @@ -1,4 +1,4 @@ -import React, { +import { ChangeEvent, FC, KeyboardEvent, diff --git a/client/src/pages/main/Contact.tsx b/client/src/pages/main/Contact.tsx index c0a3c98f..448679ad 100644 --- a/client/src/pages/main/Contact.tsx +++ b/client/src/pages/main/Contact.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import { useEffect } from 'react'; import { sendSupportEmailRequest } from 'src/api/httpClient'; export const Contact = (props: { mapTitle: string | null }) => { diff --git a/client/src/pages/main/Counts.tsx b/client/src/pages/main/Counts.tsx index f5541fb3..7c5c38b5 100644 --- a/client/src/pages/main/Counts.tsx +++ b/client/src/pages/main/Counts.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; export const Counts: FC = () => { const counters = [ diff --git a/client/src/pages/main/FAQ.tsx b/client/src/pages/main/FAQ.tsx index 859e5d95..e6df8839 100644 --- a/client/src/pages/main/FAQ.tsx +++ b/client/src/pages/main/FAQ.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; export const FAQ: FC = () => { const FAQItems = [ diff --git a/client/src/pages/main/Footer.tsx b/client/src/pages/main/Footer.tsx index 29ba528c..a50c7f44 100644 --- a/client/src/pages/main/Footer.tsx +++ b/client/src/pages/main/Footer.tsx @@ -1,4 +1,4 @@ -import React, { FC, FormEvent, useEffect, useState } from 'react'; +import { FC, FormEvent, useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; import InnerHTML from 'dangerously-set-html-content'; import { postRender, postSubscriptions } from '../../api/httpClient'; diff --git a/client/src/pages/main/Header/Header.tsx b/client/src/pages/main/Header/Header.tsx index 5227442d..114b16ed 100644 --- a/client/src/pages/main/Header/Header.tsx +++ b/client/src/pages/main/Header/Header.tsx @@ -1,4 +1,4 @@ -import React, { FC, useEffect } from 'react'; +import { FC, useEffect } from 'react'; import { Link } from 'react-router-dom'; import { goTo, postMetadata, getSpawnData } from '../../../api/httpClient'; import Nav from './Nav'; diff --git a/client/src/pages/main/Header/Nav.tsx b/client/src/pages/main/Header/Nav.tsx index 29d9c604..b767cc1d 100644 --- a/client/src/pages/main/Header/Nav.tsx +++ b/client/src/pages/main/Header/Nav.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import { getAdminStatus } from '../../../api/httpClient'; import { RoutePath } from '../../../router/RoutePath'; interface MenuItem { diff --git a/client/src/pages/main/Header/Sign.tsx b/client/src/pages/main/Header/Sign.tsx index 73069e59..93ed6986 100644 --- a/client/src/pages/main/Header/Sign.tsx +++ b/client/src/pages/main/Header/Sign.tsx @@ -1,4 +1,4 @@ -import React, { ChangeEvent, FC, useEffect, useState } from 'react'; +import { ChangeEvent, FC, useEffect, useState } from 'react'; import { Link } from 'react-router-dom'; import { Buffer } from 'buffer'; import { fileTypeFromBuffer } from 'file-type/core'; diff --git a/client/src/pages/main/Hero.tsx b/client/src/pages/main/Hero.tsx index fb10b887..868010b9 100644 --- a/client/src/pages/main/Hero.tsx +++ b/client/src/pages/main/Hero.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; export const Hero: FC = () => { return ( diff --git a/client/src/pages/main/Main.tsx b/client/src/pages/main/Main.tsx index 9573c453..cb0a7695 100644 --- a/client/src/pages/main/Main.tsx +++ b/client/src/pages/main/Main.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import Marketplace from '../marketplace/Marketplace'; import Counts from './Counts'; import Hero from './Hero'; diff --git a/client/src/pages/main/Userprofile.tsx b/client/src/pages/main/Userprofile.tsx index f1807015..f3375d31 100644 --- a/client/src/pages/main/Userprofile.tsx +++ b/client/src/pages/main/Userprofile.tsx @@ -1,4 +1,4 @@ -import React, { FormEvent, useEffect, useState } from 'react'; +import { FormEvent, useEffect, useState } from 'react'; import { Navigate } from 'react-router'; import { getAdminStatus, diff --git a/client/src/pages/marketplace/DatePicker.tsx b/client/src/pages/marketplace/DatePicker.tsx index 906356bf..30c1523f 100644 --- a/client/src/pages/marketplace/DatePicker.tsx +++ b/client/src/pages/marketplace/DatePicker.tsx @@ -1,4 +1,4 @@ -import React, { useState } from 'react'; +import { FC, useState } from 'react'; import DatePicker from 'react-datepicker'; import 'react-datepicker/dist/react-datepicker.css'; @@ -6,7 +6,7 @@ interface DateRangePickerProps { onDatesChange: (dateFrom: Date, dateTo: Date) => void; } -const DateRangePicker: React.FC = ({ onDatesChange }) => { +const DateRangePicker: FC = ({ onDatesChange }) => { const [dates, setDates] = useState<{ dateFrom: Date; dateTo: Date; diff --git a/client/src/pages/marketplace/Marketplace.tsx b/client/src/pages/marketplace/Marketplace.tsx index a030c23d..179a83cd 100644 --- a/client/src/pages/marketplace/Marketplace.tsx +++ b/client/src/pages/marketplace/Marketplace.tsx @@ -1,4 +1,4 @@ -import React, { ChangeEvent, FC, useEffect, useState } from 'react'; +import { ChangeEvent, FC, MouseEvent, useEffect, useState } from 'react'; import { Product } from '../../interfaces/Product'; import { getProducts, @@ -37,7 +37,7 @@ export const Marketplace: FC = (props: Props) => { }); }; - const onGetFile = (e: React.MouseEvent) => { + const onGetFile = (e: MouseEvent) => { e.preventDefault(); getFile(`${path}${fileName}`).then((blob) => { const url = window.URL.createObjectURL(new Blob([blob])); diff --git a/client/src/pages/marketplace/Partners/Partners.tsx b/client/src/pages/marketplace/Partners/Partners.tsx index 9fab3605..fb42081d 100644 --- a/client/src/pages/marketplace/Partners/Partners.tsx +++ b/client/src/pages/marketplace/Partners/Partners.tsx @@ -1,4 +1,4 @@ -import React, { FC, useEffect, useState } from 'react'; +import { FC, useEffect, useState } from 'react'; import { DOMParser } from 'xmldom'; import OwlCarousel from 'react-owl-carousel'; diff --git a/client/src/pages/marketplace/ProductView.tsx b/client/src/pages/marketplace/ProductView.tsx index ddc4d46c..efc54285 100644 --- a/client/src/pages/marketplace/ProductView.tsx +++ b/client/src/pages/marketplace/ProductView.tsx @@ -1,4 +1,4 @@ -import React, { FC, useEffect } from 'react'; +import { FC, useEffect } from 'react'; import { Product } from '../../interfaces/Product'; import { viewProduct } from '../../api/httpClient'; diff --git a/client/src/pages/marketplace/Testimonials/Testimonials.tsx b/client/src/pages/marketplace/Testimonials/Testimonials.tsx index 1b100e9f..a4ddea32 100644 --- a/client/src/pages/marketplace/Testimonials/Testimonials.tsx +++ b/client/src/pages/marketplace/Testimonials/Testimonials.tsx @@ -1,4 +1,4 @@ -import React, { FC, useEffect, useState } from 'react'; +import { FC, useEffect, useState } from 'react'; import { getTestimonials, getTestimonialsCount } from '../../../api/httpClient'; import { Testimonial } from '../../../interfaces/Testimonial'; import OwlCarousel from 'react-owl-carousel'; diff --git a/client/src/pages/marketplace/Testimonials/TestimonialsForm.tsx b/client/src/pages/marketplace/Testimonials/TestimonialsForm.tsx index 0b5bf4d1..2eb74588 100644 --- a/client/src/pages/marketplace/Testimonials/TestimonialsForm.tsx +++ b/client/src/pages/marketplace/Testimonials/TestimonialsForm.tsx @@ -1,10 +1,4 @@ -import React, { - Dispatch, - FC, - FormEvent, - SetStateAction, - useState -} from 'react'; +import { Dispatch, FC, FormEvent, SetStateAction, useState } from 'react'; import { postTestimonials } from '../../../api/httpClient'; import { Testimonial } from '../../../interfaces/Testimonial'; diff --git a/client/src/pages/marketplace/Testimonials/TestimonialsItems.tsx b/client/src/pages/marketplace/Testimonials/TestimonialsItems.tsx index 932a3828..a0bf3272 100644 --- a/client/src/pages/marketplace/Testimonials/TestimonialsItems.tsx +++ b/client/src/pages/marketplace/Testimonials/TestimonialsItems.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import InnerHTML from 'dangerously-set-html-content'; import { Testimonial } from '../../../interfaces/Testimonial'; diff --git a/client/src/router/AppRoutes.tsx b/client/src/router/AppRoutes.tsx index 3db292fd..7423a40d 100644 --- a/client/src/router/AppRoutes.tsx +++ b/client/src/router/AppRoutes.tsx @@ -1,4 +1,4 @@ -import React, { FC } from 'react'; +import { FC } from 'react'; import { Route, Routes, Navigate } from 'react-router-dom'; import { RoutePath } from './RoutePath'; import Main from '../pages/main/Main'; diff --git a/client/tsconfig.json b/client/tsconfig.json index 0193cb4e..bfd8585e 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -1,8 +1,8 @@ { "compilerOptions": { "typeRoots": ["./typings", "./node_modules/@types"], - "jsx": "react", - "target": "es5", + "jsx": "react-jsx", + "target": "es6", "module": "esnext", "baseUrl": ".", "strict": true,