Skip to content

Commit f21e2f9

Browse files
authored
[CORE-184] Add Public Roadmap Banner to Home Page (#5178)
1 parent bc4f4ac commit f21e2f9

File tree

4 files changed

+67
-18
lines changed

4 files changed

+67
-18
lines changed

src/components/TopBar.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,13 @@ export const TopBar = (props: TopBarProps): ReactNode => {
274274
onClick={() => setOpenPlatformNewsMenu(!openPlatformNewsMenu)}
275275
isOpened={openPlatformNewsMenu}
276276
>
277+
<DropDownSubItem
278+
href='https://support.terra.bio/hc/en-us/sections/30968105851931-Terra-Roadmap'
279+
onClick={hideNav}
280+
{...Utils.newTabLinkProps}
281+
>
282+
Terra Roadmap
283+
</DropDownSubItem>
277284
<DropDownSubItem href='#feature-preview' onClick={hideNav}>
278285
Feature Preview
279286
</DropDownSubItem>

src/images/roadmap-bg-banner.png

6.71 KB
Loading

src/libs/brands.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,21 @@ export interface BrandConfiguration {
8787

8888
/** Theme for components */
8989
theme: Theme;
90+
91+
/** Optional flag to show the roadmap link */
92+
showRoadmap?: boolean;
93+
94+
/** Optional card for the roadmap */
95+
roadMapCard?: {
96+
/** Card link */
97+
link: string;
98+
99+
/** Card title */
100+
title: string;
101+
102+
/** Card body */
103+
body: string;
104+
};
90105
}
91106

92107
export const landingPageCardsDefault = [
@@ -107,6 +122,12 @@ export const landingPageCardsDefault = [
107122
},
108123
];
109124

125+
export const roadMapCardDefault = {
126+
link: 'https://support.terra.bio/hc/en-us/sections/30968105851931-Terra-Roadmap',
127+
title: 'Terra Roadmap',
128+
body: "Stay connected: see what's new, what's next, and try out the latest features on Terra.",
129+
};
130+
110131
const baseColors: Theme['colorPalette'] = {
111132
primary: '#74ae43',
112133
secondary: '#6d6e70',
@@ -145,6 +166,7 @@ export const brands: Record<string, BrandConfiguration> = {
145166
theme: {
146167
colorPalette: { ...baseColors, primary: '#e0dd10', accent: '#035c94', light: '#f6f7f4', dark: '#012840' },
147168
},
169+
showRoadmap: true,
148170
},
149171
baseline: {
150172
name: 'Project Baseline',
@@ -359,6 +381,7 @@ export const brands: Record<string, BrandConfiguration> = {
359381
dark: '#333F52',
360382
},
361383
},
384+
showRoadmap: true,
362385
},
363386
rareX: {
364387
name: `The RARE${nonBreakingHyphen}X Data Analysis Platform`,
@@ -420,6 +443,7 @@ export const brands: Record<string, BrandConfiguration> = {
420443
theme: {
421444
colorPalette: { ...baseColors },
422445
},
446+
showRoadmap: true,
423447
},
424448
};
425449

src/pages/LandingPage.js

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { ButtonPrimary, Clickable, Link } from 'src/components/common';
55
import { HeroWrapper } from 'src/components/HeroWrapper';
66
import { icon } from 'src/components/icons';
77
import hexButton from 'src/images/hex-button.svg';
8+
import roadmapBgBanner from 'src/images/roadmap-bg-banner.png';
89
import { Ajax } from 'src/libs/ajax';
910
import { getEnabledBrand, isFirecloud, isTerra } from 'src/libs/brand-utils';
10-
import { landingPageCardsDefault } from 'src/libs/brands';
11+
import { landingPageCardsDefault, roadMapCardDefault } from 'src/libs/brands';
1112
import colors from 'src/libs/colors';
1213
import { withErrorHandling } from 'src/libs/error';
1314
import * as Nav from 'src/libs/nav';
@@ -30,6 +31,13 @@ const styles = {
3031
color: 'white',
3132
padding: '2rem 1rem',
3233
},
34+
roadmapBanner: {
35+
width: 710,
36+
backgroundImage: `url(${roadmapBgBanner})`,
37+
backgroundSize: 'cover',
38+
backgroundRepeat: 'no-repeat',
39+
backgroundPosition: 'center',
40+
},
3341
};
3442

3543
const makeRightArrowWithBackgroundIcon = () =>
@@ -49,22 +57,24 @@ const makeRightArrowWithBackgroundIcon = () =>
4957
[icon('arrowRight', { color: 'white' })]
5058
);
5159

52-
const makeCard = _.map(({ link, title, body, linkPathParams, linkQueryParams }) =>
53-
h(
54-
Clickable,
55-
{
56-
href: Nav.getLink(link, linkPathParams, linkQueryParams),
57-
style: { ...Style.elements.card.container, ...styles.card },
58-
hover: { boxShadow: '0 3px 7px 0 rgba(0,0,0,0.5), 0 5px 3px 0 rgba(0,0,0,0.2)' },
59-
},
60-
[
61-
h2({ style: { color: colors.accent(), fontSize: 18, fontWeight: 500, lineHeight: '22px', marginBottom: '0.5rem' } }, title),
62-
div({ style: { lineHeight: '22px' } }, body),
63-
div({ style: { flexGrow: 1 } }),
64-
makeRightArrowWithBackgroundIcon(),
65-
]
66-
)
67-
);
60+
const makeCard = (customStyles = {}, cardConfigs = [], isExternalLink = false) =>
61+
_.map(({ link, title, body, linkPathParams, linkQueryParams }) =>
62+
h(
63+
Clickable,
64+
{
65+
href: isExternalLink ? link : Nav.getLink(link, linkPathParams, linkQueryParams),
66+
style: { ...Style.elements.card.container, ...customStyles },
67+
hover: { boxShadow: '0 3px 7px 0 rgba(0,0,0,0.5), 0 5px 3px 0 rgba(0,0,0,0.2)' },
68+
target: isExternalLink ? '_blank' : '',
69+
},
70+
[
71+
h2({ style: { color: colors.accent(), fontSize: 18, fontWeight: 500, lineHeight: '22px', marginBottom: '0.5rem' } }, title),
72+
div({ style: { lineHeight: '22px' } }, body),
73+
div({ style: { flexGrow: 1 } }),
74+
makeRightArrowWithBackgroundIcon(),
75+
]
76+
)
77+
)(cardConfigs);
6878

6979
const makeDocLinks = _.map(({ link, text }) =>
7080
div({ style: { marginBottom: '1rem', fontSize: 18 } }, [
@@ -132,7 +142,15 @@ export const LandingPage = () => {
132142
),
133143
// width is set to prevent text from overlapping the background image and decreasing legibility
134144
div({ style: { maxWidth: 'calc(100% - 460px)' } }, makeDocLinks(getEnabledBrand().docLinks)),
135-
div({ style: { display: 'flex', margin: '2rem 0 1rem 0' } }, makeCard(getEnabledBrand().landingPageCards || landingPageCardsDefault)),
145+
div(
146+
{ style: { display: 'flex', margin: '2rem 0 1rem 0' } },
147+
makeCard({ ...styles.card }, getEnabledBrand().landingPageCards || landingPageCardsDefault)
148+
),
149+
getEnabledBrand().showRoadmap &&
150+
div(
151+
{ style: { display: 'flex', marginTop: '2rem' } },
152+
makeCard({ ...styles.roadmapBanner }, [getEnabledBrand().roadMapCard || roadMapCardDefault], true)
153+
),
136154
(isTerra() || isFirecloud()) &&
137155
div({ style: { width: 700, marginTop: '4rem' } }, [
138156
'This project has been funded in whole or in part with Federal funds from the National Cancer Institute, National Institutes of Health, ',

0 commit comments

Comments
 (0)