-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into keu/source-fb-marke…
…ting-fix-execute-in-batch
- Loading branch information
Showing
13 changed files
with
651 additions
and
441 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { addDecorator } from "@storybook/react"; | ||
import { withThemesProvider } from "storybook-addon-styled-component-theme"; | ||
|
||
import WithProviders from "./withProvider"; | ||
import { theme } from "../src/theme"; | ||
import { withProviders } from "./withProvider"; | ||
|
||
addDecorator(withThemesProvider([theme], WithProviders)); | ||
addDecorator(withProviders); | ||
|
||
export const parameters = {}; |
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,50 +1,32 @@ | ||
import { MemoryRouter } from "react-router-dom"; | ||
import * as React from "react"; | ||
import { IntlProvider } from "react-intl"; | ||
// import { createMemoryHistory } from "history"; | ||
import { ThemeProvider } from "styled-components"; | ||
|
||
// TODO: theme was not working correctly so imported directly | ||
import { theme, Theme } from "../src/theme"; | ||
import { theme } from "../src/theme"; | ||
import GlobalStyle from "../src/global-styles"; | ||
import messages from "../src/locales/en.json"; | ||
import { FeatureService } from "../src/hooks/services/Feature"; | ||
import { ConfigServiceProvider, defaultConfig } from "../src/config"; | ||
import { ServicesProvider } from "../src/core/servicesProvider"; | ||
|
||
interface Props { | ||
theme?: Theme; | ||
} | ||
|
||
interface Props { | ||
children?: React.ReactNode; | ||
theme?: Theme; | ||
} | ||
|
||
class WithProviders extends React.Component<Props> { | ||
render() { | ||
const { children } = this.props; | ||
|
||
return ( | ||
<ServicesProvider> | ||
<MemoryRouter> | ||
<IntlProvider messages={messages} locale={"en"}> | ||
<ThemeProvider theme={theme}> | ||
<ConfigServiceProvider | ||
defaultConfig={defaultConfig} | ||
providers={[]} | ||
> | ||
<FeatureService> | ||
<GlobalStyle /> | ||
{children} | ||
</FeatureService> | ||
</ConfigServiceProvider> | ||
</ThemeProvider> | ||
</IntlProvider> | ||
</MemoryRouter> | ||
</ServicesProvider> | ||
); | ||
} | ||
} | ||
|
||
export default WithProviders; | ||
export const withProviders = (getStory) => ( | ||
<ServicesProvider> | ||
<MemoryRouter> | ||
<IntlProvider messages={messages} locale={"en"}> | ||
<ThemeProvider theme={theme}> | ||
<ConfigServiceProvider | ||
defaultConfig={defaultConfig} | ||
providers={[]} | ||
> | ||
<FeatureService> | ||
<GlobalStyle /> | ||
{getStory()} | ||
</FeatureService> | ||
</ConfigServiceProvider> | ||
</ThemeProvider> | ||
</IntlProvider> | ||
</MemoryRouter> | ||
</ServicesProvider> | ||
); |
Oops, something went wrong.
3e27c56
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SonarQube Report
SonarQube report for Airbyte Connectors Source Facebook Marketing(#10588)
Measures
Detected Issues
Coverage (100.0%)