Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(client): switch to react-jsx transform option #386

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/index.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/auth/AdminLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, PropsWithChildren } from 'react';
import { FC, PropsWithChildren } from 'react';

export const AdminLayout: FC<PropsWithChildren> = ({ children }) => {
return (
Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/auth/AdminPage.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -9,7 +9,7 @@ export const AdminPage: FC = () => {
const [inputValue, setInputValue] = useState('');
const [users, setUsers] = useState<UserData[]>([]);

const onInput = (e: React.ChangeEvent<HTMLInputElement>) => {
const onInput = (e: ChangeEvent<HTMLInputElement>) => {
setInputValue(e.target.value);
};

Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/auth/AuthLayout.tsx
Original file line number Diff line number Diff line change
@@ -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;
};

Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/auth/Dashboard.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react';
import { FC } from 'react';
import AuthLayout from './AuthLayout';

export const Dashboard: FC = () => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/auth/Login/Login.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 0 additions & 1 deletion client/src/pages/auth/Login/showLdapReponse.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import { RegistrationUser } from '../../../interfaces/User';
import showRegResponse from '../Register/showRegReponse';

Expand Down
1 change: 0 additions & 1 deletion client/src/pages/auth/Login/showLoginReponse.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import InnerHTML from 'dangerously-set-html-content';
import { LoginResponse } from '../../../interfaces/User';

Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/auth/LoginNew/LoginNew.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/auth/LoginNew/PasswordCheck.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/auth/Register/Register.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
1 change: 0 additions & 1 deletion client/src/pages/auth/Register/showRegReponse.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import InnerHTML from 'dangerously-set-html-content';
import { RegistrationUser } from '../../../interfaces/User';

Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/chat/Chat.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react';
import { FC } from 'react';
import Header from '../main/Header/Header';
import ChatWidget from './ChatWidget';

Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/chat/ChatWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, {
import {
ChangeEvent,
FC,
KeyboardEvent,
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/main/Contact.tsx
Original file line number Diff line number Diff line change
@@ -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 }) => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/main/Counts.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react';
import { FC } from 'react';

export const Counts: FC = () => {
const counters = [
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/main/FAQ.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react';
import { FC } from 'react';

export const FAQ: FC = () => {
const FAQItems = [
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/main/Footer.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/main/Header/Header.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/main/Header/Nav.tsx
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/main/Header/Sign.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/main/Hero.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC } from 'react';
import { FC } from 'react';

export const Hero: FC = () => {
return (
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/main/Main.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/main/Userprofile.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FormEvent, useEffect, useState } from 'react';
import { FormEvent, useEffect, useState } from 'react';
import { Navigate } from 'react-router';
import {
getAdminStatus,
Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/marketplace/DatePicker.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useState } from 'react';
import { FC, useState } from 'react';
import DatePicker from 'react-datepicker';
import 'react-datepicker/dist/react-datepicker.css';

interface DateRangePickerProps {
onDatesChange: (dateFrom: Date, dateTo: Date) => void;
}

const DateRangePicker: React.FC<DateRangePickerProps> = ({ onDatesChange }) => {
const DateRangePicker: FC<DateRangePickerProps> = ({ onDatesChange }) => {
const [dates, setDates] = useState<{
dateFrom: Date;
dateTo: Date;
Expand Down
4 changes: 2 additions & 2 deletions client/src/pages/marketplace/Marketplace.tsx
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -37,7 +37,7 @@ export const Marketplace: FC<Props> = (props: Props) => {
});
};

const onGetFile = (e: React.MouseEvent<HTMLElement>) => {
const onGetFile = (e: MouseEvent<HTMLElement>) => {
e.preventDefault();
getFile(`${path}${fileName}`).then((blob) => {
const url = window.URL.createObjectURL(new Blob([blob]));
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/marketplace/Partners/Partners.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/marketplace/ProductView.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/marketplace/Testimonials/Testimonials.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion client/src/router/AppRoutes.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 2 additions & 2 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"compilerOptions": {
"typeRoots": ["./typings", "./node_modules/@types"],
"jsx": "react",
"target": "es5",
"jsx": "react-jsx",
"target": "es6",
"module": "esnext",
"baseUrl": ".",
"strict": true,
Expand Down