Skip to content

Commit

Permalink
Adding CDAO and Advana images to footer.
Browse files Browse the repository at this point in the history
  • Loading branch information
JLyons1985 committed Jul 12, 2022
1 parent e7c8f85 commit 2e952ce
Show file tree
Hide file tree
Showing 12 changed files with 443 additions and 384 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
This project contains shared platform UI components of Advana.

## Env Variables

* REACT_APP_CLASSIFICATION_BANNER
* REACT_APP_CLASSIFICATION_BANNER_COLOR
* REACT_APP_MEGA_MENU_ENDPOINT
* REACT_APP_MEGA_MENU_ENDPOINT: https://advana.data.mil/api/megamenu/links
* REACT_APP_MEGA_MENU_PILL_TEXT
* REACT_APP_MEGA_MENU_PILL_DEFAULT_HEADER
* REACT_APP_ENCLAVE
Expand All @@ -12,7 +13,9 @@ This project contains shared platform UI components of Advana.
* REACT_APP_MEGA_MENU_TWO_LEVEL_SECTIONS: comma-separated list of sections
* REACT_APP_MEGA_MENU_SEARCH_LINK:
* REACT_APP_MEGA_MENU_HEADER_SORT_ORDER: comma-separated list of headers
* REACT_APP_MEGA_MENU_BASE_DOMAIN: domain for which to point relative MM links to (used in apps to point back to the static landing pages)
* REACT_APP_MEGA_MENU_BASE_DOMAIN: domain for which to point relative MM links to (used in apps to point back to the static landing pages) https://advana.data.mil
* REACT_APP_PROFILE_LINK: this should be set to https://advana.data.mil/#/profile if your MEGA_MENU_BASE_DOMAIN is not set to https://advana.data.mil
* REACT_APP_COOKIE_DOMAIN: advana.data.mil (Used to store the consent banner in a cookie that is used for all subdomains)

## Shared functionality included:

Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dod-advana/advana-platform-ui",
"version": "1.4.11",
"version": "1.4.16",
"private": false,
"repository": {
"type": "git",
Expand Down Expand Up @@ -50,7 +50,7 @@
"dependencies": {
"@babel/plugin-proposal-class-properties": "7.13.0",
"@babel/plugin-syntax-class-properties": "7.12.13",
"@datapunt/matomo-tracker-react": "0.5.0",
"@datapunt/matomo-tracker-react": "0.5.1",
"@material-ui/core": "4.11.4",
"@material-ui/icons": "4.11.2",
"axios": "0.24.0",
Expand Down
19 changes: 19 additions & 0 deletions src/lib/AdvanaFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React, { useState } from 'react';
import styled from 'styled-components';
import { Button, Modal } from '@material-ui/core';
import { changePage, getDynamicHeaderButtons, useMegaMenuLinks } from "./utilities/sitemap";
import CDAOLogo from './images/logos/cdao_logo.png';
import AdvanaLogo from './images/logos/Advana_Approved.png';

const FooterContainer = styled.div`
display: flex;
Expand Down Expand Up @@ -48,6 +50,14 @@ const ButtonRow = styled.div`
margin: 10px 0 0 0;
`;

const LogosSection = styled.div`
display: flex;
img {
width: 140px;
}
`;

export default ({extraLinks}) => {
let links = useMegaMenuLinks();
const headerButtons = getDynamicHeaderButtons(links);
Expand All @@ -60,6 +70,15 @@ export default ({extraLinks}) => {

return(
<FooterContainer>
<LogosSection>
<img
src={CDAOLogo}
style={{ marginLeft: 32, marginRight: 20 }}
alt="cdao-logo"
id={'cdaoLogo'}
/>
<img src={AdvanaLogo} alt="advana-logo" id={'advanaLogo'} />
</LogosSection>
<LinkContainer>
{links}
{extraLinks}
Expand Down
15 changes: 13 additions & 2 deletions src/lib/ConsentAgreement.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
import React, { useState } from 'react';
import { Dialog, Button, DialogTitle, DialogContent, DialogActions, Typography } from '@material-ui/core';
import { Dialog, Button, DialogTitle, DialogContent, DialogActions, Typography} from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
import Config from './config/config';

const AGREEMENT_KEY = 'data.mil-consent-agreed';

const useStyles = makeStyles({
container: {
marginTop: '2em', // adjusting for classification banner
paddingTop: ({ offset }) => offset ?? offset, // adjust for additional banners
},
});

const getIsOpen = () => {
const cookieMap = {};
const cookies = document.cookie.split(';');
Expand All @@ -30,7 +38,9 @@ const setAgreementTime = () => {
document.cookie = `${AGREEMENT_KEY}=${(new Date()).toString()};domain=${Config.COOKIE_DOMAIN};expires=${futureDate.toString()}`;
};

const ConsentAgreement = ({ navigateTo = 'navigate to the Advana App-wide Agreements on the About page' }) => {
const ConsentAgreement = ({ offset, navigateTo = 'navigate to the Advana App-wide Agreements on the About page' }) => {

const classes = useStyles({ offset: offset });

const [isOpen, setIsOpen] = useState(getIsOpen());

Expand All @@ -40,6 +50,7 @@ const ConsentAgreement = ({ navigateTo = 'navigate to the Advana App-wide Agreem
maxWidth="md"
disableBackdropClick={true}
disableEscapeKeyDown={true}
className={classes.container}
data-cy={'consent-agreement'}
>
<DialogTitle disableTypography>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/ToolPageTitle.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ const styles = {
}
};

const ToolPageTitle = ({ logo, alt, beta, extraPillClass = '' }) => {
const ToolPageTitle = ({ logo, alt, beta, unread, extraPillClass = '' }) => {
return (
<div style={styles.pageTitleRow}>
<div style={{ display: 'inline-flex' }}>
{logo && <img src={logo} alt={alt} style={styles.logo} />}
{beta && <div style={styles.beta}>Beta</div>}
</div>
<div style={{ paddingTop: 10 }} className={extraPillClass}>
<AdvanaMegaMenuPill defaultHeader={Config.MEGA_MENU_PILL_DEFAULT_HEADER} margin={'auto 0px'} />
<AdvanaMegaMenuPill unread={unread} defaultHeader={Config.MEGA_MENU_PILL_DEFAULT_HEADER} margin={'auto 0px'} />
</div>
</div>

Expand Down
Binary file added src/lib/images/logos/Advana_Approved.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/lib/images/logos/cdao_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2e952ce

Please sign in to comment.