Skip to content

Commit

Permalink
feat: Add node for button component
Browse files Browse the repository at this point in the history
jerelmiller committed Jun 12, 2020
1 parent 773b3d6 commit f6cc594
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions plugins/gatsby-source-nr1-sdk/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
const loadSdk = require('./loadSdk');

exports.sourceNodes = async ({ actions }, { release }) => {
// const { createNode } = actions;
exports.sourceNodes = async (
{ actions, createNodeId, createContentDigest },
{ release }
) => {
const { createNode } = actions;

const sdk = await loadSdk(release);
const { Button } = sdk;

console.log(sdk);
const data = {
name: 'Button',
description: Button.__docs__.text,
};

createNode({
...data,
id: createNodeId('NR1SdkComponent-Button'),
parent: null,
children: [],
internal: {
type: 'NR1SdkComponent',
contentDigest: createContentDigest(data),
},
});
};

0 comments on commit f6cc594

Please sign in to comment.