Skip to content

Commit

Permalink
refactor: small updates to details page and overview tab
Browse files Browse the repository at this point in the history
  • Loading branch information
roadlittledawn committed Sep 16, 2021
1 parent cd0e187 commit 3d0590b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 24 deletions.
28 changes: 28 additions & 0 deletions src/components/quickstarts/QuickstartOverview.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ 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',
];

const QuickstartOverview = ({ quickstart }) => {
return (
Expand Down Expand Up @@ -45,6 +62,17 @@ const QuickstartOverview = ({ quickstart }) => {
/>
))}
</div>
{quickstart.description && (
<Markdown
skipHtml
allowedElements={allowedElements}
css={css`
margin: 2em 0;
`}
>
{quickstart.description}
</Markdown>
)}
</>
);
};
Expand Down
39 changes: 15 additions & 24 deletions src/templates/QuickstartDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,6 @@ import {
} from '../data/constants';
import QuickstartOverview from '../components/quickstarts/QuickstartOverview';

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

const QuickstartDetails = ({ data, location }) => {
const quickstart = data.quickstarts;
const quickstartUrl = quickstart.packUrl || QUICKSTARTS_REPO;
Expand Down Expand Up @@ -118,8 +102,10 @@ const QuickstartDetails = ({ data, location }) => {
border-bottom: none;
display: grid;
padding-bottom: 0;
grid-template-areas: 'title logo' 'desc logo' 'cta logo';
grid-template-areas: 'title logo' 'summ logo' 'cta logo';
grid-column-gap: 1rem;
grid-row-gap: 1rem;
row-gap: 1rem;
h1 {
font-weight: normal;
Expand Down Expand Up @@ -147,16 +133,20 @@ const QuickstartDetails = ({ data, location }) => {
`}
/>
)}
{quickstart.description && (
<Markdown
skipHtml
allowedElements={allowedElements}
{quickstart.summary && (
<div
css={css`
grid-area: desc;
grid-area: summ;
margin-bottom: 1em;
max-width: 40vw;
@media (max-width: 760px) {
max-width: 100%;
}
`}
>
{quickstart.description}
</Markdown>
{quickstart.summary}
</div>
)}
<div
css={css`
Expand Down Expand Up @@ -334,6 +324,7 @@ export const pageQuery = graphql`
level
id
description
summary
logoUrl
packUrl
dashboards {
Expand Down

0 comments on commit 3d0590b

Please sign in to comment.