Skip to content

Commit 3c7bd20

Browse files
Added theme changes and Embedded changes (#576)
* Theme changes and Embedded changes * Updated the sdkCssVars file * Theme update and header component update * updated the case reference in the embedded main screen * Case type is added in the sdk config for embedded * Change in mainscreen code to identify the casetype to launch for embedded --------- Co-authored-by: Siva Rama Krishna <[email protected]>
1 parent 6a0dddd commit 3c7bd20

File tree

16 files changed

+573
-363
lines changed

16 files changed

+573
-363
lines changed

assets/css/sdkCssVars.css

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
11
/* CSS Variables used in SDK components */
22
:root {
33

4-
--app-primary-color: #007bff; /* was #673ab7; */
5-
--app-primary-dark-color: #0048cc; /* was #4527A0; */
6-
--app-primary-light-color: #33aeff; /* was #B499FC; */
7-
--app-secondary-color: #FFC400;
8-
--app-neutral-color: grey;
9-
--app-neutral-light-color: lightgrey;
10-
--app-neutral-dark-color: #262626;
11-
--app-error-color: #f44336;
12-
--app-error-light-color: #e57373;
13-
--app-error-dark-color: #d32f2f;
14-
--app-warning-color: #ff9800;
15-
--app-warning-color-light: #ffb74d;
16-
--app-warning-color-dark: #f57c00;
17-
18-
--app-background-color: whitesmoke;
19-
--app-form-color: white;
20-
214
/* svg filter colors that match above, go here to generate https://codepen.io/sosuke/pen/Pjoqqp */
225
/* replaced 3 filters when the primary, primary-dark, and primary-light were updated above
236
--app-primary-color-filter: invert(23%) sepia(23%) saturate(6785%) hue-rotate(250deg) brightness(93%) contrast(88%);
@@ -31,11 +14,9 @@
3114
--app-neutral-color-filter: invert(55%) sepia(25%) saturate(0%) hue-rotate(269deg) brightness(87%) contrast(91%);
3215
--app-neutral-light-color-filter: invert(69%) sepia(74%) saturate(0%) hue-rotate(205deg) brightness(102%) contrast(103%);
3316
--app-white-color-filter: invert(100%) sepia(99%) saturate(0%) hue-rotate(144deg) brightness(109%) contrast(101%);
34-
35-
17+
18+
3619
/* App Navigation */
37-
--app-nav-bg: #262626; /*!default*/
38-
--app-nav-color: #d9d9d9; /* invert( var(--app-nav-bg)) !default */
3920
--app-nav-width: 13rem; /*!default*/
4021
/* $app-nav-width: 15.625rem !default; */
4122
--app-nav-width-expanded: 13rem /*!default*/;

assets/img/GoldPhone.png

36.6 KB
Loading

assets/img/MediaCoLogo.png

4.16 KB
Loading

assets/img/SDKDevicesImage.png

120 KB
Loading

assets/img/SilverPhone.png

33 KB
Loading

assets/img/SuccessIcon.png

2.17 KB
Loading

assets/img/UserProfile.png

4.76 KB
Loading

assets/img/WhitePhone.png

30.6 KB
Loading

sdk-config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"comment_sdk_config": "This is the configuration file for the React SDK",
33
"sdk_optional_configs_doc_comment": "See the document(link below) for more details on all the available config settings",
44
"sdk_optional_configs_doc": "https://docs.pega.com/bundle/constellation-sdk/page/constellation-sdks/sdks/configuring-sdk-config-json.html",
5-
"theme": "light",
5+
"theme": "dark",
66
"authConfig": {
77
"authService": "pega",
88

@@ -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"]
Lines changed: 159 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,173 @@
1-
import { Typography } from '@mui/material';
1+
import { useState } from 'react';
22
import { makeStyles } from '@mui/styles';
33

44
const useStyles = makeStyles(theme => ({
5-
embeddedHeader: {
6-
display: 'flex',
7-
alignItems: 'center',
8-
height: '64px',
9-
padding: '0px 20px',
10-
backgroundColor: theme.palette.primary.main,
11-
color: theme.palette.primary.contrastText
5+
header: {
6+
backgroundColor: theme.headerNav.backgroundColor,
7+
borderBottom: `1px solid ${theme.palette.divider}`,
8+
padding: '1rem 0'
129
},
1310
embedTopIcon: {
1411
width: '40px',
15-
filter: 'invert(100%)'
12+
filter: 'var(--svg-color)'
13+
},
14+
navContainer: {
15+
width: '90%',
16+
maxWidth: '1400px',
17+
margin: '0 auto',
18+
display: 'flex',
19+
alignItems: 'center',
20+
justifyContent: 'space-between',
21+
gap: '1.5rem'
22+
},
23+
logo: {
24+
'& img': {
25+
height: '35px',
26+
width: 'auto',
27+
verticalAlign: 'middle'
28+
}
29+
},
30+
31+
navMenu: {
32+
flexGrow: 1,
33+
display: 'flex',
34+
justifyContent: 'space-between',
35+
alignItems: 'center',
36+
37+
'@media (max-width: 768px)': {
38+
position: 'fixed',
39+
top: 0,
40+
right: '-100%',
41+
width: '80%',
42+
maxWidth: '320px',
43+
height: '100vh',
44+
backgroundColor: 'var(--utility-background-color)',
45+
boxShadow: '-5px 0 15px rgba(0,0,0,0.2)',
46+
flexDirection: 'column',
47+
justifyContent: 'center',
48+
gap: '3rem',
49+
transition: 'right 0.3s ease-in-out',
50+
zIndex: 1000
51+
}
52+
},
53+
navMenuActive: {
54+
'@media (max-width: 768px)': {
55+
right: 0
56+
}
57+
},
58+
navList: {
59+
display: 'flex',
60+
gap: '1.5rem',
61+
alignItems: 'center',
62+
listStyle: 'none',
63+
padding: 0,
64+
margin: 0,
65+
'& a': {
66+
textDecoration: 'none',
67+
color: theme.headerNav.navLinkColor,
68+
transition: 'color 0.3s ease',
69+
'&:hover': {
70+
color: theme.headerNav.navLinkHoverColor
71+
}
72+
},
73+
'@media (max-width: 768px)': {
74+
display: 'none'
75+
}
76+
},
77+
showNavListsOnMobile: {
78+
'$navMenuActive &': {
79+
'@media (max-width: 768px)': {
80+
display: 'flex',
81+
flexDirection: 'column',
82+
gap: '2rem',
83+
width: '100%',
84+
textAlign: 'center',
85+
'& a': {
86+
color: theme.palette.text.primary,
87+
'&:hover': {
88+
color: theme.palette.primary.main
89+
}
90+
}
91+
}
92+
}
93+
},
94+
profileAvatar: {
95+
height: '32px',
96+
width: '32px',
97+
borderRadius: '50%'
98+
},
99+
menuToggle: {
100+
display: 'none',
101+
background: 'none',
102+
border: 'none',
103+
cursor: 'pointer',
104+
zIndex: 1001,
105+
padding: 0,
106+
color: theme.headerNav.menuToggleColor,
107+
'@media (max-width: 768px)': {
108+
display: 'block'
109+
}
16110
}
17111
}));
18-
19112
export default function Header() {
20113
const classes = useStyles();
114+
const [isMenuOpen, setMenuOpen] = useState(false);
115+
116+
const toggleMenu = () => {
117+
setMenuOpen(!isMenuOpen);
118+
};
119+
120+
const navMenuClassName = `${classes.navMenu} ${isMenuOpen ? classes.navMenuActive : ''}`;
121+
const navListClassName = `${classes.navList} ${isMenuOpen ? classes.showNavListsOnMobile : ''}`;
21122

22123
return (
23-
<div className={classes.embeddedHeader}>
24-
<Typography variant='h4'>{PCore.getEnvironmentInfo().getApplicationLabel()}</Typography>
25-
&nbsp;&nbsp;&nbsp;&nbsp;
26-
<img src='./assets/img/antenna.svg' className={classes.embedTopIcon} />
27-
</div>
124+
<header className={classes.header}>
125+
<nav className={classes.navContainer}>
126+
<a href='/' className={classes.logo}>
127+
<img src='./assets/img/MediaCoLogo.png' alt='MediaCo Logo' />
128+
</a>
129+
130+
<div className={navMenuClassName}>
131+
<ul className={navListClassName}>
132+
<li>
133+
<a href='/'>Mobile</a>
134+
</li>
135+
<li>
136+
<a href='/'>Internet</a>
137+
</li>
138+
<li>
139+
<a href='/'>Coverage</a>
140+
</li>
141+
<li>
142+
<a href='/'>Deals</a>
143+
</li>
144+
</ul>
145+
146+
<ul className={navListClassName}>
147+
<li>
148+
<a href='/'>Find a store</a>
149+
</li>
150+
<li>
151+
<a href='/'>Contact and support</a>
152+
</li>
153+
<li>
154+
<a href='/' className='cart-link'>
155+
Cart
156+
</a>
157+
</li>
158+
<li>
159+
<a href='/' className='profile-link' aria-label='User Profile'>
160+
<img src='./assets/img/UserProfile.png' alt='User Profile' className={classes.profileAvatar} />
161+
</a>
162+
</li>
163+
</ul>
164+
</div>
165+
<button type='button' className={classes.menuToggle} onClick={toggleMenu} aria-label='Open menu'>
166+
<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
167+
<path d='M4 6H20M4 12H20M4 18H20' stroke='currentColor' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' />
168+
</svg>
169+
</button>
170+
</nav>
171+
</header>
28172
);
29173
}

0 commit comments

Comments
 (0)