File tree Expand file tree Collapse file tree 2 files changed +66
-7
lines changed
packages/gatsby-theme/src/pages Expand file tree Collapse file tree 2 files changed +66
-7
lines changed Original file line number Diff line number Diff line change
1
+ import * as React from 'react' ;
2
+ import Layout from '../components/layout' ;
3
+ import { Content } from '../shared/styledHelpers' ;
4
+ import { graphql } from 'gatsby' ;
5
+ import { Heading , Text , Card } from '../components/shared/base' ;
6
+ import { getTutorialSlug } from '../utils/getTutorialSlug' ;
7
+ import { Link } from 'gatsby' ;
8
+
9
+ const Community = data => {
10
+ console . log ( data ) ;
11
+ console . log ( data . data . tutorials . edges ) ;
12
+ const tutorials = data . data . tutorials . edges ;
13
+ return (
14
+ < Layout >
15
+ < Heading > Community Tutorials </ Heading >
16
+ { tutorials . map ( tutorial => {
17
+ return (
18
+ < Card
19
+ width = { [ 1 ] }
20
+ p = { 4 }
21
+ my = { 4 }
22
+ borderRadius = { 8 }
23
+ boxShadow = "small"
24
+ key = { tutorial . node . id }
25
+ >
26
+ < Link to = { getTutorialSlug ( tutorial . node . fileAbsolutePath ) } >
27
+ < Heading > { tutorial . node . frontmatter . tutorialTitle } </ Heading >
28
+ </ Link >
29
+ < Text > { tutorial . node . frontmatter . description } </ Text >
30
+ </ Card >
31
+ ) ;
32
+ } ) }
33
+ </ Layout >
34
+ ) ;
35
+ } ;
36
+
37
+ export const query = graphql `
38
+ query CommunityTutorialQuery {
39
+ tutorials: allMdx(
40
+ filter: {
41
+ frontmatter: { tutorialTitle: { ne: null } }
42
+ fileAbsolutePath: { regex: "/community/" }
43
+ }
44
+ ) {
45
+ edges {
46
+ node {
47
+ id
48
+ fileAbsolutePath
49
+ frontmatter {
50
+ tutorialTitle
51
+ description
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ ` ;
58
+
59
+ export default Community ;
Original file line number Diff line number Diff line change 1
- import { Link } from " gatsby" ;
2
- import * as React from " react" ;
3
- import Layout from " ../components/layout" ;
1
+ import { Link } from ' gatsby' ;
2
+ import * as React from ' react' ;
3
+ import Layout from ' ../components/layout' ;
4
4
import {
5
5
Box ,
6
6
Flex ,
@@ -9,10 +9,10 @@ import {
9
9
Button ,
10
10
Image ,
11
11
Card ,
12
- Link as BaseLink
13
- } from " ../components/shared/base" ;
12
+ Link as BaseLink ,
13
+ } from ' ../components/shared/base' ;
14
14
15
- const SecondPage = ( ) => (
15
+ const Components = ( ) => (
16
16
< Layout >
17
17
< h3 > Check out our rebass components!</ h3 >
18
18
@@ -65,4 +65,4 @@ const SecondPage = () => (
65
65
</ Layout >
66
66
) ;
67
67
68
- export default SecondPage ;
68
+ export default Components ;
You can’t perform that action at this time.
0 commit comments