* Add dialog provider boilerplate and improve provider imports * Add react-draggable dependency * Add dialog service boilerplate * Refactor modal to use react-modal and remove dependency on modal themed styles * Update cinedialog to use new dialog provider * Add multiple dialogs and refactor provider (dialogs) * Set app root (modal) * Add modal zindex bigger than tooltip * Block drag on buttons/svgs/paths/input and improve jsdoc * Use guid util to generate dialog ids * Explicit props in dialog provider * Improve jsdocs * Fix tests broken * Fix boundaries calculation * Remember last dialog position * Update providers location * Add scroll to modal * Add toggable button toolbar and fix css modal
29 lines
685 B
JavaScript
29 lines
685 B
JavaScript
// Reference > https://reactjs.org/docs/context.html
|
|
import React from 'react';
|
|
import {
|
|
withTranslation as I18NextWithTranslation,
|
|
I18nextProvider,
|
|
} from 'react-i18next';
|
|
import i18n from '@ohif/i18n';
|
|
|
|
const WrapperI18n = Component => {
|
|
const WrapperComponent = props => (
|
|
<I18nextProvider i18n={i18n}>
|
|
<Component {...props} />
|
|
</I18nextProvider>
|
|
);
|
|
|
|
return WrapperComponent;
|
|
};
|
|
|
|
const withTranslation = namespace => Component => {
|
|
const TranslatedComponent = props => {
|
|
return <Component {...props} />;
|
|
};
|
|
|
|
return WrapperI18n(I18NextWithTranslation(namespace)(TranslatedComponent));
|
|
};
|
|
|
|
export { withTranslation };
|
|
export default withTranslation;
|