Skip to content

Commit

Permalink
feat: add beta banner to details page
Browse files Browse the repository at this point in the history
  • Loading branch information
aswanson-nr committed Sep 28, 2021
1 parent 6ff9ddb commit f7c4ca8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 18 deletions.
20 changes: 20 additions & 0 deletions src/components/quickstarts/BetaBanner.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import { css } from '@emotion/react';
import { Callout } from '@newrelic/gatsby-theme-newrelic';

const BetaBanner = () => (
<Callout
variant={Callout.VARIANT.COURSE}
title="We're in beta!"
css={css`
margin-bottom: 1rem;
margin-top: 1rem;
`}
>
The New Relic I/O beta is currently available to all users, and will require
a full user license for future usage. Note that New Relic's free forever
tier comes with 1 free full user.
</Callout>
);

export default BetaBanner;
21 changes: 3 additions & 18 deletions src/pages/instant-observability.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import PackTile from '../components/PackTile';
import IOBanner from '../components/IOBanner';
import IOLogo from '../components/IOLogo';
import Select from '../components/Select';
import BetaBanner from '../components/quickstarts/BetaBanner';
import {
SearchInput,
useTessen,
ExternalLink,
Button,
Icon,
Link,
Callout,
} from '@newrelic/gatsby-theme-newrelic';
import { navigate } from '@reach/router';

Expand All @@ -39,21 +39,6 @@ const VIEWS = {
LIST: 'List view',
};

const betaBanner = () => (
<Callout
variant={Callout.VARIANT.COURSE}
title="We're in beta!"
css={css`
margin-bottom: 1rem;
margin-top: 1rem;
`}
>
The New Relic I/O beta is currently available to all users, and will require
a full user license for future usage. Note that New Relic's free forever
tier comes with 1 free full user.
</Callout>
);

/**
* Determines if one string is a substring of the other, case insensitive
* @param {String} substring the substring to test against
Expand Down Expand Up @@ -246,7 +231,7 @@ const QuickstartsPage = ({ data, location }) => {
`}
>
{isMobile && <IOBanner isMobile />}
<div>{isMobile && betaBanner()}</div>
<div>{isMobile && <BetaBanner />}</div>
<div
css={css`
padding: var(--site-content-padding);
Expand Down Expand Up @@ -387,7 +372,7 @@ const QuickstartsPage = ({ data, location }) => {
`}
>
{!isMobile && <IOBanner />}
<div>{!isMobile && betaBanner()}</div>
<div>{!isMobile && <BetaBanner />}</div>
<div
css={css`
background-color: var(--secondary-background-color);
Expand Down
2 changes: 2 additions & 0 deletions src/templates/QuickstartDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
LOGIN_LINK,
} from '../data/constants';
import QuickstartOverview from '../components/quickstarts/QuickstartOverview';
import BetaBanner from '../components/quickstarts/BetaBanner';

const QuickstartDetails = ({ data, location }) => {
const quickstart = data.quickstarts;
Expand Down Expand Up @@ -88,6 +89,7 @@ const QuickstartDetails = ({ data, location }) => {
meta={quickStartMeta}
/>
<Breadcrumbs segments={breadcrumbs} />
<BetaBanner />
<Tabs>
<PageLayout
type={PageLayout.TYPE.RELATED_CONTENT_TABS}
Expand Down

0 comments on commit f7c4ca8

Please sign in to comment.