Skip to content

Commit

Permalink
chore: 更新依赖
Browse files Browse the repository at this point in the history
  • Loading branch information
sigoden committed Jan 23, 2022
1 parent 97e4f09 commit 0b5c5af
Show file tree
Hide file tree
Showing 5 changed files with 1,555 additions and 1,202 deletions.
50 changes: 25 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,51 +9,51 @@
"lint": "eslint --ext js,jsx ."
},
"dependencies": {
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@fontsource/roboto": "^4.5.1",
"@hot-loader/react-dom": "^17.0.1",
"@mui/icons-material": "^5.0.5",
"@mui/material": "^5.0.6",
"@hot-loader/react-dom": "^17.0.2",
"@mui/icons-material": "^5.3.0",
"@mui/material": "^5.3.0",
"@tinyhttp/cookie": "^2.0.3",
"big-integer": "^1.6.50",
"big-integer": "^1.6.51",
"buffer": "^6.0.3",
"crypto-browserify": "^3.12.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-router-dom": "^5.3.0",
"react-router-dom": "^6.2.1",
"stream-browserify": "^3.0.0",
"valtio": "^1.2.5"
"valtio": "^1.2.9"
},
"devDependencies": {
"@babel/core": "^7.15.8",
"@babel/eslint-parser": "^7.15.8",
"@babel/preset-env": "^7.15.8",
"@babel/preset-react": "^7.14.5",
"@babel/core": "^7.16.12",
"@babel/eslint-parser": "^7.16.5",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"babel-loader": "^8.2.3",
"babel-preset-react-app": "^10.0.0",
"copy-webpack-plugin": "^9.0.1",
"css-loader": "^6.5.0",
"eslint": "^8.1.0",
"babel-preset-react-app": "^10.0.1",
"copy-webpack-plugin": "^10.2.1",
"css-loader": "^6.5.1",
"eslint": "^8.7.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react-app": "^6.0.0",
"eslint-config-react-app": "^7.0.0",
"eslint-plugin-flowtype": "^8.0.3",
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-prettier": "^4.0.0",
"eslint-plugin-react": "^7.27.0",
"eslint-plugin-react": "^7.28.0",
"eslint-plugin-react-hooks": "^4.3.0",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.5.0",
"prettier": "^2.4.1",
"prettier": "^2.5.1",
"react-hot-loader": "^4.13.0",
"shelljs": "^0.8.4",
"source-map-loader": "^3.0.0",
"shelljs": "^0.8.5",
"source-map-loader": "^3.0.1",
"style-loader": "^3.3.1",
"terser-webpack-plugin": "^5.2.4",
"webpack": "^5.60.0",
"terser-webpack-plugin": "^5.3.0",
"webpack": "^5.67.0",
"webpack-cli": "^4.9.1",
"webpack-dev-server": "^4.4.0",
"webpack-dev-server": "^4.7.3",
"zip-webpack-plugin": "^4.0.1"
}
}
14 changes: 5 additions & 9 deletions src/popup/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { MemoryRouter as Router, Switch, Route } from "react-router-dom";
import { MemoryRouter as Router, Routes, Route } from "react-router-dom";
import CssBaseline from "@mui/material/CssBaseline";
import { ThemeProvider } from "@mui/material/styles";
import theme from "./theme";
Expand All @@ -15,14 +15,10 @@ export default function App() {
{/* CssBaseline kickstart an elegant, consistent, and simple baseline to build upon. */}
<CssBaseline />
<Router>
<Switch>
<Route exact path="/">
<Home />
</Route>
<Route path="/login">
<Login />
</Route>
</Switch>
<Routes>
<Route path="/" element={<Home />} />
<Route path="/login" element={<Login />} />
</Routes>
</Router>
</ThemeProvider>
);
Expand Down
6 changes: 3 additions & 3 deletions src/popup/Home.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { useSnapshot } from "valtio";
import { useHistory } from "react-router-dom";
import { useNavigate } from "react-router-dom";
import Box from "@mui/material/Box";
import Alert from "@mui/material/Alert";
import Link from "@mui/material/Link";
Expand All @@ -10,7 +10,7 @@ import store from "./store";

export default function Home() {
const snap = useSnapshot(store);
const history = useHistory();
const navigate = useNavigate();
return (
<Box sx={{ width: 800 }}>
<Player />
Expand All @@ -22,7 +22,7 @@ export default function Home() {
)}
{!snap.userId && (
<Box sx={{ p: 3, textAlign: "center", background: "white" }}>
<Link href="#" onClick={() => history.push("/login")}>
<Link href="#" onClick={() => navigate("/login", { replace: true })}>
登录
</Link>
后获取个性化推荐及我的歌单
Expand Down
6 changes: 3 additions & 3 deletions src/popup/Login.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from "react";
import { useSnapshot } from "valtio";
import { useHistory } from "react-router";
import { useNavigate } from "react-router-dom";
import Box from "@mui/material/Box";
import Typography from "@mui/material/Typography";
import Grid from "@mui/material/Grid";
Expand All @@ -12,7 +12,7 @@ import { DOMAIN, sleep } from "../utils";

export default function Login() {
const snap = useSnapshot(store);
const history = useHistory();
const navigate = useNavigate();
const [state, setState] = useState({
phone: "",
captcha: "",
Expand Down Expand Up @@ -42,7 +42,7 @@ export default function Login() {
try {
await storeUtils.login(phone, captcha);
await storeUtils.refreshPlaylists();
history.push("/");
navigate("/", { replace: true });
} catch {}
};
return (
Expand Down
Loading

0 comments on commit 0b5c5af

Please sign in to comment.