cleanup: wip part 2
We have a working vite config now
This commit is contained in:
parent
2b196a95a8
commit
ae71d36c7f
|
|
@ -79,6 +79,7 @@
|
|||
"postcss": "^8.4.35",
|
||||
"typescript": "^5.3.3",
|
||||
"vite": "^5.1.4",
|
||||
"vite-plugin-top-level-await": "^1.4.1",
|
||||
"vite-plugin-wasm": "^3.3.0",
|
||||
"vitest": "^1.3.1",
|
||||
"xo": "^0.57.0"
|
||||
|
|
@ -109,6 +110,7 @@
|
|||
"extends": [
|
||||
"xo",
|
||||
"xo-react",
|
||||
"plugin:react/jsx-runtime",
|
||||
"./node_modules/xo/config/plugins.cjs"
|
||||
],
|
||||
"rules": {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/** @jsxImportSource @emotion/react */
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import Reaptcha from 'reaptcha';
|
||||
import {emit, on} from '@/scripts/event';
|
||||
import {t} from '@/scripts/i18n';
|
||||
|
|
|
|||
|
|
@ -1,17 +1,17 @@
|
|||
import React from 'react';
|
||||
import {t} from '@/scripts/i18n';
|
||||
|
||||
const ViewerSkeleton: React.FC = () => (
|
||||
<div className='card'>
|
||||
<div className='card-header'>
|
||||
<div className='d-flex justify-content-between'>
|
||||
<h3 className='card-title'>
|
||||
<span>{t('general.texturePreview')}</span>
|
||||
</h3>
|
||||
export default function ViewerSkeleton() {
|
||||
return (
|
||||
<div className='card'>
|
||||
<div className='card-header'>
|
||||
<div className='d-flex justify-content-between'>
|
||||
<h3 className='card-title'>
|
||||
<span>{t('general.texturePreview')}</span>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div className='card-body'/>
|
||||
</div>
|
||||
<div className='card-body'/>
|
||||
</div>
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
export default ViewerSkeleton;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ type ToastQueue = QueueElement[];
|
|||
const TOAST_EVENT = Symbol('toast');
|
||||
const CLEAR_EVENT = Symbol('clear');
|
||||
|
||||
export const ToastContainer: React.FC = () => {
|
||||
export function ToastContainer() {
|
||||
const [queue, setQueue] = useState<ToastQueue>([]);
|
||||
|
||||
const handleClose = (id: string) => {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import Skeleton from 'react-loading-skeleton';
|
||||
import clsx from 'clsx';
|
||||
|
|
@ -10,28 +9,28 @@ const ShrinkedSkeleton = styled(Skeleton)<{width?: string}>`
|
|||
width: ${properties => properties.width};
|
||||
`;
|
||||
|
||||
const LoadingCard: React.FC = () => (
|
||||
<Box className={clsx('info-box', {'bg-gray-dark': isDarkMode})}>
|
||||
<div className='info-box-icon'>
|
||||
<Skeleton circle height={50} width={50}/>
|
||||
</div>
|
||||
<div className='info-box-content'>
|
||||
<div className='row'>
|
||||
<div className='col-10'>
|
||||
<ShrinkedSkeleton width='120px'/>
|
||||
</div>
|
||||
<div className='col-2'/>
|
||||
export default function LoadingCard() {
|
||||
return (
|
||||
<Box className={clsx('info-box', {'bg-gray-dark': isDarkMode})}>
|
||||
<div className='info-box-icon'>
|
||||
<Skeleton circle height={50} width={50}/>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<ShrinkedSkeleton width='150px'/>
|
||||
<div className='info-box-content'>
|
||||
<div className='row'>
|
||||
<div className='col-10'>
|
||||
<ShrinkedSkeleton width='120px'/>
|
||||
</div>
|
||||
<div className='col-2'/>
|
||||
</div>
|
||||
<div>
|
||||
<ShrinkedSkeleton width='180px'/>
|
||||
<div>
|
||||
<ShrinkedSkeleton width='150px'/>
|
||||
</div>
|
||||
<div>
|
||||
<ShrinkedSkeleton width='180px'/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Box>
|
||||
);
|
||||
|
||||
export default LoadingCard;
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import Skeleton from 'react-loading-skeleton';
|
||||
|
||||
|
|
@ -6,12 +5,12 @@ const ThickSkeleton = styled(Skeleton)`
|
|||
line-height: 2;
|
||||
`;
|
||||
|
||||
const LoadingRow: React.FC = () => (
|
||||
<tr>
|
||||
<td colSpan={6}>
|
||||
<ThickSkeleton/>
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
|
||||
export default LoadingRow;
|
||||
export default function LoadingRow() {
|
||||
return (
|
||||
<tr>
|
||||
<td colSpan={6}>
|
||||
<ThickSkeleton/>
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, {useState, useEffect, useLayoutEffect} from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
;
|
||||
import {useImmer} from 'use-immer';
|
||||
import Header from '../UsersManagement/Header';
|
||||
import Card from './Card';
|
||||
|
|
@ -15,7 +15,7 @@ import {toast, showModal} from '@/scripts/notify';
|
|||
import urls from '@/scripts/urls';
|
||||
import Pagination from '@/components/Pagination';
|
||||
|
||||
const PlayersManagement: React.FC = () => {
|
||||
function PlayersManagement() {
|
||||
const [players, setPlayers] = useImmer<Player[]>([]);
|
||||
const [page, setPage] = useState(1);
|
||||
const [totalPages, setTotalPages] = useState(1);
|
||||
|
|
@ -274,4 +274,4 @@ const PlayersManagement: React.FC = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default hot(PlayersManagement);
|
||||
export default PlayersManagement;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, {useState, useEffect} from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
;
|
||||
import {useImmer} from 'use-immer';
|
||||
import InfoBox from './InfoBox';
|
||||
import type {Plugin} from './types';
|
||||
|
|
@ -9,7 +9,7 @@ import {toast, showModal} from '@/scripts/notify';
|
|||
import FileInput from '@/components/FileInput';
|
||||
import Loading from '@/components/Loading';
|
||||
|
||||
const PluginsManagement: React.FC = () => {
|
||||
function PluginsManagement() {
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [plugins, setPlugins] = useImmer<Plugin[]>([]);
|
||||
const [file, setFile] = useState<File | undefined>(null);
|
||||
|
|
@ -245,4 +245,4 @@ const PluginsManagement: React.FC = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default hot(PluginsManagement);
|
||||
export default PluginsManagement;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, {useState, useEffect, useMemo} from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
import {useState, useEffect, useMemo} from 'react';
|
||||
import {enableMapSet} from 'immer';
|
||||
import {useImmer} from 'use-immer';
|
||||
import type {Plugin} from './types';
|
||||
|
|
@ -12,7 +11,7 @@ import Pagination from '@/components/Pagination';
|
|||
|
||||
enableMapSet();
|
||||
|
||||
const PluginsMarket: React.FC = () => {
|
||||
export default function PluginsMarket() {
|
||||
const [plugins, setPlugins] = useImmer<Plugin[]>([]);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [search, setSearch] = useState('');
|
||||
|
|
@ -38,7 +37,7 @@ const PluginsMarket: React.FC = () => {
|
|||
setIsLoading(false);
|
||||
};
|
||||
|
||||
getPlugins();
|
||||
void getPlugins();
|
||||
}, []);
|
||||
|
||||
const handleSearchChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
||||
|
|
@ -74,7 +73,7 @@ const PluginsMarket: React.FC = () => {
|
|||
plugins[index].installed = plugins[index].version;
|
||||
});
|
||||
} else {
|
||||
showModal({
|
||||
void showModal({
|
||||
mode: 'alert',
|
||||
children: (
|
||||
<div>
|
||||
|
|
@ -107,7 +106,7 @@ const PluginsMarket: React.FC = () => {
|
|||
return;
|
||||
}
|
||||
|
||||
handleInstall(plugin, index);
|
||||
void handleInstall(plugin, index);
|
||||
};
|
||||
|
||||
const pagedPlugins = searchedPlugins.slice((page - 1) * 10, page * 10);
|
||||
|
|
@ -148,8 +147,8 @@ const PluginsMarket: React.FC = () => {
|
|||
key={plugin.name}
|
||||
plugin={plugin}
|
||||
isInstalling={installings.has(plugin.name)}
|
||||
onInstall={async () => handleInstall(plugin, (page - 1) * 10 + i)}
|
||||
onUpdate={async () => handleUpdate(plugin, (page - 1) * 10 + i)}
|
||||
onInstall={async () => handleInstall(plugin, ((page - 1) * 10) + i)}
|
||||
onUpdate={async () => handleUpdate(plugin, ((page - 1) * 10) + i)}
|
||||
/>
|
||||
))}
|
||||
</tbody>
|
||||
|
|
@ -163,6 +162,5 @@ const PluginsMarket: React.FC = () => {
|
|||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export default hot(PluginsMarket);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, {useState, useEffect} from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
;
|
||||
import {useImmer} from 'use-immer';
|
||||
import type {Report, Status} from './types';
|
||||
import ImageBox from './ImageBox';
|
||||
|
|
@ -13,7 +13,7 @@ import ViewerSkeleton from '@/components/ViewerSkeleton';
|
|||
|
||||
const Previewer = React.lazy(async () => import('@/components/Viewer'));
|
||||
|
||||
const ReportsManagement: React.FC = () => {
|
||||
function ReportsManagement() {
|
||||
const [reports, setReports] = useImmer<Report[]>([]);
|
||||
const [page, setPage] = useState(1);
|
||||
const [totalPages, setTotalPages] = useState(1);
|
||||
|
|
@ -152,4 +152,4 @@ const ReportsManagement: React.FC = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default hot(ReportsManagement);
|
||||
export default ReportsManagement;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, {useState, useEffect} from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
;
|
||||
import {useImmer} from 'use-immer';
|
||||
import type {Line} from './types';
|
||||
import Row from './Row';
|
||||
|
|
@ -10,7 +10,7 @@ import type {Paginator} from '@/scripts/types';
|
|||
import Loading from '@/components/Loading';
|
||||
import Pagination from '@/components/Pagination';
|
||||
|
||||
const Translations: React.FC = () => {
|
||||
function Translations() {
|
||||
const [lines, setLines] = useImmer<Line[]>([]);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [page, setPage] = useState(1);
|
||||
|
|
@ -118,4 +118,4 @@ const Translations: React.FC = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default hot(Translations);
|
||||
export default Translations;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import Skeleton from 'react-loading-skeleton';
|
||||
import clsx from 'clsx';
|
||||
|
|
@ -11,51 +10,51 @@ const ShrinkedSkeleton = styled(Skeleton)<{width?: string}>`
|
|||
|
||||
const isDarkMode = document.body.classList.contains('dark-mode');
|
||||
|
||||
const LoadingCard: React.FC = () => (
|
||||
<Box className={clsx('info-box', {'bg-gray-dark': isDarkMode})}>
|
||||
<Icon>
|
||||
<Skeleton circle height={50} width={50}/>
|
||||
</Icon>
|
||||
<div className='info-box-content'>
|
||||
<div className='row'>
|
||||
<div className='col-10'>
|
||||
<Skeleton width='140px'/>
|
||||
</div>
|
||||
<div className='col-2'/>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
<Skeleton width='140px'/>
|
||||
export default function LoadingCard() {
|
||||
return (
|
||||
<Box className={clsx('info-box', {'bg-gray-dark': isDarkMode})}>
|
||||
<Icon>
|
||||
<Skeleton circle height={50} width={50}/>
|
||||
</Icon>
|
||||
<div className='info-box-content'>
|
||||
<div className='row'>
|
||||
<div className='col-10'>
|
||||
<Skeleton width='140px'/>
|
||||
</div>
|
||||
<div className='col-2'/>
|
||||
</div>
|
||||
<div>
|
||||
<Skeleton width='140px'/>
|
||||
</div>
|
||||
<InfoTable className='row m-2 border-top border-bottom'>
|
||||
<div className='col-sm-4 py-1 text-center'>
|
||||
<b className='d-block'>{t('general.user.score')}</b>
|
||||
<span className='d-block py-1'>
|
||||
<ShrinkedSkeleton width='30%'/>
|
||||
</span>
|
||||
<div>
|
||||
<Skeleton width='140px'/>
|
||||
</div>
|
||||
<div className='col-sm-4 py-1 text-center'>
|
||||
<b className='d-block'>{t('admin.permission')}</b>
|
||||
<span className='d-block py-1'>
|
||||
<ShrinkedSkeleton width='30%'/>
|
||||
</span>
|
||||
<div>
|
||||
<Skeleton width='140px'/>
|
||||
</div>
|
||||
<div className='col-sm-4 py-1 text-center'>
|
||||
<b className='d-block'>{t('admin.verification')}</b>
|
||||
<span className='d-block py-1'>
|
||||
<ShrinkedSkeleton width='30%'/>
|
||||
</span>
|
||||
<InfoTable className='row m-2 border-top border-bottom'>
|
||||
<div className='col-sm-4 py-1 text-center'>
|
||||
<b className='d-block'>{t('general.user.score')}</b>
|
||||
<span className='d-block py-1'>
|
||||
<ShrinkedSkeleton width='30%'/>
|
||||
</span>
|
||||
</div>
|
||||
<div className='col-sm-4 py-1 text-center'>
|
||||
<b className='d-block'>{t('admin.permission')}</b>
|
||||
<span className='d-block py-1'>
|
||||
<ShrinkedSkeleton width='30%'/>
|
||||
</span>
|
||||
</div>
|
||||
<div className='col-sm-4 py-1 text-center'>
|
||||
<b className='d-block'>{t('admin.verification')}</b>
|
||||
<span className='d-block py-1'>
|
||||
<ShrinkedSkeleton width='30%'/>
|
||||
</span>
|
||||
</div>
|
||||
</InfoTable>
|
||||
<div>
|
||||
<Skeleton width='180px'/>
|
||||
</div>
|
||||
</InfoTable>
|
||||
<div>
|
||||
<Skeleton width='180px'/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Box>
|
||||
);
|
||||
|
||||
export default LoadingCard;
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import Skeleton from 'react-loading-skeleton';
|
||||
|
||||
|
|
@ -6,12 +5,12 @@ const ThickSkeleton = styled(Skeleton)`
|
|||
line-height: 2;
|
||||
`;
|
||||
|
||||
const LoadingRow: React.FC = () => (
|
||||
<tr>
|
||||
<td colSpan={8}>
|
||||
<ThickSkeleton/>
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
|
||||
export default LoadingRow;
|
||||
export default function LoadingRow() {
|
||||
return (
|
||||
<tr>
|
||||
<td colSpan={8}>
|
||||
<ThickSkeleton/>
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, {useState, useEffect, useLayoutEffect} from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
;
|
||||
import {useImmer} from 'use-immer';
|
||||
import Header from './Header';
|
||||
import Card from './Card';
|
||||
|
|
@ -16,7 +16,7 @@ import urls from '@/scripts/urls';
|
|||
import type {Props as ModalInputProperties} from '@/components/ModalInput';
|
||||
import Pagination from '@/components/Pagination';
|
||||
|
||||
const UsersManagement: React.FC = () => {
|
||||
function UsersManagement() {
|
||||
const [users, setUsers] = useImmer<User[]>([]);
|
||||
const [page, setPage] = useState(1);
|
||||
const [totalPages, setTotalPages] = useState(1);
|
||||
|
|
@ -366,4 +366,4 @@ const UsersManagement: React.FC = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default hot(UsersManagement);
|
||||
export default UsersManagement;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, {useState, useRef} from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
import {useState, useRef} from 'react';
|
||||
import useEmitMounted from '@/scripts/hooks/useEmitMounted';
|
||||
import {t} from '@/scripts/i18n';
|
||||
import * as fetch from '@/scripts/net';
|
||||
|
|
@ -8,12 +7,12 @@ import Alert from '@/components/Alert';
|
|||
import Captcha from '@/components/Captcha';
|
||||
import EmailSuggestion from '@/components/EmailSuggestion';
|
||||
|
||||
const Forgot: React.FC = () => {
|
||||
export default function Forgot() {
|
||||
const [email, setEmail] = useState('');
|
||||
const [isSending, setIsSending] = useState(false);
|
||||
const [successMessage, setSuccessMessage] = useState('');
|
||||
const [warningMessage, setWarningMessage] = useState('');
|
||||
const reference = useRef<Captcha | undefined>(null);
|
||||
const reference = useRef<Captcha | null>(null);
|
||||
|
||||
useEmitMounted();
|
||||
|
||||
|
|
@ -70,6 +69,4 @@ const Forgot: React.FC = () => {
|
|||
</div>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
export default hot(Forgot);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, {useState, useRef, useEffect} from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
import useBlessingExtra from '@/scripts/hooks/useBlessingExtra';
|
||||
import useEmitMounted from '@/scripts/hooks/useEmitMounted';
|
||||
import {t} from '@/scripts/i18n';
|
||||
|
|
@ -28,14 +27,14 @@ function isSuccessfulResponse(
|
|||
return response.code === 0;
|
||||
}
|
||||
|
||||
const Login: React.FC = () => {
|
||||
export default function Login() {
|
||||
const [identification, setIdentification] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const [remember, setRemember] = useState(false);
|
||||
const [hasTooManyFails, setHasTooManyFails] = useState(false);
|
||||
const [isPending, setIsPending] = useState(false);
|
||||
const [warningMessage, setWarningMessage] = useState('');
|
||||
const reference = useRef<Captcha | undefined>(null);
|
||||
const reference = useRef<Captcha | null>(null);
|
||||
const recaptcha = useBlessingExtra<string>('recaptcha');
|
||||
const invisibleRecaptcha = useBlessingExtra<boolean>('invisible');
|
||||
|
||||
|
|
@ -77,13 +76,13 @@ const Login: React.FC = () => {
|
|||
if (recaptcha) {
|
||||
// No need to notify if using invisible recaptcha
|
||||
if (!invisibleRecaptcha) {
|
||||
showModal({
|
||||
void showModal({
|
||||
mode: 'alert',
|
||||
text: t('auth.tooManyFails.recaptcha'),
|
||||
});
|
||||
}
|
||||
} else {
|
||||
showModal({
|
||||
void showModal({
|
||||
mode: 'alert',
|
||||
text: t('auth.tooManyFails.captcha'),
|
||||
});
|
||||
|
|
@ -152,6 +151,4 @@ const Login: React.FC = () => {
|
|||
</button>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
export default hot(Login);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, {useState, useRef} from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
import {useState, useRef} from 'react';
|
||||
import useBlessingExtra from '@/scripts/hooks/useBlessingExtra';
|
||||
import useEmitMounted from '@/scripts/hooks/useEmitMounted';
|
||||
import {t} from '@/scripts/i18n';
|
||||
|
|
@ -10,7 +9,7 @@ import Alert from '@/components/Alert';
|
|||
import Captcha from '@/components/Captcha';
|
||||
import EmailSuggestion from '@/components/EmailSuggestion';
|
||||
|
||||
const Registration: React.FC = () => {
|
||||
export default function Registration() {
|
||||
const [email, setEmail] = useState('');
|
||||
const [password, setPassword] = useState('');
|
||||
const [confirmation, setConfirmation] = useState('');
|
||||
|
|
@ -174,6 +173,4 @@ const Registration: React.FC = () => {
|
|||
</div>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
|
||||
export default hot(Registration);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import React, {useState} from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
import {useState} from 'react';
|
||||
import useEmitMounted from '@/scripts/hooks/useEmitMounted';
|
||||
import {t} from '@/scripts/i18n';
|
||||
import * as fetch from '@/scripts/net';
|
||||
|
|
@ -7,7 +6,7 @@ import {toast} from '@/scripts/notify';
|
|||
import urls from '@/scripts/urls';
|
||||
import Alert from '@/components/Alert';
|
||||
|
||||
const Reset: React.FC = () => {
|
||||
export default function Reset() {
|
||||
const [password, setPassword] = useState('');
|
||||
const [confirmation, setConfirmation] = useState('');
|
||||
const [warningMessage, setWarningMessage] = useState('');
|
||||
|
|
@ -106,6 +105,5 @@ const Reset: React.FC = () => {
|
|||
</button>
|
||||
</form>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export default hot(Reset);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React, {useState, useEffect} from 'react';
|
||||
import {createPortal} from 'react-dom';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
;
|
||||
import Skeleton from 'react-loading-skeleton';
|
||||
import addClosetItem from './addClosetItem';
|
||||
import useBlessingExtra from '@/scripts/hooks/useBlessingExtra';
|
||||
|
|
@ -24,7 +24,7 @@ export type Badge = {
|
|||
|
||||
const Previewer = React.lazy(async () => import('@/components/Viewer'));
|
||||
|
||||
const Show: React.FC = () => {
|
||||
function Show() {
|
||||
const [texture, setTexture] = useState<Texture>({} as Texture);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [showModalApply, setShowModalApply] = useState(false);
|
||||
|
|
@ -495,4 +495,4 @@ const Show: React.FC = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default hot(Show);
|
||||
export default Show;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, {useState, useEffect} from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
;
|
||||
import addClosetItem from '../Show/addClosetItem';
|
||||
import FilterSelector from './FilterSelector';
|
||||
import Button from './Button';
|
||||
|
|
@ -16,7 +16,7 @@ import Loading from '@/components/Loading';
|
|||
import Pagination from '@/components/Pagination';
|
||||
import removeClosetItem from '@/views/user/Closet/removeClosetItem';
|
||||
|
||||
const SkinLibrary: React.FC = () => {
|
||||
function SkinLibrary() {
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [items, setItems] = useState<LibraryItem[]>([]);
|
||||
const [closet, setCloset] = useState<number[]>([]);
|
||||
|
|
@ -301,4 +301,4 @@ const SkinLibrary: React.FC = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default hot(SkinLibrary);
|
||||
export default SkinLibrary;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import React, {useState} from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
;
|
||||
import {t} from '@/scripts/i18n';
|
||||
import useBlessingExtra from '@/scripts/hooks/useBlessingExtra';
|
||||
import useEmitMounted from '@/scripts/hooks/useEmitMounted';
|
||||
|
|
@ -15,7 +15,7 @@ import ViewerSkeleton from '@/components/ViewerSkeleton';
|
|||
|
||||
const Previewer = React.lazy(async () => import('@/components/Viewer'));
|
||||
|
||||
const Upload: React.FC = () => {
|
||||
function Upload() {
|
||||
const [name, setName] = useState('');
|
||||
const [type, setType] = useState(TextureType.Steve);
|
||||
const [isPrivate, setIsPrivate] = useState(false);
|
||||
|
|
@ -257,4 +257,4 @@ const Upload: React.FC = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default hot(Upload);
|
||||
export default Upload;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import Skeleton from 'react-loading-skeleton';
|
||||
import {Card, DropdownButton} from './styles';
|
||||
|
|
@ -7,20 +6,20 @@ const ItemNameSkeleton = styled(Skeleton)`
|
|||
width: 150px;
|
||||
`;
|
||||
|
||||
const LoadingClosetItem: React.FC = () => (
|
||||
<Card className='card mr-3 mb-3'>
|
||||
<div className='card-body'/>
|
||||
<div className='card-footer pb-2 pt-2 pl-1 pr-1'>
|
||||
<div className='container d-flex justify-content-between'>
|
||||
<ItemNameSkeleton/>
|
||||
<span className='d-inline-block'>
|
||||
<DropdownButton>
|
||||
<i className='fas fa-cog'/>
|
||||
</DropdownButton>
|
||||
</span>
|
||||
export default function LoadingClosetItem() {
|
||||
return (
|
||||
<Card className='card mr-3 mb-3'>
|
||||
<div className='card-body'/>
|
||||
<div className='card-footer pb-2 pt-2 pl-1 pr-1'>
|
||||
<div className='container d-flex justify-content-between'>
|
||||
<ItemNameSkeleton/>
|
||||
<span className='d-inline-block'>
|
||||
<DropdownButton>
|
||||
<i className='fas fa-cog'/>
|
||||
</DropdownButton>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Card>
|
||||
);
|
||||
|
||||
export default LoadingClosetItem;
|
||||
</Card>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -295,4 +295,4 @@ function Closet() {
|
|||
);
|
||||
}
|
||||
|
||||
export default hot(Closet);
|
||||
export default Closet;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import React, {useState, useEffect, useCallback} from 'react';
|
||||
import {useState, useEffect, useCallback} from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
import InfoBox from './InfoBox';
|
||||
import SignButton from './SignButton';
|
||||
import * as scoreUtils from './scoreUtils';
|
||||
|
|
@ -42,7 +41,7 @@ const ScoreNotice = styled.p`
|
|||
margin-top: 20px;
|
||||
`;
|
||||
|
||||
const Dashboard: React.FC = () => {
|
||||
export default function Dashboard() {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [players, setPlayers] = useState(0);
|
||||
const [storage, setStorage] = useState(0);
|
||||
|
|
@ -72,7 +71,7 @@ const Dashboard: React.FC = () => {
|
|||
setLoading(false);
|
||||
};
|
||||
|
||||
fetchInfo();
|
||||
void fetchInfo();
|
||||
}, []);
|
||||
|
||||
const handleSign = useCallback(async () => {
|
||||
|
|
@ -157,6 +156,5 @@ const Dashboard: React.FC = () => {
|
|||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
}
|
||||
|
||||
export default hot(Dashboard);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, {useState, useEffect} from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
;
|
||||
import Row from './Row';
|
||||
import ModalCreate from './ModalCreate';
|
||||
import type {App} from './types';
|
||||
|
|
@ -12,7 +12,7 @@ type Exception = {
|
|||
message: string;
|
||||
};
|
||||
|
||||
const OAuth: React.FC = () => {
|
||||
function OAuth() {
|
||||
const [apps, setApps] = useState<App[]>([]);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [showModalCreate, setShowModalCreate] = useState(false);
|
||||
|
|
@ -164,4 +164,4 @@ const OAuth: React.FC = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default hot(OAuth);
|
||||
export default OAuth;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import Skeleton from 'react-loading-skeleton';
|
||||
|
||||
|
|
@ -9,12 +8,12 @@ const ThickSkeleton = styled(Skeleton)`
|
|||
line-height: 2;
|
||||
`;
|
||||
|
||||
const RowLoading: React.FC = () => (
|
||||
<TableRow>
|
||||
<td colSpan={3}>
|
||||
<ThickSkeleton/>
|
||||
</td>
|
||||
</TableRow>
|
||||
);
|
||||
|
||||
export default RowLoading;
|
||||
export default function RowLoading() {
|
||||
return (
|
||||
<TableRow>
|
||||
<td colSpan={3}>
|
||||
<ThickSkeleton/>
|
||||
</td>
|
||||
</TableRow>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import React, {useState, useEffect} from 'react';
|
||||
import {hot} from 'react-hot-loader/root';
|
||||
;
|
||||
import Row from './Row';
|
||||
import LoadingRow from './LoadingRow';
|
||||
import Previewer from './Previewer';
|
||||
|
|
@ -14,7 +14,7 @@ import {showModal, toast} from '@/scripts/notify';
|
|||
import {type Player, TextureType} from '@/scripts/types';
|
||||
import urls from '@/scripts/urls';
|
||||
|
||||
const Players: React.FC = () => {
|
||||
function Players() {
|
||||
const [players, setPlayers] = useState<Player[]>([]);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [selected, setSelected] = useState(0);
|
||||
|
|
@ -253,4 +253,4 @@ const Players: React.FC = () => {
|
|||
);
|
||||
};
|
||||
|
||||
export default hot(Players);
|
||||
export default Players;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import {t} from '@/scripts/i18n';
|
|||
import * as fetch from '@/scripts/net';
|
||||
import {toast} from '@/scripts/notify';
|
||||
|
||||
const EmailVerification: React.FC = () => {
|
||||
function EmailVerification() {
|
||||
const [isSending, setIsSending] = useState(false);
|
||||
|
||||
const send = async () => {
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ export type Notification = {
|
|||
title: string;
|
||||
};
|
||||
|
||||
const NotificationsList: React.FC = () => {
|
||||
function NotificationsList() {
|
||||
const [notifications, setNotifications] = useState<Notification[]>([]);
|
||||
const [noUnreadText, setNoUnreadText] = useState('');
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import { render, fireEvent } from '@testing-library/react'
|
|||
import { on } from '@/scripts/event'
|
||||
import EmailSuggestion from '@/components/EmailSuggestion'
|
||||
|
||||
const Wrapper: React.FC = () => {
|
||||
function Wrapper() {
|
||||
const [email, setEmail] = useState('')
|
||||
|
||||
return <EmailSuggestion value={email} onChange={setEmail} />
|
||||
|
|
|
|||
|
|
@ -1,18 +1,22 @@
|
|||
import {defineConfig, splitVendorChunkPlugin} from 'vite';
|
||||
import react from '@vitejs/plugin-react-swc';
|
||||
import wasm from 'vite-plugin-wasm';
|
||||
import topLevelAwait from 'vite-plugin-top-level-await';
|
||||
import browserslistToEsbuild from 'browserslist-to-esbuild';
|
||||
|
||||
const root = new URL('resources/assets/src/', import.meta.url);
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
react(),
|
||||
wasm(),
|
||||
topLevelAwait(),
|
||||
splitVendorChunkPlugin(),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
'@/': new URL('resources/assets/src/', import.meta.url).pathname,
|
||||
readline: '@/scripts/cli/readline.ts',
|
||||
'@/': root.pathname,
|
||||
readline: new URL('scripts/cli/readline.ts', root).pathname,
|
||||
prompts: 'prompts/lib/index.js',
|
||||
},
|
||||
},
|
||||
|
|
|
|||
21
yarn.lock
21
yarn.lock
|
|
@ -448,6 +448,11 @@
|
|||
resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f"
|
||||
integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==
|
||||
|
||||
"@rollup/plugin-virtual@^3.0.2":
|
||||
version "3.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/plugin-virtual/-/plugin-virtual-3.0.2.tgz#17e17eeecb4c9fa1c0a6e72c9e5f66382fddbb82"
|
||||
integrity sha512-10monEYsBp3scM4/ND4LNH5Rxvh3e/cVeL3jWTgZ2SrQ+BmUoQcopVQvnaMcOnykb1VkxUFuDAN+0FnpTFRy2A==
|
||||
|
||||
"@rollup/rollup-android-arm-eabi@4.12.0":
|
||||
version "4.12.0"
|
||||
resolved "https://registry.yarnpkg.com/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.12.0.tgz#38c3abd1955a3c21d492af6b1a1dca4bb1d894d6"
|
||||
|
|
@ -573,7 +578,7 @@
|
|||
resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.4.2.tgz#c999ca7b68124d058b40a1431cdd6f56779670d5"
|
||||
integrity sha512-oV71rwiSpA5xre2C5570BhCsg1HF97SNLsZ/12xv7zayGzqr3yvFALFJN8tHKpqUdCB4FGPjoP3JFdV3i+1wUw==
|
||||
|
||||
"@swc/core@^1.3.107":
|
||||
"@swc/core@^1.3.100", "@swc/core@^1.3.107":
|
||||
version "1.4.2"
|
||||
resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.4.2.tgz#310b0d5e93e47ca72f54150c8f9efcb434c39b17"
|
||||
integrity sha512-vWgY07R/eqj1/a0vsRKLI9o9klGZfpLNOVEnrv4nrccxBgYPjcf22IWwAoaBJ+wpA7Q4fVjCUM8lP0m01dpxcg==
|
||||
|
|
@ -5887,6 +5892,11 @@ util-deprecate@~1.0.1:
|
|||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||
integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
|
||||
|
||||
uuid@^9.0.1:
|
||||
version "9.0.1"
|
||||
resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30"
|
||||
integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==
|
||||
|
||||
validate-npm-package-license@^3.0.1:
|
||||
version "3.0.4"
|
||||
resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"
|
||||
|
|
@ -5906,6 +5916,15 @@ vite-node@1.3.1:
|
|||
picocolors "^1.0.0"
|
||||
vite "^5.0.0"
|
||||
|
||||
vite-plugin-top-level-await@^1.4.1:
|
||||
version "1.4.1"
|
||||
resolved "https://registry.yarnpkg.com/vite-plugin-top-level-await/-/vite-plugin-top-level-await-1.4.1.tgz#607dfe084157550fa33df18062b99ceea774cd9c"
|
||||
integrity sha512-hogbZ6yT7+AqBaV6lK9JRNvJDn4/IJvHLu6ET06arNfo0t2IsyCaon7el9Xa8OumH+ESuq//SDf8xscZFE0rWw==
|
||||
dependencies:
|
||||
"@rollup/plugin-virtual" "^3.0.2"
|
||||
"@swc/core" "^1.3.100"
|
||||
uuid "^9.0.1"
|
||||
|
||||
vite-plugin-wasm@^3.3.0:
|
||||
version "3.3.0"
|
||||
resolved "https://registry.yarnpkg.com/vite-plugin-wasm/-/vite-plugin-wasm-3.3.0.tgz#2908ef2529bf8f33f4e549c8c6fda26ad273ca15"
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user