feat(ui): move to React 18 and base for using shadcn/ui (#4174)
Co-authored-by: IbrahimCSAE <ibrahim.mdev@gmail.com>
This commit is contained in:
1 parent
72b63dcd6a
commit
70f2c797f4
153 files changed
+2973
-2043
No files matched your search
+28
-22
@@ -1,4 +1,5 @@
|
||||
// External
|
||||
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import i18n from '@ohif/i18n';
|
||||
@@ -23,6 +24,7 @@ import {
|
||||
UserAuthenticationProvider,
|
||||
ToolboxProvider,
|
||||
} from '@ohif/ui';
|
||||
import { ThemeWrapper as ThemeWrapperNext, NotificationProvider } from '@ohif/ui-next';
|
||||
// Viewer Project
|
||||
// TODO: Should this influence study list?
|
||||
import { AppConfigProvider } from '@state';
|
||||
@@ -36,7 +38,27 @@ let commandsManager: CommandsManager,
|
||||
serviceProvidersManager: ServiceProvidersManager,
|
||||
hotkeysManager: HotkeysManager;
|
||||
|
||||
function App({ config, defaultExtensions, defaultModes }) {
|
||||
function App({
|
||||
config = {
|
||||
/**
|
||||
* Relative route from domain root that OHIF instance is installed at.
|
||||
* For example:
|
||||
*
|
||||
* Hosted at: https://ohif.org/where-i-host-the/viewer/
|
||||
* Value: `/where-i-host-the/viewer/`
|
||||
* */
|
||||
routerBaseName: '/',
|
||||
/**
|
||||
*
|
||||
*/
|
||||
showLoadingIndicator: true,
|
||||
showStudyList: true,
|
||||
oidc: [],
|
||||
extensions: [],
|
||||
},
|
||||
defaultExtensions = [],
|
||||
defaultModes = [],
|
||||
}) {
|
||||
const [init, setInit] = useState(null);
|
||||
useEffect(() => {
|
||||
const run = async () => {
|
||||
@@ -83,11 +105,13 @@ function App({ config, defaultExtensions, defaultModes }) {
|
||||
[AppConfigProvider, { value: appConfigState }],
|
||||
[UserAuthenticationProvider, { service: userAuthenticationService }],
|
||||
[I18nextProvider, { i18n }],
|
||||
[ThemeWrapperNext],
|
||||
[ThemeWrapper],
|
||||
[ToolboxProvider],
|
||||
[ViewportGridProvider, { service: viewportGridService }],
|
||||
[ViewportDialogProvider, { service: uiViewportDialogService }],
|
||||
[CineProvider, { service: cineService }],
|
||||
// [NotificationProvider, { service: uiNotificationService }],
|
||||
[SnackbarProvider, { service: uiNotificationService }],
|
||||
[DialogProvider, { service: uiDialogService }],
|
||||
[ModalProvider, { service: uiModalService, modal: Modal }],
|
||||
@@ -153,27 +177,9 @@ App.propTypes = {
|
||||
/* Extensions that are "bundled" or "baked-in" to the application.
|
||||
* These would be provided at build time as part of they entry point. */
|
||||
defaultExtensions: PropTypes.array,
|
||||
};
|
||||
|
||||
App.defaultProps = {
|
||||
config: {
|
||||
/**
|
||||
* Relative route from domain root that OHIF instance is installed at.
|
||||
* For example:
|
||||
*
|
||||
* Hosted at: https://ohif.org/where-i-host-the/viewer/
|
||||
* Value: `/where-i-host-the/viewer/`
|
||||
* */
|
||||
routerBaseName: '/',
|
||||
/**
|
||||
*
|
||||
*/
|
||||
showLoadingIndicator: true,
|
||||
showStudyList: true,
|
||||
oidc: [],
|
||||
extensions: [],
|
||||
},
|
||||
defaultExtensions: [],
|
||||
/* Modes that are "bundled" or "baked-in" to the application.
|
||||
* These would be provided at build time as part of they entry point. */
|
||||
defaultModes: PropTypes.array,
|
||||
};
|
||||
|
||||
export default App;
|
||||
|
||||
Reference in new issue
Block a user