diff --git a/package.json b/package.json index a8295f0f..9d26a87b 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "@babel/preset-typescript": "^7.17.12", "@semantic-ui-react/css-patch": "^1.0.0", "@types/node": "^17.0.40", - "@types/react": "^18.0.12", + "@types/react": "^17.0.0", + "@types/react-dom": "^17.0.17", "@types/react-router-dom": "^5.0.0", "@typescript-eslint/eslint-plugin": "^5.27.1", "@typescript-eslint/parser": "^5.27.1", @@ -81,7 +82,7 @@ "scripts": { "start": "webpack serve --config webpack.dev.config.ts", "build": "webpack --config webpack.prod.config.ts", - "dist": "tar -C dist -c -z -f release.tar.gz .", + "test": "jest", "postinstall": "semantic-ui-css-patch" } } diff --git a/src/App.tsx b/src/App.tsx new file mode 100644 index 00000000..bc11b97d --- /dev/null +++ b/src/App.tsx @@ -0,0 +1,49 @@ +import React, { FC } from 'react' +import { QueryClient, QueryClientProvider } from 'react-query' +import { ReactQueryDevtools } from 'react-query/devtools' +import { BrowserRouter, Route, Switch, useParams } from 'react-router-dom' +import HomeView from './views/HomeView' +import LoginView from './views/LoginView' +import SettingsView from './views/SettingsView' +import TickerView from './views/TickerView' +import UsersView from './views/UsersView' +import 'semantic-ui-css/semantic.min.css' +import './index.css' +import '../leaflet.config.js' + +interface TickerViewParams { + tickerId: string +} + +//TODO: Can be removed if TickerView is rewritten +const TickerViewWrapper: FC = () => { + const { tickerId } = useParams() + + return +} + +//TODO: Can be removed if LoginView is rewritten +const LoginViewWrapper: FC = () => { + return +} + +const App: FC = () => { + const queryClient = new QueryClient() + + return ( + + + + + + + + + + + + + ) +} + +export default App diff --git a/src/index.d.ts b/src/declaration.d.ts similarity index 100% rename from src/index.d.ts rename to src/declaration.d.ts diff --git a/src/index.js b/src/index.js deleted file mode 100644 index adb423e9..00000000 --- a/src/index.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react' -import ReactDOM from 'react-dom' -import { BrowserRouter, Route, Switch } from 'react-router-dom' -import { QueryClient, QueryClientProvider } from 'react-query' -import { ReactQueryDevtools } from 'react-query/devtools' -import 'semantic-ui-css/semantic.min.css' -import './index.css' -import HomeView from './views/HomeView' -import LoginView from './views/LoginView' -import TickerView from './views/TickerView' -import UsersView from './views/UsersView' -import SettingsView from './views/SettingsView' -import PropTypes from 'prop-types' -import '../leaflet.config.js' - -const Ticker = ({ match }) => { - let id = parseInt(match.params.id) - - return -} - -const queryClient = new QueryClient() - -ReactDOM.render( - - - - - - - - - - - - , - document.getElementById('root') -) - -Ticker.propTypes = { - match: PropTypes.object.isRequired, -} diff --git a/src/index.tsx b/src/index.tsx new file mode 100644 index 00000000..432dac66 --- /dev/null +++ b/src/index.tsx @@ -0,0 +1,10 @@ +import React from 'react' +import ReactDOM from 'react-dom' +import App from './App' + +ReactDOM.render( + + + , + document.getElementById('root') +) diff --git a/webpack.common.config.ts b/webpack.common.config.ts index f268e5e9..46208c69 100644 --- a/webpack.common.config.ts +++ b/webpack.common.config.ts @@ -5,7 +5,7 @@ import { Configuration, DefinePlugin } from 'webpack' dotenv.config() const baseConfig: Configuration = { - entry: './src/index.js', + entry: './src/index.tsx', output: { publicPath: '/', filename: '[name].js?[contenthash]', @@ -56,4 +56,4 @@ const baseConfig: Configuration = { ], } -export default baseConfig \ No newline at end of file +export default baseConfig diff --git a/yarn.lock b/yarn.lock index a40f588e..abc8022d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1435,6 +1435,13 @@ resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== +"@types/react-dom@^17.0.17": + version "17.0.17" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.17.tgz#2e3743277a793a96a99f1bf87614598289da68a1" + integrity sha512-VjnqEmqGnasQKV0CWLevqMTXBYG9GbwuE6x3VetERLh0cq2LTptFE73MrQi2S7GkKXCf2GgwItB/melLnxfnsg== + dependencies: + "@types/react" "^17" + "@types/react-router-dom@^5.0.0": version "5.3.3" resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.3.3.tgz#e9d6b4a66fcdbd651a5f106c2656a30088cc1e83" @@ -1452,7 +1459,7 @@ "@types/history" "^4.7.11" "@types/react" "*" -"@types/react@*", "@types/react@^18.0.12": +"@types/react@*": version "18.0.12" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.12.tgz#cdaa209d0a542b3fcf69cf31a03976ec4cdd8840" integrity sha512-duF1OTASSBQtcigUvhuiTB1Ya3OvSy+xORCiEf20H0P0lzx+/KeVsA99U5UjLXSbyo1DRJDlLKqTeM1ngosqtg== @@ -1461,6 +1468,15 @@ "@types/scheduler" "*" csstype "^3.0.2" +"@types/react@^17", "@types/react@^17.0.0": + version "17.0.45" + resolved "https://registry.yarnpkg.com/@types/react/-/react-17.0.45.tgz#9b3d5b661fd26365fefef0e766a1c6c30ccf7b3f" + integrity sha512-YfhQ22Lah2e3CHPsb93tRwIGNiSwkuz1/blk4e6QrWS0jQzCSNbGLtOEYhPg02W0yGTTmpajp7dCTbBAMN3qsg== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + "@types/retry@0.12.0": version "0.12.0" resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d"