├── .env.sample ├── cypress.json ├── src ├── assets │ ├── images │ │ ├── favicon.ico │ │ ├── tabs-icon-01.svg │ │ ├── tabs-icon-03.svg │ │ ├── tabs-icon-02.svg │ │ ├── logo.svg │ │ ├── loader.svg │ │ ├── feature-icon-01.svg │ │ ├── feature-icon-03.svg │ │ ├── feature-icon-02.svg │ │ ├── feature-icon-04.svg │ │ ├── hubspot-logo.svg │ │ ├── facebook-logo.svg │ │ ├── airbnb-logo.svg │ │ ├── microsoft-logo.svg │ │ ├── header-bg-left.svg │ │ ├── tinder-logo.svg │ │ ├── header-bg.svg │ │ └── header-bg-right.svg │ └── js │ │ └── main.js └── components │ ├── header.js │ ├── contact.js │ ├── clients.js │ ├── hero.js │ ├── faq.js │ ├── testimonials.js │ ├── features.js │ ├── blogs.js │ ├── pricing.js │ └── footer.js ├── cypress ├── fixtures │ └── example.json ├── plugins │ └── index.js ├── support │ ├── index.js │ └── commands.js └── integration │ └── index-page.js ├── .gitignore ├── now.json ├── .babelrc ├── next.config.js ├── pages ├── _app.js ├── _document.js ├── blogs.js └── index.js ├── LICENSE ├── package.json └── README.md /.env.sample: -------------------------------------------------------------------------------- 1 | BUTTER_CMS_API_KEY=something 2 | -------------------------------------------------------------------------------- /cypress.json: -------------------------------------------------------------------------------- 1 | { "baseUrl": "http://localhost:3000" } 2 | -------------------------------------------------------------------------------- /src/assets/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ghoshnirmalya/testing-next.js-apps/HEAD/src/assets/images/favicon.ico -------------------------------------------------------------------------------- /cypress/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io", 4 | "body": "Fixtures are a great way to mock data for responses to routes" 5 | } 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | yarn-debug.log* 3 | yarn-error.log* 4 | 5 | # Dependency directories 6 | node_modules/ 7 | 8 | # Yarn Integrity file 9 | .yarn-integrity 10 | 11 | # dotenv environment variables file 12 | .env 13 | 14 | # next.js build output 15 | .next 16 | out 17 | -------------------------------------------------------------------------------- /now.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "builds": [{ 4 | "src": "package.json", 5 | "use": "@now/static-build", 6 | "config": { "distDir": "out" } 7 | }], 8 | "build": { 9 | "env": { 10 | "BUTTER_CMS_API_KEY": "@butter-cms-api-key" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "next/babel", 5 | { 6 | "preset-env": {}, 7 | "transform-runtime": {}, 8 | "styled-jsx": {}, 9 | "class-properties": {} 10 | } 11 | ] 12 | ], 13 | "plugins": ["@babel/plugin-syntax-dynamic-import"] 14 | } 15 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | const withCSS = require("@zeit/next-css"); 2 | const withImages = require("next-images"); 3 | const webpack = require("webpack"); 4 | 5 | require("dotenv").config(); 6 | 7 | module.exports = withImages( 8 | withCSS({ 9 | webpack: config => { 10 | config.plugins.push(new webpack.EnvironmentPlugin(process.env)); 11 | return config; 12 | } 13 | }) 14 | ); 15 | -------------------------------------------------------------------------------- /src/assets/images/tabs-icon-01.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/images/tabs-icon-03.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/images/tabs-icon-02.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /cypress/plugins/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example plugins/index.js can be used to load plugins 3 | // 4 | // You can change the location of this file or turn off loading 5 | // the plugins file with the 'pluginsFile' configuration option. 6 | // 7 | // You can read more here: 8 | // https://on.cypress.io/plugins-guide 9 | // *********************************************************** 10 | 11 | // This function is called when a project is opened or re-opened (e.g. due to 12 | // the project's config changing) 13 | 14 | module.exports = (on, config) => { 15 | // `on` is used to hook into various events Cypress emits 16 | // `config` is the resolved Cypress config 17 | }; 18 | -------------------------------------------------------------------------------- /pages/_app.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import App, { Container } from "next/app"; 3 | import dynamic from "next/dynamic"; 4 | import withNProgress from "next-nprogress"; 5 | 6 | import "../src/assets/css/style.css"; 7 | 8 | class MyApp extends App { 9 | componentDidMount() { 10 | import("../src/assets/js/main.js"); 11 | } 12 | 13 | render() { 14 | const { Component, pageProps } = this.props; 15 | 16 | return ( 17 | 18 |
19 |
20 | 21 |
22 |
23 |
24 | ); 25 | } 26 | } 27 | 28 | export default withNProgress()(MyApp); 29 | -------------------------------------------------------------------------------- /cypress/support/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import "./commands"; 18 | 19 | // Alternatively you can use CommonJS syntax: 20 | // require('./commands') 21 | -------------------------------------------------------------------------------- /pages/_document.js: -------------------------------------------------------------------------------- 1 | import Document, { Head, Main, NextScript } from "next/document"; 2 | 3 | import Favicon from "../src/assets/images/favicon.ico"; 4 | 5 | export default class MyDocument extends Document { 6 | render() { 7 | return ( 8 | 9 | 10 | 11 | 15 |