Skip to content

Commit 886912e

Browse files
committed
cleaning up veda.config and styling
1 parent bb5dcad commit 886912e

File tree

6 files changed

+25
-113
lines changed

6 files changed

+25
-113
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ import Logo from '$components/common/page-header-legacy/logo';
2929
import {
3030
mainNavItems,
3131
subNavItems,
32-
footerSettings,
33-
footerPrimaryContactItems,
34-
footerPrimaryNavItems
32+
footerSettings
3533
} from '$components/common/page-header/default-config';
3634
import { checkEnvFlag } from '$utils/utils';
3735

@@ -112,8 +110,6 @@ function LayoutRoot(props: { children?: ReactNode }) {
112110
<PageFooter
113111
settings={footerSettings}
114112
primarySection={{
115-
footerPrimaryContactItems,
116-
footerPrimaryNavItems,
117113
mainNavItems,
118114
subNavItems
119115
}}

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
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 { NavItemType } from '../page-header/types.js';
5-
import { NavItemCTA } from '../page-header/nav/nav-item-cta.js';
4+
import { NavItemType } from '../page-header/types';
5+
import { NavItemCTA } from '../page-header/nav/nav-item-cta';
66
import {
77
USWDSFooter,
88
USWDSFooterNav,
@@ -29,7 +29,7 @@ export default function PageFooter({
2929
return (
3030
<div
3131
id='return-to-top-container'
32-
className=' margin-left-auto margin-right-auto padding-x-4'
32+
className=' margin-left-auto margin-right-auto'
3333
>
3434
<a className='usa-link text-primary' href='#'>
3535
Return to top
@@ -40,12 +40,7 @@ export default function PageFooter({
4040

4141
const { returnToTop, secondarySection } = settings;
4242
/* eslint-disable */
43-
const {
44-
footerPrimaryContactItems,
45-
footerPrimaryNavItems,
46-
mainNavItems,
47-
subNavItems
48-
} = primarySection;
43+
const { mainNavItems, subNavItems } = primarySection;
4944

5045
const createNavElement = (navItems, linkClasses) => {
5146
//removing 'dropdown' items from array

app/scripts/components/common/page-header/default-config.ts

Lines changed: 3 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {
22
getString,
33
getNavItemsFromVedaConfig,
4-
getFooterItemsFromVedaConfig
4+
getFooterSettingsFromVedaConfig
55
} from 'veda';
66
import {
77
InternalNavLink,
@@ -78,42 +78,6 @@ const defaultFooterSettings = {
7878
returnToTop: true
7979
};
8080

81-
const defaultFooterPrimaryContactItems = [
82-
{
83-
title: 'News and Events',
84-
to: '/data-catalog',
85-
type: 'internalLink'
86-
},
87-
{
88-
title: 'About',
89-
to: '/data-catalog',
90-
type: 'internalLink'
91-
},
92-
{
93-
title: 'Contact Us',
94-
to: '/data-catalog',
95-
type: 'internalLink'
96-
}
97-
];
98-
99-
const defaultFooterPrimaryNavItems = [
100-
{
101-
title: 'Stories',
102-
to: '/data-catalog',
103-
type: 'internalLink'
104-
},
105-
{
106-
title: 'Topics',
107-
to: '/data-catalog',
108-
type: 'internalLink'
109-
},
110-
{
111-
title: 'Data Toolkit',
112-
to: '/data-catalog',
113-
type: 'internalLink'
114-
}
115-
];
116-
11781
if (process.env.GOOGLE_FORM !== undefined) {
11882
defaultSubNavItems = [
11983
...defaultSubNavItems,
@@ -131,18 +95,6 @@ const mainNavItems =
13195
const subNavItems =
13296
getNavItemsFromVedaConfig()?.subNavItems ?? defaultSubNavItems;
13397
const footerSettings =
134-
getFooterItemsFromVedaConfig()?.footerSettings ?? defaultFooterSettings;
135-
const footerPrimaryContactItems =
136-
getFooterItemsFromVedaConfig()?.footerPrimaryContactItems ??
137-
defaultFooterPrimaryContactItems;
138-
const footerPrimaryNavItems =
139-
getFooterItemsFromVedaConfig()?.footerPrimaryNavItems ??
140-
defaultFooterPrimaryNavItems;
98+
getFooterSettingsFromVedaConfig() ?? defaultFooterSettings;
14199

142-
export {
143-
mainNavItems,
144-
subNavItems,
145-
footerSettings,
146-
footerPrimaryContactItems,
147-
footerPrimaryNavItems
148-
};
100+
export { mainNavItems, subNavItems, footerSettings };

mock/veda.config.js

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -50,43 +50,10 @@ let mainNavItems = [
5050
type: 'internalLink'
5151
}
5252
];
53-
let footerPrimaryNavItems = [
54-
{
55-
title: 'Data Catalog',
56-
to: '/data-catalog',
57-
type: 'internalLink'
58-
},
59-
{
60-
title: 'Data Catalog 2',
61-
to: '/data-catalog',
62-
type: 'internalLink'
63-
},
64-
{
65-
title: 'Data Catalog3',
66-
to: '/data-catalog',
67-
type: 'internalLink'
68-
}
69-
];
70-
let footerPrimaryContactItems = [
71-
{
72-
title: 'News and Events',
73-
to: '/data-catalog',
74-
type: 'internalLink'
75-
},
76-
{
77-
title: 'About',
78-
to: '/data-catalog',
79-
type: 'internalLink'
80-
},
81-
{
82-
title: 'Contact Us',
83-
to: '/data-catalog',
84-
type: 'internalLink'
85-
}
86-
];
8753

8854
let footerSettings = {
8955
secondarySection: {
56+
id: 'stories',
9057
title: 'email test',
9158
to: '/data-catalog',
9259
type: 'Email'
@@ -155,11 +122,8 @@ module.exports = {
155122
mainNavItems,
156123
subNavItems
157124
},
158-
footerItems: {
159-
footerSettings,
160-
footerPrimaryContactItems,
161-
footerPrimaryNavItems
162-
},
125+
126+
footerSettings,
163127
cookieConsentForm: {
164128
title: 'Cookie Consent',
165129
copy: 'We use cookies to enhance your browsing experience and to help us understand how our website is used. These cookies allow us to collect data on site usage and improve our services based on your interactions. To learn more about it, see our [Privacy Policy](https://www.nasa.gov/privacy/#cookies)',

parcel-resolver-veda/index.d.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,16 @@ declare module 'veda' {
293293
}
294294
type NavLinkItem = ExternalNavLink | InternalNavLink;
295295

296+
interface FooterSettings {
297+
secondarySection: {
298+
id: string;
299+
title: string;
300+
href: string;
301+
type: 'Email';
302+
};
303+
returnToTop: boolean;
304+
}
305+
296306
export interface DropdownNavLink {
297307
id: string;
298308
title: string;
@@ -354,13 +364,9 @@ declare module 'veda' {
354364
}
355365
| undefined;
356366

357-
export const getFooterItemsFromVedaConfig: () =>
367+
export const getFooterSettingsFromVedaConfig: () =>
358368
| {
359-
footerSettings: (NavLinkItem | DropdownNavLink)[] | undefined;
360-
footerPrimaryContactItems:
361-
| (NavLinkItem | DropdownNavLink)[]
362-
| undefined;
363-
footerPrimaryNavItems: (NavLinkItem | DropdownNavLink)[] | undefined;
369+
footerSettings: FooterSettings;
364370
}
365371
| undefined;
366372

parcel-resolver-veda/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,7 @@ module.exports = new Resolver({
229229
banner: ${getBannerContent(result)},
230230
navItems: ${JSON.stringify(result.navItems)},
231231
cookieConsentForm: ${getCookieConsentForm(result)},
232-
footerItems: ${JSON.stringify(result.footerItems)}
233-
232+
footerSettings: ${JSON.stringify(result.footerSettings)}
234233
};
235234
236235
export const theme = ${JSON.stringify(result.theme) || null};
@@ -251,7 +250,7 @@ module.exports = new Resolver({
251250
export const getBannerFromVedaConfig = () => config.banner;
252251
export const getNavItemsFromVedaConfig = () => config.navItems;
253252
export const getCookieConsentFromVedaConfig = () => config.cookieConsentForm;
254-
export const getFooterItemsFromVedaConfig = () => config.footerItems
253+
export const getFooterSettingsFromVedaConfig = () => config.footerSettings;
255254
256255
export const datasets = ${generateMdxDataObject(datasetsImportData)};
257256
export const stories = ${generateMdxDataObject(storiesImportData)};

0 commit comments

Comments
 (0)