Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { makeStyles } from '@mui/styles';

const useStyles = makeStyles(theme => ({
header: {
backgroundColor: theme.palette.mode === 'dark' ? 'var(--app-nav-bg)' : theme.palette.background.paper,
backgroundColor: theme.headerNav.backgroundColor,
borderBottom: `1px solid ${theme.palette.divider}`,
padding: '1rem 0'
},
Expand Down Expand Up @@ -64,10 +64,10 @@ const useStyles = makeStyles(theme => ({
margin: 0,
'& a': {
textDecoration: 'none',
color: theme.palette.mode === 'dark' ? 'var(--app-nav-color)' : theme.palette.text.primary,
color: theme.headerNav.navLinkColor,
transition: 'color 0.3s ease',
'&:hover': {
color: theme.palette.mode === 'dark' ? theme.palette.primary.contrastText : theme.palette.primary.main
color: theme.headerNav.navLinkHoverColor
}
},
'@media (max-width: 768px)': {
Expand Down Expand Up @@ -103,7 +103,7 @@ const useStyles = makeStyles(theme => ({
cursor: 'pointer',
zIndex: 1001,
padding: 0,
color: theme.palette.mode === 'dark' ? theme.palette.primary.contrastText : theme.palette.text.primary,
color: theme.headerNav.menuToggleColor,
'@media (max-width: 768px)': {
display: 'block'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { makeStyles } from '@mui/styles';
import StoreContext from '../../../bridge/Context/StoreContext';
import createPConnectComponent from '../../../bridge/react_pconnect';

import sdkConfigData from '../../../../../../sdk-config.json';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this import

import ShoppingOptionCard from '../ShoppingOptionCard';
import ResolutionScreen from '../ResolutionScreen';
import { shoppingOptions } from '../utils';
Expand Down Expand Up @@ -164,8 +165,7 @@ export default function MainScreen(props) {
if (!mashupCaseType) {
const caseTypes = PCore.getEnvironmentInfo()?.environmentInfoObject?.pyCaseTypeList;
if (caseTypes && caseTypes.length > 0) {
//mashupCaseType = caseTypes[0].pyWorkTypeImplementationClassName;
mashupCaseType = 'DIXL-MediaCo-Work-PurchasePhone';
mashupCaseType = sdkConfigData.authConfig.mashupCaseType;
}
Comment on lines 166 to 168
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need to modify this logic, it should be like below one

if (caseTypes && caseTypes.length > 0) {
        mashupCaseType = caseTypes[0].pyWorkTypeImplementationClassName;
}

}
let selectedPhoneGUID = '';
Expand Down
19 changes: 19 additions & 0 deletions packages/react-sdk-components/src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { Theme } from '@mui/material/styles';

import sdkConfig from '../../../sdk-config.json';


/**
* Since makeStyles is now exported from @mui/styles package which does not know about Theme in the core package.
* you need to augment the DefaultTheme (empty object) in @mui/styles with Theme from the core.
Expand All @@ -20,6 +21,12 @@ declare module '@mui/styles/defaultTheme' {
backgroundColor: string;
topColor: string;
};
headerNav: {
backgroundColor: string;
navLinkColor: string;
navLinkHoverColor: string;
menuToggleColor: string;
};
embedded: {
resolutionTextColor: string;
};
Expand Down Expand Up @@ -145,6 +152,12 @@ const lightTheme = createTheme({
}
}
},
headerNav: {
backgroundColor: '#ffffff',
navLinkColor: 'rgba(0, 0, 0, 0.87)',
navLinkHoverColor: '#3f51b5',
menuToggleColor: 'rgba(0, 0, 0, 0.87)'
},
actionButtons: {
primary: {
backgroundColor: '#cc0f60',
Expand Down Expand Up @@ -212,6 +225,12 @@ const darkTheme = createTheme({
}
}
},
headerNav: {
backgroundColor: 'var(--app-nav-bg)',
navLinkColor: 'var(--app-nav-color)',
navLinkHoverColor: '#ffffff',
menuToggleColor: '#ffffff'
},
actionButtons: {
primary: {
backgroundColor: '#C70BB5',
Expand Down
5 changes: 3 additions & 2 deletions sdk-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"comment_sdk_config": "This is the configuration file for the React SDK Components",
"sdk_optional_configs_doc_comment": "See the document(link below) for more details on all the available config settings",
"sdk_optional_configs_doc": "https://docs.pega.com/bundle/constellation-sdk/page/constellation-sdks/sdks/configuring-sdk-config-json.html",
"theme": "light",
"theme": "dark",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep light as default theme

"authConfig": {
"authService": "pega",

Expand All @@ -14,7 +14,8 @@
"mashupPassword": "",

"portalClientId_comment": "Client ID from the OAuth 2.0 Client Registration record used for portal use case",
"portalClientId": "25795373220702300272"
"portalClientId": "25795373220702300272",
"mashupCaseType": "DIXL-MediaCo-Work-PurchasePhone"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need of new key 'mashupCaseType', appMashupCaseType is already present below

},

"serverConfig": {
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"allowJs": true, // must be false for @pega/pcore-pconnect-typedefs
"noImplicitAny": false,
"allowSyntheticDefaultImports": true,
"resolveJsonModule": true,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this too

// End of copied from SDK-R

// Need to add this to remove errors of .js files trying to compile to the same path
Expand Down
Loading