Skip to content

Commit ee8f143

Browse files
fix: header theme changes in embedded sample (#510)
* Theme file change and header component update in embedded --------- Co-authored-by: Siva Rama Krishna <[email protected]> Co-authored-by: tumms2021389 <[email protected]>
1 parent 5adcd0a commit ee8f143

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

packages/react-sdk-components/src/samples/Embedded/Header/index.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { makeStyles } from '@mui/styles';
33

44
const useStyles = makeStyles(theme => ({
55
header: {
6-
backgroundColor: theme.palette.mode === 'dark' ? 'var(--app-nav-bg)' : theme.palette.background.paper,
6+
backgroundColor: theme.headerNav.backgroundColor,
77
borderBottom: `1px solid ${theme.palette.divider}`,
88
padding: '1rem 0'
99
},
@@ -64,10 +64,10 @@ const useStyles = makeStyles(theme => ({
6464
margin: 0,
6565
'& a': {
6666
textDecoration: 'none',
67-
color: theme.palette.mode === 'dark' ? 'var(--app-nav-color)' : theme.palette.text.primary,
67+
color: theme.headerNav.navLinkColor,
6868
transition: 'color 0.3s ease',
6969
'&:hover': {
70-
color: theme.palette.mode === 'dark' ? theme.palette.primary.contrastText : theme.palette.primary.main
70+
color: theme.headerNav.navLinkHoverColor
7171
}
7272
},
7373
'@media (max-width: 768px)': {
@@ -103,7 +103,7 @@ const useStyles = makeStyles(theme => ({
103103
cursor: 'pointer',
104104
zIndex: 1001,
105105
padding: 0,
106-
color: theme.palette.mode === 'dark' ? theme.palette.primary.contrastText : theme.palette.text.primary,
106+
color: theme.headerNav.menuToggleColor,
107107
'@media (max-width: 768px)': {
108108
display: 'block'
109109
}

packages/react-sdk-components/src/samples/Embedded/MainScreen/index.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,7 @@ export default function MainScreen(props) {
164164
if (!mashupCaseType) {
165165
const caseTypes = PCore.getEnvironmentInfo()?.environmentInfoObject?.pyCaseTypeList;
166166
if (caseTypes && caseTypes.length > 0) {
167-
//mashupCaseType = caseTypes[0].pyWorkTypeImplementationClassName;
168-
mashupCaseType = 'DIXL-MediaCo-Work-PurchasePhone';
167+
mashupCaseType = mashupCaseType = caseTypes[0].pyWorkTypeImplementationClassName;
169168
}
170169
}
171170
let selectedPhoneGUID = '';

packages/react-sdk-components/src/theme.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ declare module '@mui/styles/defaultTheme' {
2020
backgroundColor: string;
2121
topColor: string;
2222
};
23+
headerNav: {
24+
backgroundColor: string;
25+
navLinkColor: string;
26+
navLinkHoverColor: string;
27+
menuToggleColor: string;
28+
};
2329
embedded: {
2430
resolutionTextColor: string;
2531
};
@@ -145,6 +151,12 @@ const lightTheme = createTheme({
145151
}
146152
}
147153
},
154+
headerNav: {
155+
backgroundColor: '#ffffff',
156+
navLinkColor: 'rgba(0, 0, 0, 0.87)',
157+
navLinkHoverColor: '#3f51b5',
158+
menuToggleColor: 'rgba(0, 0, 0, 0.87)'
159+
},
148160
actionButtons: {
149161
primary: {
150162
backgroundColor: '#cc0f60',
@@ -212,6 +224,12 @@ const darkTheme = createTheme({
212224
}
213225
}
214226
},
227+
headerNav: {
228+
backgroundColor: 'var(--app-nav-bg)',
229+
navLinkColor: 'var(--app-nav-color)',
230+
navLinkHoverColor: '#ffffff',
231+
menuToggleColor: '#ffffff'
232+
},
215233
actionButtons: {
216234
primary: {
217235
backgroundColor: '#C70BB5',

sdk-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"appPortal": "",
3232

3333
"appMashupCaseType_comment": "If specified, uses this case type for mashup. Otherwise, uses the first case type found for the app",
34-
"appMashupCaseType": "",
34+
"appMashupCaseType": "DIXL-MediaCo-Work-PurchasePhone",
3535

3636
"excludePortals_comment": "Array of specific portals to avoid attempting to load with SDK",
3737
"excludePortals": ["pxExpress", "Developer", "pxPredictionStudio", "pxAdminStudio", "pyCaseWorker", "pyCaseManager7"]

0 commit comments

Comments
 (0)