This commit is contained in:
zkldi
2021-07-21 20:53:59 +01:00
parent 54d823612d
commit 31adc6f64a
9 changed files with 996 additions and 3014 deletions
+3 -25
View File
@@ -375,32 +375,10 @@ module.exports = function(webpackEnv) {
{
test: /\.(js|mjs|jsx|ts|tsx)$/,
include: paths.appSrc,
loader: require.resolve("babel-loader"),
loader: require.resolve("esbuild-loader"),
options: {
customize: require.resolve(
"babel-preset-react-app/webpack-overrides"
),
plugins: [
[
require.resolve("babel-plugin-named-asset-import"),
{
loaderMap: {
svg: {
ReactComponent:
"@svgr/webpack?-svgo,+titleProp,+ref![path]",
},
},
},
],
],
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/
// directory for faster rebuilds.
cacheDirectory: true,
// See #6846 for context on why cacheCompression is disabled
cacheCompression: false,
compact: isEnvProduction,
sourcemap: false,
loader: "tsx"
},
},
// Process any JS outside of the app with Babel.
+32 -72
View File
@@ -6,8 +6,7 @@
"start": "node scripts/start.js -o",
"build": "node scripts/build.js",
"test": "node scripts/test.js",
"lint": "eslint src --fix --ext .ts",
"format": "prettier --write \"src/**/*.{js,css,scss,html}\""
"lint": "eslint src --fix --ext .ts"
},
"browserslist": {
"production": [
@@ -25,9 +24,6 @@
]
},
"dependencies": {
"@babel/core": "7.6.0",
"@date-io/date-fns": "2.6.1",
"@formatjs/intl-pluralrules": "1.3.5",
"@fortawesome/fontawesome-free": "5.13.0",
"@material-ui/core": "4.9.14",
"@material-ui/icons": "4.9.1",
@@ -36,53 +32,22 @@
"@material-ui/styles": "4.9.14",
"@svgr/webpack": "4.3.2",
"@tanem/svg-injector": "8.0.50",
"@types/jest": "26.0.23",
"@types/node": "16.0.0",
"@types/react": "17.0.13",
"@types/react-dom": "17.0.8",
"@types/react-router": "5.1.15",
"@types/react-router-dom": "5.1.7",
"@typescript-eslint/eslint-plugin": "4.28.3",
"@typescript-eslint/parser": "4.28.3",
"apexcharts": "3.19.2",
"babel-eslint": "10.0.3",
"babel-jest": "^24.9.0",
"babel-loader": "8.0.6",
"babel-plugin-named-asset-import": "^0.3.7",
"babel-preset-react-app": "^9.1.2",
"bootstrap": "4.6.0",
"camelcase": "^5.3.1",
"case-sensitive-paths-webpack-plugin": "2.2.0",
"clipboard-copy": "3.1.0",
"clsx": "1.1.0",
"css-loader": "2.1.1",
"date-fns": "2.8.1",
"deepmerge": "4.2.2",
"dotenv": "6.2.0",
"dotenv-expand": "5.1.0",
"downshift": "3.4.2",
"eslint": "^7.30.0",
"eslint-config-react-app": "^5.2.1",
"eslint-loader": "3.0.2",
"eslint-plugin-flowtype": "3.13.0",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-jsx-a11y": "6.2.3",
"eslint-plugin-react": "7.14.3",
"fg-loadcss": "2.1.0",
"file-loader": "3.0.1",
"formik": "2.2.9",
"fs-extra": "7.0.1",
"html-webpack-plugin": "^4.5.2",
"humanize-duration": "3.27.0",
"identity-obj-proxy": "3.0.0",
"is-wsl": "^1.1.0",
"jest": "24.9.0",
"jest-environment-jsdom-fourteen": "0.1.0",
"jest-resolve": "24.9.0",
"jest-watch-typeahead": "0.4.0",
"lodash": "4.17.15",
"luxon": "2.0.1",
"material-ui-popup-state": "1.4.1",
"mini-css-extract-plugin": "0.8.0",
"nanoid": "3.1.23",
"optimize-css-assets-webpack-plugin": "5.0.3",
@@ -94,63 +59,58 @@
"postcss-preset-env": "6.7.0",
"postcss-safe-parser": "4.0.1",
"react": "16.12.0",
"react-app-polyfill": "^1.0.6",
"react-bootstrap": "1.0.1",
"react-bootstrap-table-next": "4.0.2",
"react-bootstrap-table2-paginator": "2.1.2",
"react-datepicker": "2.16.0",
"react-dev-utils": "^9.1.0",
"react-dom": "16.12.0",
"react-draggable": "4.4.2",
"react-hot-toast": "2.0.0",
"react-inlinesvg": "1.2.0",
"react-intl": "3.6.2",
"react-is": "16.13.1",
"react-perfect-scrollbar": "1.5.8",
"react-portal": "4.2.0",
"react-query": "3.18.1",
"react-router": "5.2.0",
"react-router-dom": "5.1.2",
"react-select": "3.1.0",
"react-swipeable-views": "0.13.9",
"react-swipeable-views-utils": "0.14.0",
"react-syntax-highlighter": "12.2.1",
"react-table": "7.7.0",
"react-window": "1.8.5",
"resolve": "1.12.0",
"resolve-url-loader": "3.1.0",
"sass-loader": "7.2.0",
"semver": "6.3.0",
"socicon": "3.0.5",
"tachi-common": "github:zkldi/tachi-common"
},
"devDependencies": {
"@types/humanize-duration": "3.25.1",
"@types/jest": "26.0.23",
"@types/luxon": "1.27.1",
"@types/node": "16.0.0",
"@types/react": "17.0.13",
"@types/react-dom": "17.0.8",
"@types/react-router": "5.1.15",
"@types/react-router-dom": "5.1.7",
"@types/react-table": "7.7.2",
"@typescript-eslint/eslint-plugin": "4.28.3",
"@typescript-eslint/parser": "4.28.3",
"copyfiles": "2.1.1",
"esbuild-loader": "2.13.1",
"eslint": "7.30.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.23.4",
"eslint-plugin-prettier": "3.4.0",
"eslint-plugin-react": "7.14.3",
"eslint-plugin-react-hooks": "^1.7.0",
"is-wsl": "^1.1.0",
"prettier": "1.19.1",
"react-dev-utils": "^9.1.0",
"sass": "1.32.8",
"sass-loader": "7.2.0",
"serve": "11.2.0",
"style-loader": "1.0.0",
"tachi-common": "github:zkldi/tachi-common",
"terser-webpack-plugin": "1.4.1",
"ts-pnp": "1.1.4",
"typescript": "4.3.5",
"url-loader": "2.1.0",
"webpack": "4.41.0",
"webpack-cli": "3.3.11",
"webpack-dev-server": "3.2.1",
"webpack-manifest-plugin": "2.1.1",
"workbox-webpack-plugin": "4.3.1"
},
"devDependencies": {
"@types/humanize-duration": "3.25.1",
"@types/luxon": "1.27.1",
"@types/react-table": "7.7.2",
"@typescript-eslint/eslint-plugin": "4.28.1",
"@typescript-eslint/parser": "4.28.1",
"copyfiles": "2.1.1",
"eslint": "7.30.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-import": "2.23.4",
"eslint-plugin-prettier": "3.4.0",
"eslint-plugin-react-hooks": "^1.7.0",
"prettier": "1.19.1",
"sass": "1.32.8",
"serve": "11.2.0",
"webpack-cli": "3.3.11",
"webpack-messages": "2.0.4",
"webpack-rtl-plugin": "2.0.0"
"webpack-rtl-plugin": "2.0.0",
"workbox-webpack-plugin": "4.3.1"
},
"jest": {
"roots": [
+922 -2907
View File
File diff suppressed because it is too large Load Diff
@@ -17,11 +17,6 @@ export function Header() {
alt="Logo"
src={toAbsoluteUrl("/media/logos/logo-mark.png")}
/>
<img
className="logo-sticky max-h-40px"
alt="Logo"
src={toAbsoluteUrl("/media/logos/logo-mark.png")}
/>
</Link>
</div>
@@ -62,7 +62,7 @@ export function HeaderMenu() {
</div>
</div>
<ul className="menu-nav">
<MenuLink name="Dashboard" to="/dashboard" />
{/* <MenuLink name="Dashboard" to="/dashboard" /> */}
{user && data && data.length !== 0 && (
<MenuDropdown name="My Games">
@@ -1,20 +1,21 @@
import React, { useContext } from "react";
import { Link } from "react-router-dom";
import Dropdown from "react-bootstrap/Dropdown";
import { DropdownTopbarItemToggler } from "../../../_metronic/_partials/dropdowns";
// import { DropdownTopbarItemToggler } from "../../../_metronic/_partials/dropdowns";
import Divider from "components/util/Divider";
import { PublicUserDocument } from "tachi-common";
import { Button } from "react-bootstrap";
import { APIFetchV1, ToAPIURL } from "util/api";
import toast from "react-hot-toast";
import { UserContext } from "context/UserContext";
import DropdownToggleOverride from "components/util/DropdownToggleOverride";
export function UserProfileDropdown({ user }: { user: PublicUserDocument }) {
const { setUser } = useContext(UserContext);
return (
<Dropdown drop="down" alignRight>
<Dropdown.Toggle as={DropdownTopbarItemToggler} id="dropdown-toggle-user-profile">
<Dropdown.Toggle as={DropdownToggleOverride} id="dropdown-toggle-user-profile">
<div
className={
"btn btn-icon btn-hover-transparent-white d-flex align-items-center btn-lg px-md-2 w-md-auto"
@@ -0,0 +1,24 @@
/* eslint-disable react/prop-types */
import React, { forwardRef } from "react";
// todo: understand this file - it was leveraged from metronic and uses something weird.
// it exists because we need to override reactbootstraps default of adding btn btn-primary to dropdowns
const DropdownTopbarItemToggler = forwardRef((props, ref) => (
<div
// @ts-expect-error see todo
ref={ref}
className="topbar-item"
onClick={e => {
e.preventDefault();
// @ts-expect-error see todo
props.onClick(e);
}}
>
{props.children}
</div>
));
DropdownTopbarItemToggler.displayName = "DropdownTopbarItemToggler";
export default DropdownTopbarItemToggler;
-1
View File
@@ -11,7 +11,6 @@ import "socicon/css/socicon.css";
import "@fortawesome/fontawesome-free/css/all.min.css";
import "./_metronic/_assets/plugins/flaticon/flaticon.css";
import "./_metronic/_assets/plugins/flaticon2/flaticon.css";
import "react-datepicker/dist/react-datepicker.css";
const { PUBLIC_URL } = process.env;
+11 -1
View File
@@ -111,6 +111,16 @@ function GetStrData(dataValue: string | number | [string, number]) {
return dataValue[0];
}
function GetData(dataValue: string | number | [string, number]) {
if (typeof dataValue === "string") {
return dataValue;
} else if (typeof dataValue === "number") {
return dataValue;
}
return dataValue[0];
}
/**
* Check whether the directive given matches the data.
* @param directiveNumValue - If dataValue is hybrid, then this needs to be passed to compare numbers correctly.
@@ -139,7 +149,7 @@ function DirectiveMatch(
return Matchers[directive.mode](directiveNumValue!.toString(), dataValue[1]);
}
return Matchers[directive.mode](directive.value, GetStrData(dataValue));
return Matchers[directive.mode](directive.value, GetData(dataValue));
}
/**