Skip to content

Commit

Permalink
fix: sync master_ce
Browse files Browse the repository at this point in the history
  • Loading branch information
chibing.fy committed Jul 22, 2019
1 parent c757cbf commit f9d5525
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 17 deletions.
Original file line number Diff line number Diff line change
@@ -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;

16 changes: 11 additions & 5 deletions src/components/editor/ModuleList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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<any, any> {
constructor(props: any) {
Expand Down Expand Up @@ -42,19 +43,24 @@ class ModuleBase extends Component<any, any> {
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<any, any> {
constructor(props: any) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/layout/MainMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default function MainMenu(props: Props) {
<AppBar position="static">
<Toolbar className={classes.toolbar}>
<div>
<div className={classes.logo}> <Logo /> </div>
<Link to="/" className={classes.logo}><Logo /> </Link>
<Link to="/" className={classes.link}><Button color="inherit"> 首页</Button></Link>
<Link to="/repository/joined" className={classes.link}><Button color="inherit"> 仓库 </Button></Link>
<Link to="/organization/joined" className={classes.link}><Button color="inherit"> 团队 </Button></Link>
Expand Down
22 changes: 11 additions & 11 deletions src/family/Family.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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]) {
Expand Down

0 comments on commit f9d5525

Please sign in to comment.