Skip to content

Commit

Permalink
📌 chore: 锁定 react-router 版本
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Nov 28, 2021
1 parent 74e0652 commit e913677
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 54 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
},
"devDependencies": {
"@ant-design/icons": "^4.x",
"@ant-design/pro-skeleton": "^1.0.2",
"@ant-design/pro-form": "^1.x",
"@ant-design/pro-skeleton": "^1.0.2",
"@babel/core": "^7.8.3",
"@babel/plugin-proposal-object-rest-spread": "^7.8.3",
"@babel/plugin-transform-react-jsx": "^7.12.16",
Expand Down Expand Up @@ -96,6 +96,7 @@
"concurrently": "^6.0.0",
"cross-env": "^7.0.0",
"css-loader": "^5.1.3",
"dayjs": "^1.10.5",
"dpdm": "^3.5.0",
"ejs": "^3.1.6",
"enzyme-to-json": "^3.4.3",
Expand Down Expand Up @@ -133,13 +134,13 @@
"utility-types": "^3.10.0",
"webpack": "^5.26.1",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^4.5.0",
"dayjs": "^1.10.5"
"webpack-cli": "^4.5.0"
},
"resolutions": {
"typescript": "4.4.3"
},
"engines": {
"node": ">=8.0.0"
}
},
"dependencies": {}
}
4 changes: 2 additions & 2 deletions packages/layout-kit/src/layout-kit.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: LayoutToolkit 布局工具库
title: LayoutKit 布局工具库
group:
path: /
nav:
path: /components
---

# LayoutToolkit 布局工具库
# LayoutKit 布局工具库

[![NPM version][version-image]][version-url] [![NPM downloads][download-image]][download-url]

Expand Down
4 changes: 2 additions & 2 deletions packages/user-panel/demos/LoginWithFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ const LoginWithFooter = () => {
onWechatLoginClick={() => {
message.info('微信登录实现方法');
}}
onRegisterClick={(navigate) => {
navigate('/components/biz/user-panel#显示底部');
onRegisterClick={(history) => {
history.push('/components/biz/user-panel#显示底部');
}}
/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions packages/user-panel/demos/LoginWithForgotUrl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const LoginWithLogo = () => {
}}
>
<UserPanel.Login
onForgotClick={(navigate) => {
navigate('/components/biz/user-panel');
onForgotClick={(history) => {
history.push('/components/biz/user-panel');
}}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/user-panel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dependencies": {
"@arvinxu/i18n": "1.0.1",
"classnames": "^2.3.1",
"react-router": "^6.0.2"
"react-router": "^5.2.1"
},
"peerDependencies": {
"@ant-design/icons": "^4.x",
Expand Down
11 changes: 5 additions & 6 deletions packages/user-panel/src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import React from 'react';
import type { FC } from 'react';
import type { NavigateFunction } from 'react-router';
import { useNavigate } from 'react-router';

import type * as H from 'history';
import { useHistory } from 'react-router';
import { Typography, Divider } from 'antd';

import WechatLogin from '../WechatLogin';
Expand All @@ -27,7 +26,7 @@ export interface FooterProps {
/**
* @title 注册页面 Url
*/
onRegisterClick?: (navigate: NavigateFunction) => void;
onRegisterClick?: (history: H.History) => void;
}

export const Footer: FC<FooterProps> = ({
Expand All @@ -37,12 +36,12 @@ export const Footer: FC<FooterProps> = ({
}) => {
const f = useFormatMessage();

const navigate = useNavigate();
const history = useHistory();

const onClick = () => {
switch (type) {
case 'login':
onRegisterClick?.(navigate);
onRegisterClick?.(history);
break;
case 'register':
break;
Expand Down
15 changes: 7 additions & 8 deletions packages/user-panel/src/login/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ import ProForm, {
ProFormCheckbox,
ProFormText,
} from '@ant-design/pro-form';
import type { NavigateFunction } from 'react-router';
import { useNavigate } from 'react-router';

import LoginErrorMessage from './LoginErrorMessage';

import type { IUserLogin } from '../types';
import { useFormatMessage } from '../components';
import './index.less';
import { useFormatMessage } from '../components';
import type { IUserLogin } from '../types';
import * as H from 'history';
import { useHistory } from 'react-router';

export interface LoginProps {
/**
Expand All @@ -36,7 +35,7 @@ export interface LoginProps {
/**
* 忘记密码 url
*/
onForgotClick?: (navigate: NavigateFunction) => void;
onForgotClick?: (history: H.History) => void;
}

const Login: React.FC<LoginProps> = (props) => {
Expand All @@ -49,7 +48,7 @@ const Login: React.FC<LoginProps> = (props) => {
const { status, type: loginType } = loginStatus;

const f = useFormatMessage();
const navigate = useNavigate();
const history = useHistory();

return (
<div className="avx-user-panel-login-container">
Expand Down Expand Up @@ -208,7 +207,7 @@ const Login: React.FC<LoginProps> = (props) => {
float: 'right',
}}
onClick={() => {
onForgotClick(navigate);
onForgotClick(history);
}}
>
{f('login.forgotPassword')}
Expand Down
50 changes: 21 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1983,7 +1983,7 @@
dependencies:
regenerator-runtime "^0.13.4"

"@babel/runtime@^7.2.0", "@babel/runtime@^7.7.6":
"@babel/runtime@^7.12.13", "@babel/runtime@^7.2.0":
version "7.16.3"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.16.3.tgz#b86f0db02a04187a3c17caa77de69840165d42d5"
integrity sha512-WBwekcqacdY2e9AF/Q7WLFUWmdJGJTkbjqTjoMDgXkVZ3ZRUvOPsLb5KdwISoQVsbP+DQzVZW4Zhci0DvpbNTQ==
Expand Down Expand Up @@ -7035,20 +7035,10 @@ caniuse-api@^3.0.0:
lodash.memoize "^4.1.2"
lodash.uniq "^4.5.0"

caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000971, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001109:
version "1.0.30001187"
resolved "https://registry.npm.taobao.org/caniuse-lite/download/caniuse-lite-1.0.30001187.tgz#5706942631f83baa5a0218b7dfa6ced29f845438"
integrity sha1-VwaUJjH4O6paAhi336bO0p+EVDg=

caniuse-lite@^1.0.30001219:
version "1.0.30001233"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001233.tgz#b7cb4a377a4b12ed240d2fa5c792951a06e5f2c4"
integrity sha512-BmkbxLfStqiPA7IEzQpIk0UFZFf3A4E6fzjPJ6OR+bFC2L8ES9J8zGA/asoi47p8XDVkev+WJo2I2Nc8c/34Yg==

caniuse-lite@^1.0.30001254:
version "1.0.30001259"
resolved "https://registry.nlark.com/caniuse-lite/download/caniuse-lite-1.0.30001259.tgz?cache=0&sync_timestamp=1632203514424&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fcaniuse-lite%2Fdownload%2Fcaniuse-lite-1.0.30001259.tgz#ae21691d3da9c4be6144403ac40f71d9f6efd790"
integrity sha1-riFpHT2pxL5hREA6xA9x2fbv15A=
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000971, caniuse-lite@^1.0.30000981, caniuse-lite@^1.0.30001109, caniuse-lite@^1.0.30001219, caniuse-lite@^1.0.30001254:
version "1.0.30001283"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001283.tgz"
integrity sha512-9RoKo841j1GQFSJz/nCXOj0sD7tHBtlowjYlrqIUS812x9/emfBLBt6IyMz1zIaYc/eRL8Cs6HPUVi2Hzq4sIg==

canvas@2.6.1:
version "2.6.1"
Expand Down Expand Up @@ -11193,13 +11183,6 @@ history@^4.7.2, history@^4.9.0:
tiny-warning "^1.0.0"
value-equal "^1.0.1"

history@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/history/-/history-5.1.0.tgz#2e93c09c064194d38d52ed62afd0afc9d9b01ece"
integrity sha512-zPuQgPacm2vH2xdORvGGz1wQMuHSIB56yNAy5FnLuwOwgSYyPKptJtcMm6Ev+hRGeS+GzhbmRacHzvlESbFwDg==
dependencies:
"@babel/runtime" "^7.7.6"

hmac-drbg@^1.0.1:
version "1.0.1"
resolved "https://registry.npm.taobao.org/hmac-drbg/download/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1"
Expand Down Expand Up @@ -18687,13 +18670,6 @@ react-router-dom@5.2.0, react-router-dom@^5.1.2:
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"

react-router@*:
version "6.0.2"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.0.2.tgz#bd2b0fa84fd1d152671e9f654d9c0b1f5a7c86da"
integrity sha512-8/Wm3Ed8t7TuedXjAvV39+c8j0vwrI5qVsYqjFr5WkJjsJpEvNSoLRUbtqSEYzqaTUj1IV+sbPJxvO+accvU0Q==
dependencies:
history "^5.1.0"

react-router@5.2.0:
version "5.2.0"
resolved "https://registry.npm.taobao.org/react-router/download/react-router-5.2.0.tgz#424e75641ca8747fbf76e5ecca69781aa37ea293"
Expand All @@ -18710,6 +18686,22 @@ react-router@5.2.0:
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"

react-router@^5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/react-router/-/react-router-5.2.1.tgz#4d2e4e9d5ae9425091845b8dbc6d9d276239774d"
integrity sha512-lIboRiOtDLFdg1VTemMwud9vRVuOCZmUIT/7lUoZiSpPODiiH1UQlfXy+vPLC/7IWdFYnhRwAyNqA/+I7wnvKQ==
dependencies:
"@babel/runtime" "^7.12.13"
history "^4.9.0"
hoist-non-react-statics "^3.1.0"
loose-envify "^1.3.1"
mini-create-react-context "^0.4.0"
path-to-regexp "^1.7.0"
prop-types "^15.6.2"
react-is "^16.6.0"
tiny-invariant "^1.0.2"
tiny-warning "^1.0.0"

react-side-effect@^2.1.0:
version "2.1.1"
resolved "https://registry.npm.taobao.org/react-side-effect/download/react-side-effect-2.1.1.tgz#66c5701c3e7560ab4822a4ee2742dee215d72eb3"
Expand Down

0 comments on commit e913677

Please sign in to comment.