Skip to content

Commit

Permalink
Merge pull request #3119 from mariojsnunes/refactor/remaining-compone…
Browse files Browse the repository at this point in the history
…nts-hooks

refactor: remaining class components to hooks
  • Loading branch information
benfurber authored Dec 29, 2023
2 parents 487ec36 + a87bc85 commit 85479f0
Show file tree
Hide file tree
Showing 9 changed files with 588 additions and 688 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Text } from 'theme-ui'

export interface Props {
status: string
contentType: 'event' | 'howto' | 'research'
contentType: 'event' | 'howto' | 'research' | 'question'
sx?: ThemeUIStyleObject
}

Expand Down
37 changes: 15 additions & 22 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import React from 'react'
import { observer, Provider } from 'mobx-react'
import { ThemeProvider, Global } from '@emotion/react'
import { GlobalStyles } from 'oa-components'
Expand All @@ -18,24 +18,17 @@ export const useCommonStores = () =>
export const dbContext = React.createContext({ db: rootStore.dbV2 })
export const useDB = () => React.useContext(dbContext)

@observer
export class App extends Component {
render() {
return (
<>
<Provider {...rootStore.stores}>
<ThemeProvider
theme={rootStore.stores.themeStore.currentTheme.styles}
>
<>
<ErrorBoundary>
<Pages />
</ErrorBoundary>
<Global styles={GlobalStyles} />
</>
</ThemeProvider>
</Provider>
</>
)
}
}
export const App = observer(() => {
return (
<Provider {...rootStore.stores}>
<ThemeProvider theme={rootStore.stores.themeStore.currentTheme.styles}>
<>
<ErrorBoundary>
<Pages />
</ErrorBoundary>
<Global styles={GlobalStyles} />
</>
</ThemeProvider>
</Provider>
)
})
Loading

0 comments on commit 85479f0

Please sign in to comment.