mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
refactor: transform more to TS
This commit is contained in:
parent
36ffbbee04
commit
538527bd39
7 changed files with 17 additions and 34 deletions
|
|
@ -1,23 +0,0 @@
|
|||
import React from 'react'
|
||||
import SideBar from 'components/SideBar'
|
||||
import { Gitako as GitakoCore } from 'driver/core'
|
||||
import connect from 'driver/connect'
|
||||
import { raiseError } from 'analytics'
|
||||
|
||||
@connect(GitakoCore)
|
||||
export default class Gitako extends React.PureComponent {
|
||||
componentDidMount() {
|
||||
const { init } = this.props
|
||||
init()
|
||||
}
|
||||
|
||||
componentDidCatch(error) {
|
||||
raiseError(error)
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<SideBar />
|
||||
)
|
||||
}
|
||||
}
|
||||
13
src/components/Gitako.tsx
Normal file
13
src/components/Gitako.tsx
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import * as React from 'react'
|
||||
import SideBar from 'components/SideBar'
|
||||
import { raiseError } from 'analytics'
|
||||
|
||||
export default class Gitako extends React.PureComponent {
|
||||
componentDidCatch(error: Error) {
|
||||
raiseError(error)
|
||||
}
|
||||
|
||||
render() {
|
||||
return React.createElement(SideBar as any)
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react'
|
||||
import ReactDOM from 'react-dom'
|
||||
import * as React from 'react'
|
||||
import * as ReactDOM from 'react-dom'
|
||||
import Gitako from 'components/Gitako'
|
||||
import { addMiddleware } from 'driver/connect'
|
||||
import { withErrorLog } from 'analytics'
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
const init = dispatch => () => {
|
||||
}
|
||||
|
||||
export default {
|
||||
init,
|
||||
}
|
||||
|
|
@ -1,3 +1,2 @@
|
|||
export { default as Gitako } from './Gitako'
|
||||
export { default as SideBar } from './SideBar'
|
||||
export { default as FileExplorer } from './FileExplorer'
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"files": ["src/content.jsx"],
|
||||
"files": ["src/content.tsx"],
|
||||
"compilerOptions": {
|
||||
"target": "es2016",
|
||||
"outDir": "dist",
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ if (IN_PRODUCTION_MODE) {
|
|||
|
||||
module.exports = {
|
||||
entry: {
|
||||
content: './src/content.jsx',
|
||||
content: './src/content.tsx',
|
||||
},
|
||||
mode: IN_PRODUCTION_MODE ? 'production' : 'development',
|
||||
output: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue