Skip to content

Commit

Permalink
Merge pull request #2328 from OneCommunityGlobal/Nahiyan_Dropdown-ite…
Browse files Browse the repository at this point in the history
…ms-in-dark-mode

Nahiyan_Dark mode on dropdown items
  • Loading branch information
one-community authored Jul 6, 2024
2 parents ea2d8ec + 5fe04b0 commit 6cc06ed
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
10 changes: 9 additions & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ body {
background-color: #3A506B !important;
}

.bg-yinmn-blue-light{
background-color:#2f4157;
}

.bg-azure{
background-color: #007BFF !important;
}
Expand All @@ -130,7 +134,11 @@ body {
}

.text-dark-green{
background-color: #193D31 !important;
color: #193D31 !important;
}

.text-custom-grey{
color: rgb(192, 192, 192) !important;
}

.box-shadow-dark {
Expand Down
4 changes: 4 additions & 0 deletions src/components/Header/Header.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@
align-items: center;
}

.dropdown-item-hover:hover{
background-color: #2f4157 !important;
}

@media (max-width: 1400px) {
.nav-links{
flex-direction: column !important;
Expand Down
34 changes: 18 additions & 16 deletions src/components/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,8 @@ export function Header(props) {
}
}, [lastDismissed, userId, userDashboardProfile]);

const fontColor = darkMode ? 'text-white dropdown-item-hover' : '';

return (
<div className="header-wrapper">
<Navbar className="py-3 navbar" color="dark" dark expand="md">
Expand Down Expand Up @@ -310,18 +312,18 @@ export function Header(props) {
<DropdownToggle nav caret>
<span className="dashboard-text-link">{REPORTS}</span>
</DropdownToggle>
<DropdownMenu>
<DropdownMenu className={darkMode ? 'bg-yinmn-blue' : ''}>
{canGetReports &&
<DropdownItem tag={Link} to="/reports">
<DropdownItem tag={Link} to="/reports" className={`${fontColor}`}>
{REPORTS}
</DropdownItem>
}
{canGetWeeklySummaries &&
<DropdownItem tag={Link} to="/weeklysummariesreport">
<DropdownItem tag={Link} to="/weeklysummariesreport" className={fontColor}>
{WEEKLY_SUMMARIES_REPORT}
</DropdownItem>
}
<DropdownItem tag={Link} to="/teamlocations">
<DropdownItem tag={Link} to="/teamlocations" className={fontColor}>
{TEAM_LOCATIONS}
</DropdownItem>
</DropdownMenu>
Expand Down Expand Up @@ -353,40 +355,40 @@ export function Header(props) {
<DropdownToggle nav caret>
<span className="dashboard-text-link">{OTHER_LINKS}</span>
</DropdownToggle>
<DropdownMenu>
<DropdownMenu className={darkMode ? 'bg-yinmn-blue' : ''}>
{canAccessUserManagement ? (
<DropdownItem tag={Link} to="/usermanagement">
<DropdownItem tag={Link} to="/usermanagement" className={fontColor}>
{USER_MANAGEMENT}
</DropdownItem>
) : (
<React.Fragment></React.Fragment>
)}
{canAccessBadgeManagement ? (
<DropdownItem tag={Link} to="/badgemanagement">
<DropdownItem tag={Link} to="/badgemanagement" className={fontColor}>
{BADGE_MANAGEMENT}
</DropdownItem>
) : (
<React.Fragment></React.Fragment>
)}
{(canAccessProjects) && (
<DropdownItem tag={Link} to="/projects">
<DropdownItem tag={Link} to="/projects" className={fontColor}>
{PROJECTS}
</DropdownItem>
)}
{(canAccessTeams) && (
<DropdownItem tag={Link} to="/teams">
<DropdownItem tag={Link} to="/teams" className={fontColor}>
{TEAMS}
</DropdownItem>
)}
{(canAccessPermissionsManagement) && (
<DropdownItem tag={Link} to="/announcements">
<DropdownItem tag={Link} to="/announcements" className={fontColor}>
{SEND_EMAILS}
</DropdownItem>
)}
{canAccessPermissionsManagement && (
<>
<DropdownItem divider />
<DropdownItem tag={Link} to="/permissionsmanagement">
<DropdownItem tag={Link} to="/permissionsmanagement" className={fontColor}>
{PERMISSIONS_MANAGEMENT}
</DropdownItem>
</>
Expand All @@ -410,22 +412,22 @@ export function Header(props) {
{WELCOME}, {firstName}
</span>
</DropdownToggle>
<DropdownMenu>
<DropdownItem header>Hello {firstName}</DropdownItem>
<DropdownMenu className={darkMode ? 'bg-yinmn-blue' : ''}>
<DropdownItem header className={darkMode ? 'text-custom-grey' : ''}>Hello {firstName}</DropdownItem>
<DropdownItem divider />
<DropdownItem tag={Link} to={`/userprofile/${displayUserId}`}>
<DropdownItem tag={Link} to={`/userprofile/${displayUserId}`} className={fontColor}>
{VIEW_PROFILE}
</DropdownItem>
{!cantUpdateDevAdminDetails(props.userProfile.email, props.userProfile.email) && (
<DropdownItem tag={Link} to={`/updatepassword/${displayUserId}`}>
<DropdownItem tag={Link} to={`/updatepassword/${displayUserId}`} className={fontColor}>
{UPDATE_PASSWORD}
</DropdownItem>
)}
<DropdownItem>
<DarkModeButton />
</DropdownItem>
<DropdownItem divider />
<DropdownItem onClick={openModal}>{LOGOUT}</DropdownItem>
<DropdownItem onClick={openModal} className={fontColor}>{LOGOUT}</DropdownItem>
</DropdownMenu>
</UncontrolledDropdown>
</div>
Expand Down

0 comments on commit 6cc06ed

Please sign in to comment.