diff --git "a/src/components/account/LoginForm.sass~3c31491... fix: \345\220\214\346\255\245 github \344\270\212\347\232\204\350\267\263\350\275\254 bug" "b/src/components/account/LoginForm.sass~3c31491... fix: \345\220\214\346\255\245 github \344\270\212\347\232\204\350\267\263\350\275\254 bug" new file mode 100644 index 0000000..b319c4a --- /dev/null +++ "b/src/components/account/LoginForm.sass~3c31491... fix: \345\220\214\346\255\245 github \344\270\212\347\232\204\350\267\263\350\275\254 bug" @@ -0,0 +1,27 @@ +@import "../../assets/variables.sass"; +// 水平居中 + 垂直居中 +.wrapper + background-size: cover; + width: 100% + height: 100% + min-height: 800px + .LoginForm + position: fixed; + left: 50%; + top: 30%; + width: 25rem; + margin-left: -12.5rem; + margin-top: -135px; + border: 1px solid #E6E6E6; + border-radius: .5rem; + .header + padding: 1.5rem 3rem; + border-bottom: 1px solid $border; + .title + font-size: 2rem; + .body + padding: 1.5rem 3rem; + .footer + padding: 1.5rem 3rem; + border-top: 1px solid $border; + diff --git a/src/components/editor/ModuleList.tsx b/src/components/editor/ModuleList.tsx index 0f57f4f..d5c5d1b 100644 --- a/src/components/editor/ModuleList.tsx +++ b/src/components/editor/ModuleList.tsx @@ -4,6 +4,7 @@ import { RModal, RSortable } from '../utils' import ModuleForm from './ModuleForm' import { GoPencil, GoTrashcan, GoPackage } from 'react-icons/go' import { RootState } from 'actions/types' +import { deleteModule } from '../../actions/module' class ModuleBase extends Component { constructor(props: any) { @@ -42,19 +43,24 @@ class ModuleBase extends Component { e.preventDefault() const message = `模块被删除后不可恢复,并且会删除相关的接口!\n确认继续删除『#${mod.id} ${mod.name}』吗?` if (window.confirm(message)) { - this.context.onDeleteModule(this.props.mod.id, () => { - const { store } = this.context + this.props.onDeleteModule(this.props.mod.id, () => { const uri = StoreStateRouterLocationURI(router) const deleteHref = this.props.active ? uri.removeSearch('mod').href() : uri.href() - store.dispatch(replace(deleteHref)) + this.props.replace(deleteHref) }, this.props.repository.id) } } } -const Module = connect((state: any) => ({ +const mapStateToModuleBaseProps = (state: any) => ({ router: state.router, -}))(ModuleBase) +}) +const mapDispatchToModuleBaseProps = ({ + onDeleteModule: deleteModule, + replace, +}) + +const Module = connect(mapStateToModuleBaseProps, mapDispatchToModuleBaseProps)(ModuleBase) class ModuleList extends Component { constructor(props: any) { diff --git a/src/components/layout/MainMenu.tsx b/src/components/layout/MainMenu.tsx index 9c6ad0e..7df5b31 100644 --- a/src/components/layout/MainMenu.tsx +++ b/src/components/layout/MainMenu.tsx @@ -55,7 +55,7 @@ export default function MainMenu(props: Props) {
-
+ diff --git a/src/family/Family.tsx b/src/family/Family.tsx index 43d1316..51c7b79 100644 --- a/src/family/Family.tsx +++ b/src/family/Family.tsx @@ -138,17 +138,6 @@ const Family: { Family.store = store Family.history = history - handleLocation({ - store, - listeners: _listeners, - location: { pathname: '*' }, - }) - handleLocation({ - store, - listeners: _listeners, - location: store.getState().router.location, - }) - /** init store end */ function* rootSaga() { @@ -163,6 +152,17 @@ const Family: { // 在执行 prefilter 之后再开始渲染主UI start(container, { store, history }) + + // handleLocation({ + // store, + // listeners: _listeners, + // location: { pathname: '*' }, + // }) + handleLocation({ + store, + listeners: _listeners, + location: history.location, + }) // tslint:disable-next-line: forin for (const pattern in _sagas) { for (const saga of _sagas[pattern]) {