Fix/vite tsconfig setup (#404)

* Use "create-vite"s tsconfig files setup

The previous tsconfig file caused issues with vite throwing "missing identifiers of modules" errors

* Remove unused React imports

Starting with React 17 the nex JSX transform is being used
This commit is contained in:
schroda
2023-08-14 21:43:06 +02:00
committed by GitHub
parent 637118ad7a
commit 48fe8d23e9
42 changed files with 81 additions and 65 deletions

View File

@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import React from 'react';
import { forwardRef } from 'react';
import { Box, styled } from '@mui/material';
import { IReaderSettings } from '@/typings';
@@ -26,7 +26,7 @@ interface IProps {
settings: IReaderSettings;
}
const DoublePage = React.forwardRef((props: IProps, ref: any) => {
const DoublePage = forwardRef((props: IProps, ref: any) => {
const { image1src, image2src, index, settings } = props;
return (

View File

@@ -6,17 +6,17 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import React, { useRef } from 'react';
import { useState, useEffect, forwardRef, useRef } from 'react';
import Box from '@mui/material/Box';
import { IReaderSettings } from '@/typings';
import SpinnerImage from '@/components/util/SpinnerImage';
function imageStyle(settings: IReaderSettings): any {
const [dimensions, setDimensions] = React.useState({
const [dimensions, setDimensions] = useState({
height: window.innerHeight,
width: window.innerWidth,
});
React.useEffect(() => {
useEffect(() => {
function handleResize() {
setDimensions({
height: window.innerHeight,
@@ -65,7 +65,7 @@ interface IProps {
settings: IReaderSettings;
}
const Page = React.forwardRef((props: IProps, ref: any) => {
const Page = forwardRef((props: IProps, ref: any) => {
const { src, index, onImageLoad, settings } = props;
const imgRef = useRef<HTMLImageElement>(null);

View File

@@ -6,7 +6,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import React from 'react';
import { Box } from '@mui/material';
import { IReaderSettings } from '@/typings';

View File

@@ -10,7 +10,6 @@ import { List, ListItem, ListItemText, Switch } from '@mui/material';
import ListItemSecondaryAction from '@mui/material/ListItemSecondaryAction';
import Select from '@mui/material/Select';
import MenuItem from '@mui/material/MenuItem';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { IReaderSettings } from '@/typings';

View File

@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import React, { useEffect, useRef } from 'react';
import { useEffect, useRef } from 'react';
import { Box } from '@mui/material';
import { createRoot } from 'react-dom/client';
import { IReaderProps } from '@/typings';

View File

@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import React, { useEffect, useRef } from 'react';
import { useEffect, useRef } from 'react';
import { Box } from '@mui/material';
import { IReaderProps } from '@/typings';
import Page from '@/components/reader/Page';

View File

@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import React, { useEffect, useRef } from 'react';
import { useEffect, useRef } from 'react';
import { Box } from '@mui/material';
import { IReaderProps } from '@/typings';
import Page from '@/components/reader/Page';

View File

@@ -6,7 +6,7 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import React, { useCallback, useEffect, useRef } from 'react';
import { useCallback, useEffect, useRef } from 'react';
import { Box } from '@mui/material';
import { IReaderProps } from '@/typings';
import Page from '@/components/reader/Page';