Skip to content

Commit

Permalink
dont use AppUI to provide theme, manually provide theme yourself by w…
Browse files Browse the repository at this point in the history
…rapping viewer comp w/ ThemeProvider from iTwinUi. this is temporary
  • Loading branch information
aruniverse committed Jan 8, 2025
1 parent 258f585 commit ebb5334
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
6 changes: 3 additions & 3 deletions packages/modules/viewer-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@
"@itwin/core-frontend": "^4.0.0",
"@itwin/core-geometry": "^4.0.0",
"@itwin/core-react": "^5.0.0",
"@itwin/imodels-access-frontend": "^4.0.0 || ^5.0.0",
"@itwin/imodels-client-management": "^4.0.0 || ^5.0.0",
"@itwin/imodels-access-frontend": "^5.0.0",
"@itwin/imodels-client-management": "^5.0.0",
"@itwin/presentation-common": "^4.0.0",
"@itwin/presentation-components": "^4.0.0 || ^5.0.0",
"@itwin/presentation-components": "^5.0.0",
"@itwin/presentation-frontend": "^4.0.0",
"react": "^18.0.0",
"react-dom": "^18.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const IModelLoader = React.memo((viewerProps: ModelLoaderProps) => {
viewCreatorOptions,
blankConnectionViewState,
uiProviders,
theme,
// theme,
loadingComponent,
selectionStorage,
getSchemaContext,
Expand Down Expand Up @@ -90,7 +90,10 @@ const IModelLoader = React.memo((viewerProps: ModelLoaderProps) => {
StateManager.store ? ( //eslint-disable-line deprecation/deprecation
//eslint-disable-next-line deprecation/deprecation
<Provider store={StateManager.store}>
<IModelViewer frontstages={finalFrontstages} theme={theme} />
<IModelViewer
frontstages={finalFrontstages}
// theme={theme}
/>
</Provider>
) : (
<div className="itwin-viewer-loading-container">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import React, { useEffect, useState } from "react";
import type { ViewerFrontstage } from "../../types";
interface ModelProps {
frontstages: ViewerFrontstage[];
theme?: ThemeId;
// theme?: ThemeId;
}

/*
Expand All @@ -31,8 +31,8 @@ the issue is no longer occuring.
*/
export const IModelViewer: React.FC<ModelProps> = ({
frontstages,
theme,
}: ModelProps) => {
}: // theme,
ModelProps) => {
const [defaultFrontstageDef, setDefaultFrontstageDef] =
useState<FrontstageDef>();

Expand Down Expand Up @@ -70,8 +70,8 @@ export const IModelViewer: React.FC<ModelProps> = ({

// there will always be at least one (for the default frontstage). Wait for it to be loaded into the list before rendering the content
return (
<ThemeManager theme={theme}>
<ConfigurableUiContent appBackstage={<BackstageComposer />} />
</ThemeManager>
// <ThemeManager theme={theme}>
<ConfigurableUiContent appBackstage={<BackstageComposer />} />
// </ThemeManager>
);
};
2 changes: 1 addition & 1 deletion packages/modules/viewer-react/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export interface UnifiedSelectionProps {

export interface LoaderProps {
/** color theme */
theme?: ColorTheme | string;
// theme?: ColorTheme | string;
/** Default UI configuration */
defaultUiConfig?: ViewerDefaultFrontstageConfig;
/** Optional callback function when iModel is connected */
Expand Down

0 comments on commit ebb5334

Please sign in to comment.