@@ -27,6 +29,7 @@ ModuleLogo.displayName = "ModuleLogo";
ModuleLogo.propTypes = {
moduleLogo: PropTypes.string,
+ useModuleLogo: PropTypes.bool,
white: PropTypes.bool
};
diff --git a/app/javascript/components/module-logo/utils.js b/app/javascript/components/module-logo/utils.js
index 95d2655c9a..4b93f4055a 100644
--- a/app/javascript/components/module-logo/utils.js
+++ b/app/javascript/components/module-logo/utils.js
@@ -1,6 +1,8 @@
// Copyright (c) 2014 - 2023 UNICEF. All rights reserved.
/* eslint-disable import/prefer-default-export */
+import isEmpty from "lodash/isEmpty";
+
import PrimeroLogo from "../../images/primero-logo.png";
import PrimeroLogoWhite from "../../images/primero-logo-white.png";
import GBVLogo from "../../images/gbv-logo.png";
@@ -13,7 +15,15 @@ import GBVPictorial from "../../images/gbv-pictorial.png";
import CPIMSPictorial from "../../images/cpims-pictorial.png";
import { MODULES } from "../../config";
-export const getLogo = (moduleLogo, white = false) => {
+export const getLogo = (moduleLogo, white = false, themeLogos, useModuleLogo = false) => {
+ if (!isEmpty(themeLogos) && !useModuleLogo) {
+ if (white) {
+ return [themeLogos.secondary, themeLogos.pictorial];
+ }
+
+ return [themeLogos.default, themeLogos.pictorial];
+ }
+
switch (moduleLogo) {
case MODULES.MRM:
return [MRMLogo, PrimeroPictorial];
@@ -21,6 +31,11 @@ export const getLogo = (moduleLogo, white = false) => {
return [white ? GBVLogoWhite : GBVLogo, GBVPictorial];
case MODULES.CP:
return [white ? CPIMSLogoWhite : CPIMSLogo, CPIMSPictorial];
+ case "onlyLogo": {
+ const logo = white ? PrimeroLogoWhite : PrimeroLogo;
+
+ return [logo, logo];
+ }
default:
return [white ? PrimeroLogoWhite : PrimeroLogo, PrimeroPictorial];
}
diff --git a/app/javascript/components/nav/component.jsx b/app/javascript/components/nav/component.jsx
index 025fc4678d..2602dd7f4e 100644
--- a/app/javascript/components/nav/component.jsx
+++ b/app/javascript/components/nav/component.jsx
@@ -6,6 +6,7 @@ import { useDispatch } from "react-redux";
import CloseIcon from "@material-ui/icons/Close";
import { push } from "connected-react-router";
import { isEqual } from "lodash";
+import clsx from "clsx";
import { ROUTES, PERMITTED_URL, APPLICATION_NAV } from "../../config";
import AgencyLogo from "../agency-logo";
@@ -22,6 +23,7 @@ import ActionDialog, { useDialog } from "../action-dialog";
import { useI18n } from "../i18n";
import { hasQueueData } from "../connectivity/selectors";
import FieldMode from "../network-indicator/components/field-mode";
+import PoweredBy from "../powered-by";
import { NAME, LOGOUT_DIALOG } from "./constants";
import css from "./styles.css";
@@ -41,7 +43,7 @@ const Nav = () => {
dispatch(fetchAlerts());
}, []);
- const { demo } = useApp();
+ const { demo, useContainedNavStyle } = useApp();
const username = useMemoizedSelector(state => selectUsername(state), isEqual);
const userId = useMemoizedSelector(state => getUserId(state), isEqual);
@@ -103,6 +105,12 @@ const Nav = () => {
});
};
+ const navListClasses = clsx(css.navList, { [css.contained]: useContainedNavStyle });
+ const translationsToggleClass = clsx(css.translationToggle, css.navTranslationsToggle, {
+ [css.contained]: useContainedNavStyle
+ });
+ const drawerHeaderClasses = clsx(css.drawerHeader, { [css.drawerHeaderContained]: useContainedNavStyle });
+
const drawerContent = (
<>
@@ -110,7 +118,7 @@ const Nav = () => {
-
+
@@ -121,13 +129,14 @@ const Nav = () => {
-
{permittedMenuEntries(APPLICATION_NAV(permissions, userId))}
+
{permittedMenuEntries(APPLICATION_NAV(permissions, userId))}
-
+
+
>
);
diff --git a/app/javascript/components/nav/components/menu-entry/component.jsx b/app/javascript/components/nav/components/menu-entry/component.jsx
index 821d12ec27..aed357cbd1 100644
--- a/app/javascript/components/nav/components/menu-entry/component.jsx
+++ b/app/javascript/components/nav/components/menu-entry/component.jsx
@@ -5,6 +5,7 @@ import PropTypes from "prop-types";
import { ListItem, ListItemText, ListItemIcon } from "@material-ui/core";
import { NavLink } from "react-router-dom";
import { isEqual } from "lodash";
+import clsx from "clsx";
import { useI18n } from "../../../i18n";
import ListIcon from "../../../list-icon";
@@ -19,7 +20,7 @@ import { LOGOUT_DIALOG, NAV_SETTINGS } from "../../constants";
import { ROUTES } from "../../../../config";
const Component = ({ closeDrawer, menuEntry, mobileDisplay, jewelCount, username }) => {
- const { disabledApplication, online } = useApp();
+ const { disabledApplication, online, useContainedNavStyle } = useApp();
const i18n = useI18n();
const dispatch = useDispatch();
@@ -43,7 +44,7 @@ const Component = ({ closeDrawer, menuEntry, mobileDisplay, jewelCount, username
!disabled && {
component: NavLink,
to,
- activeClassName: css.navActive,
+ activeClassName: clsx(css.navActive, { [css.contained]: useContainedNavStyle }),
onClick: closeDrawer,
disabled: disabledApplication
}),
@@ -59,12 +60,13 @@ const Component = ({ closeDrawer, menuEntry, mobileDisplay, jewelCount, username
const userRecordTypes = [...userPermissions.keys()];
const navItemName = name === "username" ? username : i18n.t(name);
+ const navLinkClasses = clsx(css.navLink, { [css.contained]: useContainedNavStyle });
const renderNavAction = (
{renderDivider}
-
+
diff --git a/app/javascript/components/nav/styles.css b/app/javascript/components/nav/styles.css
index ba561fe8ef..931179756b 100644
--- a/app/javascript/components/nav/styles.css
+++ b/app/javascript/components/nav/styles.css
@@ -19,6 +19,10 @@
position: sticky;
top: 0;
z-index: 9999;
+
+ & hr {
+ display: none;
+ }
}
.drawerHeader {
@@ -26,23 +30,31 @@
justify-content: flex-end;
align-items: center;
padding: var(--spacing-0-1);
- background: var(--c-light-grey);
+ background: var(--c-toolbar-background-color-mobile-header, var(--c-light-grey));
+
+ & button {
+ padding: 6px;
+ margin: var(--sp-1);
+ }
+}
+
+.drawerHeaderContained button {
+ background: var(--c-drawer-header-button);
+ color: var(--c-drawer-header-button-text);
}
-.drawerPaper, .drawerPaper-demo {
+.drawerPaper,
+.drawerPaper-demo {
width: var(--drawer);
- background: linear-gradient(
- to top,
- var(--c-white),
- var(--c-light-grey)
- );
+ background: var(--c-toolbar-background-color);
position: relative;
white-space: nowrap;
border: none;
box-shadow: inset -2px 0 2px -1px rgb(0 0 0 / 5%);
}
-[dir="rtl"] .drawerPaper, [dir="rtl"] .drawerPaper-demo {
+[dir="rtl"] .drawerPaper,
+[dir="rtl"] .drawerPaper-demo {
box-shadow: inset 2px 0 2px -1px rgb(0 0 0 / 5%);
text-align: right;
}
@@ -61,11 +73,12 @@
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
+ color: var(--c-nav-list-text)
}
.navList {
& svg {
- color: var(--c-dark-grey);
+ color: var(--c-nav-list-icon);
}
& li {
@@ -73,6 +86,12 @@
}
}
+.navList.contained {
+ display: flex;
+ flex-direction: column;
+ padding: var(--sp-1);
+}
+
.navListAccount {
flex-grow: 1;
@@ -127,14 +146,29 @@
box-shadow: 0 2px 1px 0 rgba(0, 0, 0, 5%);
& svg {
- color: var(--c-black);
+ color: var(--c-nav-list-icon-active);
+ }
+}
+
+.navActive.contained {
+ background: var(--c-nav-list-bg-active);
+ box-shadow: none;
+ color: var(--c-nav-list-text-active) !important;
+ border-radius: 5px;
+
+ & svg {
+ color: var(--c-nav-list-icon-active);
+ }
+
+ & .listText {
+ color: var(--c-nav-list-text-active)
}
}
.navSeparator {
width: 219px;
height: 1px;
- background: var(--c-warm-grey-1);
+ background: var(--c-nav-list-divider);
margin: 0 auto;
}
@@ -146,6 +180,15 @@
}
}
+.translationToggle.contained {
+ padding: var(--sp-1);
+
+ & button {
+ background: var(--c-white);
+ box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.10);
+ }
+}
+
@media (max-width:959.95px) {
.drawerPaper, .drawerPaper-demo {
box-shadow: none
@@ -159,6 +202,10 @@
}
@media (min-width:960px) and (max-width:1279.95px) {
+ .navLink.contained {
+ padding: 7px !important;
+ }
+
.drawerPaper, .drawerPaper-demo {
width: 4.1em;
overflow-x: hidden;
@@ -187,6 +234,10 @@
.accountListItem {
display: none;
}
+
+ .translationToggle.contained button {
+ padding: 0 !important;
+ }
}
@media (max-width:1279.95px),
diff --git a/app/javascript/components/network-indicator/component.jsx b/app/javascript/components/network-indicator/component.jsx
index 284c8a085a..7dc1e225d1 100644
--- a/app/javascript/components/network-indicator/component.jsx
+++ b/app/javascript/components/network-indicator/component.jsx
@@ -15,7 +15,7 @@ import { NAME } from "./constants";
import css from "./styles.css";
const Component = ({ mobile }) => {
- const { online } = useApp();
+ const { online, useContainedNavStyle } = useApp();
const i18n = useI18n();
const fieldMode = useMemoizedSelector(state => getFieldMode(state));
@@ -24,11 +24,12 @@ const Component = ({ mobile }) => {
[css.networkIndicator]: true,
[css.offline]: !online,
[css.online]: online,
- [css.mobile]: mobile
+ [css.mobile]: mobile,
+ [css.contained]: useContainedNavStyle
});
if (fieldMode) {
- return ;
+ return ;
}
return (
diff --git a/app/javascript/components/network-indicator/components/network-status/component.jsx b/app/javascript/components/network-indicator/components/network-status/component.jsx
index 055cf08352..6e26686a93 100644
--- a/app/javascript/components/network-indicator/components/network-status/component.jsx
+++ b/app/javascript/components/network-indicator/components/network-status/component.jsx
@@ -13,9 +13,9 @@ import { CONNECTED, CONNECTION_LOST, FIELD_MODE_OFFLINE } from "../../../connect
import css from "./styles.css";
-function Component({ mobile }) {
+function Component({ mobile, contained }) {
const i18n = useI18n();
- const { online, fieldMode } = useApp();
+ const { online, fieldMode, useContainedNavStyle } = useApp();
const mode = {
[FIELD_MODE_OFFLINE]: {
@@ -38,8 +38,8 @@ function Component({ mobile }) {
}
}[getConnectionStatus(online, fieldMode)];
- const containerClasses = clsx(css.container, css[mode.color]);
- const listItemClasses = clsx(css.navLink, css[mode.color]);
+ const containerClasses = clsx(css.container, css[mode.color], { [css.containedMobile]: useContainedNavStyle });
+ const listItemClasses = clsx(css.navLink, css[mode.color], { [css.contained]: useContainedNavStyle });
if (mobile) {
return (
@@ -49,7 +49,7 @@ function Component({ mobile }) {
{i18n.t(mode.text)}
-
{i18n.t(mode.textStatus)}
+ {contained ||
{i18n.t(mode.textStatus)}
}
);
@@ -62,7 +62,7 @@ function Component({ mobile }) {
{i18n.t(mode.text)}
@@ -73,6 +73,7 @@ function Component({ mobile }) {
Component.displayName = "NetworkStatus";
Component.propTypes = {
+ contained: PropTypes.bool,
mobile: PropTypes.bool
};
diff --git a/app/javascript/components/network-indicator/components/network-status/styles.css b/app/javascript/components/network-indicator/components/network-status/styles.css
index 379bbdf82c..999c2c8bd7 100644
--- a/app/javascript/components/network-indicator/components/network-status/styles.css
+++ b/app/javascript/components/network-indicator/components/network-status/styles.css
@@ -71,3 +71,25 @@
.listTextRoot {
cursor: default;
}
+
+.containedMobile {
+ background: var(--c-white);
+ border: 1px solid var(--c-network-indicator-border);
+ border-radius: 6px;
+ padding: 4px 8px;
+}
+
+.contained {
+ background: var(--c-white);
+ border: 1px solid var(--c-network-indicator-border);
+ margin: 0 8px;
+ padding: 0 !important;
+ width: 93%;
+ border-radius: 6px;
+}
+
+@media (min-width: 960px) and (max-width: 1279.95px) {
+ .navLink {
+ padding: 0 !important;
+ }
+}
diff --git a/app/javascript/components/network-indicator/styles.css b/app/javascript/components/network-indicator/styles.css
index 0de5b26374..196f153d23 100644
--- a/app/javascript/components/network-indicator/styles.css
+++ b/app/javascript/components/network-indicator/styles.css
@@ -1,7 +1,6 @@
/* Copyright (c) 2014 - 2023 UNICEF. All rights reserved. */
.networkIndicator {
- background: var(--c-white);
margin: 0 8px;
border-radius: 6px;
padding: 4px 8px;
@@ -24,6 +23,11 @@
}
}
+.contained {
+ background: var(--c-white);
+ border: 1px solid var(--c-network-indicator-border);
+}
+
@media (max-width:1279.95px) {
.networkIndicator {
& .status {
diff --git a/app/javascript/components/powered-by/component.jsx b/app/javascript/components/powered-by/component.jsx
new file mode 100644
index 0000000000..51e25a57e6
--- /dev/null
+++ b/app/javascript/components/powered-by/component.jsx
@@ -0,0 +1,34 @@
+import PropTypes from "prop-types";
+
+import { useMemoizedSelector } from "../../libs";
+import { getShowPoweredByPrimero } from "../application/selectors";
+import ModuleLogo from "../module-logo";
+
+import css from "./styles.css";
+
+function Component({ isLogin = false }) {
+ const showPoweredBy = useMemoizedSelector(state => getShowPoweredByPrimero(state));
+
+ if (!showPoweredBy) {
+ return false;
+ }
+
+ return (
+
+ );
+}
+
+Component.displayName = "PoweredBy";
+
+Component.propTypes = {
+ isLogin: PropTypes.bool
+};
+
+export default Component;
diff --git a/app/javascript/components/powered-by/index.js b/app/javascript/components/powered-by/index.js
new file mode 100644
index 0000000000..b6e0586481
--- /dev/null
+++ b/app/javascript/components/powered-by/index.js
@@ -0,0 +1 @@
+export { default } from "./component";
diff --git a/app/javascript/components/powered-by/styles.css b/app/javascript/components/powered-by/styles.css
new file mode 100644
index 0000000000..1a497b1670
--- /dev/null
+++ b/app/javascript/components/powered-by/styles.css
@@ -0,0 +1,40 @@
+.poweredby {
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: var(--sp-1);
+ font-weight: 600;
+ margin: var(--sp-1) 0;
+
+ & img {
+ width: 90px !important;
+ }
+
+ & div {
+ margin: 0;
+ line-height: 0;
+ }
+}
+
+.poweredbyLogin {
+ display: flex;
+ align-items: center;
+ height: 2em;
+ color: white;
+ font-weight: 600;
+ gap: 6px;
+
+ & div {
+ margin: 0;
+ line-height: 0;
+ width: fit-content;
+ }
+
+ & > div:last-of-type {
+ width: 80px;
+ }
+
+ & img {
+ width: 100%;
+ }
+}
\ No newline at end of file
diff --git a/app/javascript/components/translations-toggle/component.jsx b/app/javascript/components/translations-toggle/component.jsx
index 305d777937..620d741b67 100644
--- a/app/javascript/components/translations-toggle/component.jsx
+++ b/app/javascript/components/translations-toggle/component.jsx
@@ -8,6 +8,7 @@ import { DropdownDoubleIcon } from "../../images/primero-icons";
import { useI18n } from "../i18n";
import { selectLocales } from "../application/selectors";
import useMemoizedSelector from "../../libs/use-memoized-selector";
+import { useApp } from "../application";
import css from "./styles.css";
import { NAME } from "./constants";
@@ -15,6 +16,7 @@ import { NAME } from "./constants";
const TranslationsToggle = () => {
const { changeLocale, locale, ...i18n } = useI18n();
const [anchorEl, setAnchorEl] = useState(null);
+ const { useContainedNavStyle } = useApp();
const handleClick = event => {
setAnchorEl(event.currentTarget);
@@ -48,9 +50,12 @@ const TranslationsToggle = () => {
);
};
+ const buttonVariant = useContainedNavStyle ? "contained" : "text";
+
return (
<>