forked from morfeojs/morfeo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replacing imports of @morfeo/web and @morfeo/hooks packages after the introduction of the @morfeo/react package. In addition to this, there are some fixes and improvements to README files.
- Loading branch information
Showing
17 changed files
with
189 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
import React, { FC, useEffect, useState } from 'react'; | ||
import { theme, Theme } from '@morfeo/web'; | ||
import React, { FC } from 'react'; | ||
import { useTheme } from '@morfeo/react'; | ||
import { ThemeProvider as StyledProvider } from 'styled-components'; | ||
|
||
type Props = Omit<React.ComponentProps<typeof StyledProvider>, 'theme'>; | ||
|
||
export const ThemeProvider: FC<Props> = ({ children }) => { | ||
const [currentTheme, setTheme] = useState(theme.get()); | ||
|
||
useEffect(() => { | ||
theme.subscribe(setTheme); | ||
}, []); | ||
|
||
return <StyledProvider theme={currentTheme}>{children}</StyledProvider>; | ||
const theme = useTheme(); | ||
return <StyledProvider theme={theme}>{children}</StyledProvider>; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
import { useTheme } from '@morfeo/react'; | ||
import { morfeoStyled, propsParser, attributesParser } from './styled'; | ||
export * from 'styled-components'; | ||
export * from './types'; | ||
|
||
export { propsParser, attributesParser }; | ||
export default morfeoStyled; | ||
/** | ||
* Overrides styled-component's ThemeProvider | ||
*/ | ||
export { ThemeProvider } from './ThemeProvider'; | ||
/** | ||
* Overrides styled-component's useTheme hook | ||
*/ | ||
export { useTheme }; | ||
/** | ||
* Overrides styled-component's styled function | ||
*/ | ||
export default morfeoStyled; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.