Skip to content

Commit bb5dcad

Browse files
committed
Merge branch '1135-Refactor-Layout-Components-Footer' into 1135-wiring-up-veda-config
2 parents 6bf3149 + 4e3a21a commit bb5dcad

File tree

7 files changed

+259
-471
lines changed

7 files changed

+259
-471
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ GOOGLE_FORM = 'https://docs.google.com/forms/d/e/1FAIpQLSfGcd3FDsM3kQIOVKjzdPn4f
1414

1515
SHOW_CONFIGURABLE_COLOR_MAP = 'TRUE'
1616

17+
# Enables the refactor page header component that uses the USWDS design system
1718
ENABLE_USWDS_PAGE_HEADER = 'TRUE'
19+
# Enables the refactor page footer component that uses the USWDS design system
1820
ENABLE_USWDS_PAGE_FOOTER = 'TRUE'

app/scripts/components/common/layout-root/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { getBannerFromVedaConfig, getCookieConsentFromVedaConfig } from 'veda';
1515
import MetaTags from '../meta-tags';
1616
import PageFooter from '../page-footer';
1717
import PageFooterLegacy from '../page-footer-legacy';
18+
import NasaLogoColor from '../nasa-logo-color';
1819

1920
const Banner = React.lazy(() => import('../banner'));
2021
const CookieConsent = React.lazy(() => import('../cookie-consent'));
@@ -117,6 +118,7 @@ function LayoutRoot(props: { children?: ReactNode }) {
117118
subNavItems
118119
}}
119120
hideFooter={hideFooter}
121+
logoSvg={<NasaLogoColor />}
120122
/>
121123
) : (
122124
<PageFooterLegacy hideFooter={hideFooter} />

app/scripts/components/common/nasa-logo-color.js

Lines changed: 245 additions & 207 deletions
Large diffs are not rendered by default.

app/scripts/components/common/page-footer/index.tsx

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useMemo } from 'react';
22
import { Icon } from '@trussworks/react-uswds';
33
//TO DO: need to move NasaLogoColor outside of component and pass down as props
4-
import NasaLogoColor from '../../nasa-logo-color.js';
54
import { NavItemType } from '../page-header/types.js';
65
import { NavItemCTA } from '../page-header/nav/nav-item-cta.js';
76
import {
@@ -15,13 +14,16 @@ import './styles.scss';
1514
interface PageFooterProps {
1615
primarySection: any;
1716
settings: any;
18-
hidefooter?: boolean;
17+
hideFooter?: boolean;
18+
logoSvg?: SVGElement | JSX.Element;
1919
}
20-
//TODO: clean up PageFooterProps
20+
//TODO: clean up PageFooterProps, Unexpected any. Specify a different interface.
21+
2122
export default function PageFooter({
2223
settings,
2324
primarySection,
24-
hidefooter
25+
hideFooter,
26+
logoSvg
2527
}: PageFooterProps) {
2628
const returnToTopButton = () => {
2729
return (
@@ -91,7 +93,7 @@ export default function PageFooter({
9193
<USWDSFooter
9294
size='slim'
9395
returnToTop={returnToTop && returnToTopButton()}
94-
className={hidefooter && 'display-none'}
96+
className={hideFooter && 'display-none'}
9597
primary={
9698
<div
9799
id='footer_primary_container'
@@ -117,7 +119,7 @@ export default function PageFooter({
117119
<div id='footer_secondary_container' className='grid-row'>
118120
<div id='logo-container'>
119121
<a id='logo-container-link' href='#'>
120-
{NasaLogoColor()}
122+
<>{logoSvg}</>
121123
<span className='footer-text'>
122124
NASA EarthData 2024 • v0.17.0
123125
{/* {version} */}

app/scripts/components/common/page-footer/styles.scss

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,5 @@
11
@use '$styles/veda-ui-theme-vars.scss' as themeVars;
22

3-
#logo-container {
4-
display: flex;
5-
font-family: themeVars.$veda-uswds-basefont-sans;
6-
gap: themeVars.$veda-uswds-spacing-105;
7-
8-
#logo-container-link {
9-
display: flex;
10-
align-items: center;
11-
gap: themeVars.$veda-uswds-spacing-105;
12-
font-weight: themeVars.$veda-uswds-fontweight-bold;
13-
font-size: themeVars.$veda-uswds-fontsize-lg;
14-
}
15-
16-
#nasa-logo-pos {
17-
opacity: 1;
18-
transform: translate(0, -100%);
19-
/* TODO: Fix the svg to not require any styles!
20-
* - set opacity to 1 in svg and fix translation
21-
*/
22-
}
23-
24-
svg {
25-
height: 2.75rem;
26-
width: auto;
27-
}
28-
}
293
.footer-text {
304
color: white;
315
align-self: center;
@@ -50,7 +24,6 @@
5024
.usa-footer__primary-section {
5125
background-color: themeVars.$veda-uswds-color-base-lightest;
5226
text-underline-offset: themeVars.$veda-uswds-spacing-5;
53-
5427
}
5528

5629
#mail_icon {

app/scripts/components/common/page-header/logo-container/styles.scss

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
display: flex;
55
font-family: themeVars.$veda-uswds-basefont-sans;
66
gap: themeVars.$veda-uswds-spacing-105;
7+
max-height: 2.5rem;
78

89
#logo-container-link {
910
display: flex;
@@ -13,25 +14,12 @@
1314
font-size: themeVars.$veda-uswds-fontsize-lg;
1415
}
1516

16-
#nasa-logo-pos {
17-
opacity: 1;
18-
transform: translate(0, -100%);
19-
/* TODO: Fix the svg to not require any styles!
20-
* - set opacity to 1 in svg and fix translation
21-
*/
22-
}
23-
2417
@media (width <= themeVars.$veda-uswds-spacing-desktop) {
25-
#nasa-logo-pos {
18+
svg {
2619
display: none;
2720
}
2821
}
2922

30-
svg {
31-
height: 2.5rem;
32-
width: auto;
33-
}
34-
3523
#logo-container-beta-tag {
3624
color: white;
3725
align-self: center;

0 commit comments

Comments
 (0)