Skip to content

Commit 51260d6

Browse files
fix:custom page width issue (#145)
1 parent 4425f88 commit 51260d6

File tree

3 files changed

+18
-37
lines changed

3 files changed

+18
-37
lines changed

SubwayNav/SubwayNav/components/CanvasSubwayNav.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
22
import { useState } from 'react';
3-
import { ThemeProvider, createTheme, ITheme, IFocusZoneProps } from '@fluentui/react';
3+
import { ThemeProvider, createTheme, ITheme, IFocusZoneProps, mergeStyles } from '@fluentui/react';
44
import { ISubwayNavNodeProps, SubwayNavNodeState } from '../utilities/subway-nav/subway-node.types';
55
import { goToStepById, completeAllSteps, errorAllSteps } from '../utilities/utilities';
66
import { SubwayNav as CustomSubwayNav } from '../utilities/subway-nav/subway-nav';
@@ -10,6 +10,7 @@ import { M365Styles, IM365ExtendedSemanticColors } from '../utilities/customizat
1010
import { useAsync, usePrevious } from '@fluentui/react-hooks';
1111
import { getSubwayNavNodeState } from './DatasetMapping';
1212
import { PPACActualLightTheme, PPACActualDarkTheme } from '../utilities/themes';
13+
import { subwayNavWidth, wizardContentMaxWidth } from '../utilities/wizard';
1314

1415
// reference : https://admincontrolsdemoapps.blob.core.windows.net/demo-app/latest/DemoApp/index.html#/examples/subwaynav
1516

@@ -50,10 +51,10 @@ export const CanvasSubwayNav = React.memo((props: ISubNavProps): React.ReactElem
5051
}
5152
return themeJSON
5253
? createTheme({
53-
palette: { ...JSON.parse(themeJSON).palette },
54-
semanticColors: semanticColorsCopy,
55-
components: M365Styles,
56-
})
54+
palette: { ...JSON.parse(themeJSON).palette },
55+
semanticColors: semanticColorsCopy,
56+
components: M365Styles,
57+
})
5758
: copyofM365Theme;
5859
} catch (ex) {
5960
/* istanbul ignore next */
@@ -155,6 +156,8 @@ export const CanvasSubwayNav = React.memo((props: ISubNavProps): React.ReactElem
155156
focusZoneProps={focusZoneProps}
156157
stateAriaLabels={ariaLabelStrings}
157158
steps={steps}
159+
//This is required to override width styles in custom pages
160+
styles={{ root: { width: props.width } }}
158161
{...(wizardComplete !== 'None' && { wizardComplete: isNavCompleteOrError })}
159162
/>
160163
</ThemeProvider>

SubwayNav/package-lock.json

Lines changed: 9 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SubwayNav/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"@types/powerapps-component-framework": "^1.3.0",
2626
"@types/ramda": "^0.28.8",
2727
"@types/react": "^16.8",
28-
"@types/react-dom": "^18.0.9",
28+
"@types/react-dom": "^16.8.6",
2929
"@types/react-test-renderer": "^17.0.1",
3030
"@typescript-eslint/eslint-plugin": "^4.29.0",
3131
"@typescript-eslint/parser": "^4.29.0",

0 commit comments

Comments
 (0)