Skip to content
This repository has been archived by the owner on Dec 8, 2023. It is now read-only.

Commit

Permalink
feat: file renaming and formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
aswanson-nr committed Jan 24, 2022
1 parent 3b74de8 commit 58285b3
Show file tree
Hide file tree
Showing 19 changed files with 187 additions and 213 deletions.
4 changes: 3 additions & 1 deletion src/@newrelic/gatsby-theme-newrelic/icons/feather.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import defaultIcons from '@newrelic/gatsby-theme-newrelic/src/icons/feather';

export default {
const featherIcons = {
...defaultIcons,
box: (
<>
Expand Down Expand Up @@ -99,3 +99,5 @@ export default {
),
zap: <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2" />,
};

export default featherIcons;
34 changes: 3 additions & 31 deletions src/@newrelic/gatsby-theme-newrelic/icons/newrelic.js
Original file line number Diff line number Diff line change
@@ -1,37 +1,9 @@
import defaultIcons from '@newrelic/gatsby-theme-newrelic/src/icons/newrelic';
import automation from './newrelic/automation';
import allEntities from './newrelic/all-entities';
import dashboard from './newrelic/dashboard';
import document from './newrelic/document';
import alert from './newrelic/alert';
import book from './newrelic/book';
import buildApps from './newrelic/build-apps';
import builders from './newrelic/builders';
import nerdBytes from './newrelic/nerd-bytes';
import developerChampions from './newrelic/developer-champions';
import event from './newrelic/event';
import podcasts from './newrelic/podcasts';
import relicans from './newrelic/relicans';
import share from './newrelic/share';
import nerdlog from './newrelic/nerdlog';
import checkShield from './newrelic/check-shield';

export default {
const newrelicIcons = {
...defaultIcons,
automation,
alert,
'all-entities': allEntities,
dashboard,
document,
book,
'build-apps': buildApps,
builders,
'nerd-bytes': nerdBytes,
'developer-champions': developerChampions,
event,
relicans,
podcasts,
share,
nerdlog,
'check-shield': checkShield,
};

export default newrelicIcons;
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React from 'react';
import SVG from '@newrelic/gatsby-theme-newrelic/src/components/SVG';
import Svg from '@newrelic/gatsby-theme-newrelic/src/components/SVG';
import { css } from '@emotion/react';
import PropTypes from 'prop-types';

const CheckShieldIcon = ({ className }) => (
<SVG
<Svg
className={className}
viewBox="0 0 15 19"
css={css`
Expand All @@ -19,7 +19,7 @@ const CheckShieldIcon = ({ className }) => (
d="M7.7926 0.0549888C7.60395 -0.0183296 7.39605 -0.0183296 7.2074 0.0549888L0.54073 2.64592C0.215477 2.77232 0 3.09456 0 3.45457V9.50007C0 12.4766 1.90146 14.8549 3.61791 16.4114C4.49365 17.2056 5.36545 17.8263 6.01667 18.2481C6.34314 18.4596 6.6164 18.6225 6.80995 18.7335C6.90677 18.7891 6.98381 18.8317 7.03777 18.8611C7.06475 18.8758 7.08598 18.8871 7.10104 18.8951L7.11895 18.9046L7.12435 18.9074L7.12681 18.9087C7.36141 19.0303 7.63807 19.0305 7.87268 18.909L7.5 18.1365C7.87268 18.909 7.87386 18.9083 7.87386 18.9083L7.87565 18.9074L7.88105 18.9046L7.89896 18.8951C7.91402 18.8871 7.93525 18.8758 7.96223 18.8611C8.01619 18.8317 8.09323 18.7891 8.19005 18.7335C8.3836 18.6225 8.65686 18.4596 8.98333 18.2481C9.63455 17.8263 10.5064 17.2056 11.3821 16.4114C13.0985 14.8549 15 12.4766 15 9.50007V3.45457C15 3.09456 14.7845 2.77232 14.4593 2.64592L7.7926 0.0549888ZM7.5 18.1365L7.12681 18.9087C7.12681 18.9087 7.12732 18.909 7.5 18.1365ZM11.0243 8.30226C11.4122 7.90916 11.408 7.276 11.0149 6.88808C10.6218 6.50015 9.98865 6.50434 9.60072 6.89745L6.5625 9.9762L5.39928 8.79746C5.01135 8.40436 4.3782 8.40016 3.98509 8.78809C3.59199 9.17602 3.5878 9.80917 3.97572 10.2023L5.85072 12.1023C6.03863 12.2927 6.29499 12.3999 6.5625 12.3999C6.83001 12.3999 7.08637 12.2927 7.27428 12.1023L11.0243 8.30226Z"
fill="#019CAA"
/>
</SVG>
</Svg>
);

CheckShieldIcon.propTypes = {
Expand Down
10 changes: 5 additions & 5 deletions src/components/EmptyTab.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import PropTypes from "prop-types";
import { css } from "@emotion/react";
import { Button, Icon, Link } from "@newrelic/gatsby-theme-newrelic";
import { QUICKSTARTS_REPO } from "../data/constants";
import React from 'react';
import PropTypes from 'prop-types';
import { css } from '@emotion/react';
import { Button, Icon, Link } from '@newrelic/gatsby-theme-newrelic';
import { QUICKSTARTS_REPO } from '../data/constants';

const EmptyTab = ({
quickstartName,
Expand Down
14 changes: 7 additions & 7 deletions src/components/DevSiteSeo.js → src/components/IOSeo.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import PropTypes from 'prop-types';
import { SEO } from '@newrelic/gatsby-theme-newrelic';
import { SEO as Seo } from '@newrelic/gatsby-theme-newrelic';
import { useStaticQuery, graphql, withPrefix } from 'gatsby';

function DevSiteSeo({ description, meta, title, tags, location, type }) {
function IOSeo({ description, meta, title, tags, location, type }) {
const { site } = useStaticQuery(
graphql`
query {
Expand Down Expand Up @@ -98,22 +98,22 @@ function DevSiteSeo({ description, meta, title, tags, location, type }) {
].filter((m) => m.content !== '');

return (
<SEO location={location} title={title} type={type}>
<Seo location={location} title={title} type={type}>
{crazyEgg(location)}
{validMetadata.map((data, index) => (
<meta key={`${data.name}-${index}`} {...data} />
))}
<script src={withPrefix('tessen.min-1.3.0.js')} type="text/javascript" />
</SEO>
</Seo>
);
}

DevSiteSeo.defaultProps = {
IOSeo.defaultProps = {
meta: [],
description: '',
};

DevSiteSeo.propTypes = {
IOSeo.propTypes = {
location: PropTypes.object.isRequired,
description: PropTypes.string,
meta: PropTypes.arrayOf(PropTypes.object),
Expand All @@ -123,4 +123,4 @@ DevSiteSeo.propTypes = {
quickStartName: PropTypes.string,
};

export default DevSiteSeo;
export default IOSeo;
46 changes: 23 additions & 23 deletions src/components/PageLayout/PageLayout.js
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
import React from "react";
import PropTypes from "prop-types";
import { css } from "@emotion/react";
import Header from "./Header";
import Context from "./Context";
import { Layout, useLayout } from "@newrelic/gatsby-theme-newrelic";
import React from 'react';
import PropTypes from 'prop-types';
import { css } from '@emotion/react';
import Header from './Header';
import Context from './Context';
import { Layout, useLayout } from '@newrelic/gatsby-theme-newrelic';

const TYPES = {
SINGLE_COLUMN: "SINGLE_COLUMN",
RELATED_CONTENT: "RELATED_CONTENT",
RELATED_CONTENT_TABS: "RELATED_CONTENT_TABS",
SINGLE_COLUMN: 'SINGLE_COLUMN',
RELATED_CONTENT: 'RELATED_CONTENT',
RELATED_CONTENT_TABS: 'RELATED_CONTENT_TABS',
};

const LAYOUTS = {
[TYPES.RELATED_CONTENT]: css`
grid-template-areas:
"page-header page-header"
"content page-tools";
'page-header page-header'
'content page-tools';
grid-template-columns: minmax(0, 1fr) 320px;
grid-gap: 2rem;
@media (max-width: 1240px) {
grid-template-areas:
"page-header"
"content"
"page-tools";
'page-header'
'content'
'page-tools';
grid-template-columns: minmax(0, 1fr);
}
`,
[TYPES.RELATED_CONTENT_TABS]: css`
grid-template-areas:
"page-header page-header"
"tabs tabs"
"content page-tools";
'page-header page-header'
'tabs tabs'
'content page-tools';
grid-template-columns: minmax(0, 1fr) 320px;
grid-gap: 2rem;
@media (max-width: 1240px) {
grid-template-areas:
"page-header"
"tabs"
"content"
"page-tools";
'page-header'
'tabs'
'content'
'page-tools';
grid-template-columns: minmax(0, 1fr);
}
`,
[TYPES.SINGLE_COLUMN]: css`
grid-template-areas:
"page-header"
"content";
'page-header'
'content';
grid-template-columns: minmax(0, 1fr);
`,
};
Expand Down
16 changes: 8 additions & 8 deletions src/components/QuickstartAlerts.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import { css } from "@emotion/react";
import pluralize from "pluralize";
import { Surface, Tag } from "@newrelic/gatsby-theme-newrelic";
import Intro from "./Intro";
import { quickstart } from "../types";
import React from 'react';
import { css } from '@emotion/react';
import pluralize from 'pluralize';
import { Surface, Tag } from '@newrelic/gatsby-theme-newrelic';
import Intro from './Intro';
import { quickstart } from '../types';

const QuickstartAlerts = ({ quickstart }) => (
<>
Expand All @@ -12,8 +12,8 @@ const QuickstartAlerts = ({ quickstart }) => (
margin-bottom: 16px;
`}
>
{quickstart.title} observability quickstart contains{" "}
{pluralize("alert", quickstart.alerts?.length ?? 0, true)}. These alerts
{quickstart.title} observability quickstart contains{' '}
{pluralize('alert', quickstart.alerts?.length ?? 0, true)}. These alerts
detect changes in key performance metrics. Integrate these alerts with
your favorite tools (like Slack, PagerDuty, etc.) and New Relic will let
you know when something needs your attention.
Expand Down
16 changes: 8 additions & 8 deletions src/components/QuickstartDashboards.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";
import { css } from "@emotion/react";
import pluralize from "pluralize";
import Intro from "./Intro";
import ImageSlider from "./ImageSlider";
import { quickstart } from "../types";
import React from 'react';
import { css } from '@emotion/react';
import pluralize from 'pluralize';
import Intro from './Intro';
import ImageSlider from './ImageSlider';
import { quickstart } from '../types';

const QuickstartDashboards = ({ quickstart }) => (
<>
Expand All @@ -12,8 +12,8 @@ const QuickstartDashboards = ({ quickstart }) => (
margin-bottom: 16px;
`}
>
{quickstart.title} quickstart contains{" "}
{pluralize("dashboard", quickstart.dashboards?.length ?? 0, true)}. These
{quickstart.title} quickstart contains{' '}
{pluralize('dashboard', quickstart.dashboards?.length ?? 0, true)}. These
interactive visualizations let you easily explore your data, understand
context, and resolve problems faster.
</Intro>
Expand Down
22 changes: 11 additions & 11 deletions src/components/QuickstartDataSources.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import React from "react";
import { css } from "@emotion/react";
import pluralize from "pluralize";
import { Surface, Link, Tag, useTessen } from "@newrelic/gatsby-theme-newrelic";
import Intro from "./Intro";
import { quickstart } from "../types";
import React from 'react';
import { css } from '@emotion/react';
import pluralize from 'pluralize';
import { Surface, Link, Tag, useTessen } from '@newrelic/gatsby-theme-newrelic';
import Intro from './Intro';
import { quickstart } from '../types';

const QuickstartDataSources = ({ quickstart }) => {
const tessen = useTessen();

const handleDocsTileClick = () => {
tessen.track({
eventName: "instantObservability",
category: "DocsTileClick",
eventName: 'instantObservability',
category: 'DocsTileClick',
quickstartName: quickstart.name,
quickstartId: quickstart.id,
});
Expand All @@ -24,9 +24,9 @@ const QuickstartDataSources = ({ quickstart }) => {
margin-bottom: 16px;
`}
>
{quickstart.title} observability quickstart contains{" "}
{pluralize("data source", quickstart.documentation?.length ?? 0, true)}.
This is how you'll get your data into New Relic.{" "}
{quickstart.title} observability quickstart contains{' '}
{pluralize('data source', quickstart.documentation?.length ?? 0, true)}.
This is how you'll get your data into New Relic.{' '}
</Intro>

<div
Expand Down
6 changes: 3 additions & 3 deletions src/components/PackImg.js → src/components/QuickstartImg.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import { css } from '@emotion/react';
import DEFAULT_IMAGE from '../images/default-logo-background.svg';

const PackImg = ({ className, logoUrl, packName }) => {
const QuickstartImg = ({ className, logoUrl, packName }) => {
const [packAcronym, setPackAcronym] = useState('');

const getPackNameAcronym = () => {
Expand Down Expand Up @@ -58,10 +58,10 @@ const PackImg = ({ className, logoUrl, packName }) => {
);
};

PackImg.propTypes = {
QuickstartImg.propTypes = {
packName: PropTypes.string.isRequired,
logoUrl: PropTypes.string,
className: PropTypes.string,
};

export default PackImg;
export default QuickstartImg;
36 changes: 18 additions & 18 deletions src/components/QuickstartOverview.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import React from "react";
import { css } from "@emotion/react";
import { quickstart } from "../types";
import OverviewTile from "./OverviewTile";
import Markdown from "./Markdown";
import React from 'react';
import { css } from '@emotion/react';
import { quickstart } from '../types';
import OverviewTile from './OverviewTile';
import Markdown from './Markdown';

const allowedElements = [
"h1",
"h2",
"h3",
"ol",
"ul",
"li",
"p",
"blockquote",
"code",
"a",
"strong",
"em",
"hr",
'h1',
'h2',
'h3',
'ol',
'ul',
'li',
'p',
'blockquote',
'code',
'a',
'strong',
'em',
'hr',
];

const QuickstartOverview = ({ quickstart }) => {
Expand Down
Loading

0 comments on commit 58285b3

Please sign in to comment.