@primer/gatsby-theme-doctocat 4.0.1 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @primer/gatsby-theme-doctocat
2
2
 
3
+ ## 4.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`8a4cd71`](https://github.com/primer/doctocat/commit/8a4cd719954443991fbb53e642e62c04839fc7ac) [#476](https://github.com/primer/doctocat/pull/476) Thanks [@jonrohan](https://github.com/jonrohan)! - Adding support for a Lookbook link
8
+
3
9
  ## 4.0.1
4
10
 
5
11
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/gatsby-theme-doctocat",
3
- "version": "4.0.1",
3
+ "version": "4.1.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -7,12 +7,13 @@ import PageFooter from './page-footer'
7
7
  import Sidebar from './sidebar'
8
8
  import SourceLink from './source-link'
9
9
  import StatusLabel from './status-label'
10
+ import LookbookLink from './lookbook-link'
10
11
  import StorybookLink from './storybook-link'
11
12
  import FigmaLink from './figma-link'
12
13
  import TableOfContents from './table-of-contents'
13
14
 
14
15
  function Layout({children, pageContext}) {
15
- let {title, description, figma, status, source, storybook, additionalContributors, componentId} =
16
+ let {title, description, figma, status, source, storybook, lookbook, additionalContributors, componentId} =
16
17
  pageContext.frontmatter
17
18
 
18
19
  if (!additionalContributors) {
@@ -73,7 +74,7 @@ function Layout({children, pageContext}) {
73
74
  {status ? <StatusLabel status={status} /> : null}
74
75
  </Box>
75
76
  {description ? <Box sx={{fontSize: 3, pb: 2}}>{description}</Box> : null}
76
- {source || storybook ? (
77
+ {source || storybook || lookbook ? (
77
78
  <Box
78
79
  sx={{
79
80
  py: 2,
@@ -85,6 +86,7 @@ function Layout({children, pageContext}) {
85
86
  }}
86
87
  >
87
88
  {source ? <SourceLink href={source} /> : null}
89
+ {lookbook ? <LookbookLink href={lookbook} /> : null}
88
90
  {storybook ? <StorybookLink href={storybook} /> : null}
89
91
  {figma ? <FigmaLink href={figma} /> : null}
90
92
  </Box>
@@ -0,0 +1,28 @@
1
+ import {Link, Text} from '@primer/react'
2
+ import React from 'react'
3
+
4
+ function SourceLink({href}) {
5
+ return (
6
+ <Link href={href} target="_blank">
7
+ <LookbookIcon />
8
+ <Text sx={{ml: 2, display: 'inline-block'}}>View Lookbook</Text>
9
+ </Link>
10
+ )
11
+ }
12
+
13
+ function LookbookIcon() {
14
+ return (
15
+ <svg
16
+ aria-hidden="true"
17
+ viewBox="0 0 24 24"
18
+ width={16}
19
+ height={16}
20
+ fill="currentColor"
21
+ style={{verticalAlign: 'text-bottom'}}
22
+ >
23
+ <path d="M12.3701 0C12.1793 0 12.0588 0.205201 12.1518 0.371843L17.7026 10.3173C17.766 10.4308 17.766 10.5692 17.7026 10.6827L12.1518 20.6282C12.0588 20.7948 12.1793 21 12.3701 21H17.974C18.1099 21 18.2352 20.9265 18.3014 20.8078L23.9524 10.6827C24.0158 10.5692 24.0158 10.4308 23.9524 10.3172L18.3014 0.192237C18.2352 0.07355 18.1099 0 17.974 0H12.3701ZM11.8433 10.3173C11.9067 10.4308 11.9067 10.5692 11.8433 10.6827L6.16371 20.8589C6.06834 21.0298 5.8225 21.0298 5.72712 20.8589L0.04755 10.6827C-0.0158499 10.5692 -0.01585 10.4308 0.0475497 10.3173L5.72712 0.141121C5.8225 -0.029757 6.06834 -0.0297573 6.16371 0.14112L11.8433 10.3173Z" />
24
+ </svg>
25
+ )
26
+ }
27
+
28
+ export default SourceLink