The CRA toolchain was several major versions behind and no longer maintained, so the whole build, lint and runtime stack is replaced. Converted XOOPS data also moves out of the bundle into the archive storage so the repository holds only source. - replace react-scripts with Vite 8 and TypeScript 7 - upgrade to React 19 and react-router 7 (declarative mode) - swap unmaintained libraries: react-html-parser, axios, react-ga, react-image-lightbox, react-helmet, moment, xregexp - replace ESLint with Biome for linting and formatting - switch the package manager from yarn to npm - load tree/simpf-links/news/dbtools/publication JSON at runtime from modules/<module>/ instead of importing them into the bundle - move XooNIps files to /modules/xoonips/file/ and update .htaccess
49 lines
2.2 KiB
TypeScript
49 lines
2.2 KiB
TypeScript
import { Helmet } from '@dr.pogodin/react-helmet';
|
|
import { Route, Routes } from 'react-router';
|
|
import PageNotFound from '../common/lib/PageNotFound';
|
|
import type { MultiLang } from '../config';
|
|
import Functions from '../functions';
|
|
import styles from './Database.module.css';
|
|
import DatabaseAdvancedSearch from './DatabaseAdvancedSearch';
|
|
import DatabaseDetailItem from './DatabaseDetailItem';
|
|
import DatabaseSearchByAdvancedKeyword from './DatabaseSearchByAdvancedKeyword';
|
|
import DatabaseSearchByIndexId from './DatabaseSearchByIndexId';
|
|
import DatabaseSearchByItemType from './DatabaseSearchByItemType';
|
|
import DatabaseSearchByKeyword from './DatabaseSearchByKeyword';
|
|
import DatabaseTop from './DatabaseTop';
|
|
|
|
interface Props {
|
|
lang: MultiLang;
|
|
}
|
|
|
|
const Database = (props: Props) => {
|
|
const { lang } = props;
|
|
return (
|
|
<div className={styles.database}>
|
|
<Helmet>
|
|
<title>
|
|
{Functions.mlang('[en]Database[/en][ja]データベース[/ja]', lang)} - {Functions.siteTitle(lang)}
|
|
</title>
|
|
</Helmet>
|
|
<Routes>
|
|
<Route index element={<DatabaseTop lang={lang} />} />
|
|
<Route path="item/:id" element={<DatabaseDetailItem lang={lang} />} />
|
|
<Route path="item/id/:doi" element={<DatabaseDetailItem lang={lang} />} />
|
|
<Route path="advanced" element={<DatabaseAdvancedSearch lang={lang} />} />
|
|
<Route path="list" element={<DatabaseSearchByIndexId lang={lang} />} />
|
|
<Route path="list/:id" element={<DatabaseSearchByIndexId lang={lang} />} />
|
|
<Route path="search" element={<DatabaseSearchByKeyword lang={lang} />} />
|
|
<Route path="search/advanced" element={<DatabaseSearchByAdvancedKeyword lang={lang} />} />
|
|
<Route path="search/itemtype/:itemType" element={<DatabaseSearchByItemType lang={lang} />} />
|
|
<Route
|
|
path="search/itemtype/:itemType/:subItemType"
|
|
element={<DatabaseSearchByItemType lang={lang} />}
|
|
/>
|
|
<Route path="*" element={<PageNotFound lang={lang} />} />
|
|
</Routes>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default Database;
|