Skip to content

Commit d9c7771

Browse files
committed
Updated the linting and format issues
1 parent c55327b commit d9c7771

File tree

6 files changed

+542
-359
lines changed

6 files changed

+542
-359
lines changed
Lines changed: 154 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,167 @@
1-
import { Typography } from '@mui/material';
1+
import { useState } from 'react';
22
import { makeStyles } from '@mui/styles';
33

4-
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
4+
const useStyles = makeStyles({
5+
header: {
6+
backgroundColor: '#100a2a',
7+
borderBottom: '1px solid rgba(255, 255, 255, 0.1)',
8+
padding: '1rem 0'
129
},
1310
embedTopIcon: {
1411
width: '40px',
1512
filter: 'invert(100%)'
16-
}
17-
}));
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',
1836

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: '#211649',
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: '#e0e0e0',
68+
transition: 'color 0.3s ease',
69+
'&:hover': {
70+
color: '#ffffff'
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+
}
86+
}
87+
},
88+
profileAvatar: {
89+
height: '32px',
90+
width: '32px',
91+
borderRadius: '50%'
92+
},
93+
menuToggle: {
94+
display: 'none',
95+
background: 'none',
96+
border: 'none',
97+
cursor: 'pointer',
98+
zIndex: 1001,
99+
padding: 0,
100+
'@media (max-width: 768px)': {
101+
display: 'block'
102+
}
103+
}
104+
});
19105
export default function Header() {
20106
const classes = useStyles();
107+
const [isMenuOpen, setMenuOpen] = useState(false);
108+
109+
const toggleMenu = () => {
110+
setMenuOpen(!isMenuOpen);
111+
};
112+
113+
const navMenuClassName = `${classes.navMenu} ${isMenuOpen ? classes.navMenuActive : ''}`;
114+
const navListClassName = `${classes.navList} ${isMenuOpen ? classes.showNavListsOnMobile : ''}`;
21115

22116
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>
117+
<header className={classes.header}>
118+
<nav className={classes.navContainer}>
119+
<a href='/' className={classes.logo}>
120+
<img src='./assets/img/MediaCoLogo.png' alt='MediaCo Logo' />
121+
</a>
122+
123+
<div className={navMenuClassName}>
124+
<ul className={navListClassName}>
125+
<li>
126+
<a href='/'>Mobile</a>
127+
</li>
128+
<li>
129+
<a href='/'>Internet</a>
130+
</li>
131+
<li>
132+
<a href='/'>Coverage</a>
133+
</li>
134+
<li>
135+
<a href='/'>Deals</a>
136+
</li>
137+
</ul>
138+
139+
<ul className={navListClassName}>
140+
<li>
141+
<a href='/'>Find a store</a>
142+
</li>
143+
<li>
144+
<a href='/'>Contact and support</a>
145+
</li>
146+
<li>
147+
<a href='/' className='cart-link'>
148+
Cart
149+
</a>
150+
</li>
151+
<li>
152+
<a href='/' className='profile-link' aria-label='User Profile'>
153+
<img src='./assets/img/Frame 727.png' alt='User Profile' className={classes.profileAvatar} />
154+
</a>
155+
</li>
156+
</ul>
157+
</div>
158+
159+
<button type='button' className={classes.menuToggle} onClick={toggleMenu} aria-label='Open menu'>
160+
<svg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'>
161+
<path d='M4 6H20M4 12H20M4 18H20' stroke='white' strokeWidth='2' strokeLinecap='round' strokeLinejoin='round' />
162+
</svg>
163+
</button>
164+
</nav>
165+
</header>
28166
);
29167
}

0 commit comments

Comments
 (0)