The electrode docs currently show incorrect instructions on how to do this.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const backgroundColor = "#eee"; | |
export default () => ( | |
<div className="hello"> | |
<div className="wrapper"> | |
<div className="item1">1</div> | |
<div>2</div> | |
<div>3</div> | |
<div>4</div> | |
<div>5</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import NextHead from "next/head"; | |
const Head = () => ( | |
<div> | |
<NextHead> | |
<meta charSet="UTF-8" /> | |
{/* <title>{props.title || ""}</title> | |
<meta name="description" content={props.description || ""} /> */} | |
<meta name="viewport" content="width=device-width, initial-scale=1" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"presets": ["next/babel"] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Document, { Head, Main, NextScript } from "next/document"; | |
import { ServerStyleSheet } from "styled-components"; | |
export default class MyDocument extends Document { | |
static getInitialProps({ renderPage }) { | |
const sheet = new ServerStyleSheet(); | |
const page = renderPage(App => props => | |
sheet.collectStyles(<App {...props} />) | |
); | |
const styleTags = sheet.getStyleElement(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"presets": [ | |
[ | |
"next/babel", | |
{ | |
"styled-jsx": { | |
"plugins": [ | |
"styled-jsx-plugin-sass" | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable react/no-danger, import/no-unresolved */ | |
import React from "react"; | |
import Document, { Head, Main, NextScript } from "next/document"; | |
import { extractStyles } from "evergreen-ui"; | |
export default class MyDocument extends Document { | |
static async getInitialProps({ renderPage }) { | |
const page = renderPage(); | |
// `css` is a string with css from both glamor and ui-box. | |
// No need to get the glamor css manually if you are using it elsewhere in your app. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// helper functions | |
const format = data => JSON.stringify(data); | |
const title = title => console.log(`\n${title}\n---------------------`); | |
const iterate = (fnName, fn) => { | |
[1, 2, 3, 4, 5].forEach(n => { | |
console.log(`${fnName}(${n}) = ${fn(n)}`); | |
}); | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const util = require("util"); | |
// RECURSIVE FUNCTIONS: pow, fibonaci, factorial, map, reverse | |
const pow = (b, n) => (n === 1 ? b : b * pow(b, n - 1)); | |
const fibonaci = x => (x <= 1 ? 1 : fibonaci(x - 1) + fibonaci(x - 2)); | |
const factorial = x => (x === 1 ? 1 : x * factorial(x - 1)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app = require("../../../src/server/test-server.js"); | |
var request = require("supertest"); | |
var db = require("../../../src/server/models"); | |
describe("PageBuilder API integration tests", () => { | |
describe("authentication", () => { | |
var token; | |
describe("Protected API endpoints without token", () => { | |
it("should deny access without a token", () => { |