mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
refactor: move connect&link to entry file
This commit is contained in:
parent
ac3505f859
commit
24ea03beb0
2 changed files with 8 additions and 8 deletions
|
|
@ -1,9 +1,6 @@
|
|||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
|
||||
import connect from '../driver/Driver'
|
||||
import core from '../driver/core'
|
||||
|
||||
import FileExplorer from './FileExplorer'
|
||||
import ToggleShowButton from './ToggleShowButton'
|
||||
import MetaBar from './MetaBar'
|
||||
|
|
@ -15,7 +12,7 @@ import cx from '../utils/cx'
|
|||
|
||||
const baseSize = 260
|
||||
|
||||
class SideBar extends React.Component {
|
||||
export default class Gitako extends React.PureComponent {
|
||||
static propTypes = {
|
||||
// initial width of side bar
|
||||
baseSize: PropTypes.number,
|
||||
|
|
@ -141,5 +138,3 @@ class SideBar extends React.Component {
|
|||
)
|
||||
}
|
||||
}
|
||||
|
||||
export default connect(core)(SideBar)
|
||||
|
|
|
|||
|
|
@ -1,10 +1,15 @@
|
|||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
|
||||
import connect from './driver/connect'
|
||||
import core from './driver/core'
|
||||
import SideBar from './components/SideBar'
|
||||
|
||||
import './content.less'
|
||||
|
||||
import SideBar from './components/SideBar'
|
||||
const ConnectedSideBar = connect(core)(SideBar)
|
||||
|
||||
const SideBarElement = document.createElement('div')
|
||||
document.body.appendChild(SideBarElement)
|
||||
ReactDOM.render(<SideBar />, SideBarElement)
|
||||
|
||||
ReactDOM.render(<ConnectedSideBar />, SideBarElement)
|
||||
|
|
|
|||
Loading…
Reference in a new issue