Skip to content

Commit

Permalink
♻️ (react) Improve debug env
Browse files Browse the repository at this point in the history
  • Loading branch information
TomokiMiyauci committed Jul 11, 2021
1 parent 51c4d53 commit 939ef24
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
17 changes: 17 additions & 0 deletions packages/react/_debug/app.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { FC, useState } from 'react'
import Utterances from '../lib/Utterances'
import { Theme } from '@shared/types'

const App: FC = () => {
const [theme, changeTheme] = useState<Theme>('github-light')
const handleClick = () =>
changeTheme(theme === 'github-light' ? 'github-dark' : 'github-light')
return (
<>
<button onClick={handleClick}>switch</button>
<Utterances repo="TomokiMiyauci/me" theme={theme} issueTerm="pathname" />
</>
)
}

export default App
12 changes: 4 additions & 8 deletions packages/react/_debug/main.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import React from 'react'
import ReactDOM from 'react-dom'
import Utterances from '../lib/Utterances'
import { render } from 'react-dom'
import App from './app'

ReactDOM.render(
render(
<React.StrictMode>
<Utterances
repo="TomokiMiyauci/utterances-component"
theme="github-dark"
issueTerm="pathname"
/>
<App />
</React.StrictMode>,
document.getElementById('root')
)
2 changes: 1 addition & 1 deletion packages/react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@
"@shared/*": ["../@shared/*"]
}
},
"include": ["./lib"]
"include": ["./lib", "./_debug"]
}

0 comments on commit 939ef24

Please sign in to comment.