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
/* pages/checkout.js */ | |
import React, { Component } from "react"; | |
import defaultPage from "../hocs/defaultPage"; | |
import Cart from "../components/Cart/Cart"; | |
import InjectedCheckoutForm from "../components/Checkout/CheckoutForm"; | |
import { Row, Col } from "reactstrap"; | |
import { StripeProvider, Elements } from "react-stripe-elements"; | |
import { withContext } from "../components/Context/AppProvider"; |
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
/* /components/Checkout/CheckoutForm.js */ | |
import React from "react"; | |
import CardSection from "./CardSection"; | |
import { FormGroup, Label, Input, FormText, Row, Col } from "reactstrap"; | |
import { injectStripe } from "react-stripe-elements"; | |
import Strapi from "strapi-sdk-javascript/build/main"; | |
import Router from "next/router"; |
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
/* components/Checkout/cardsection.js */ | |
import React from "react"; | |
import { CardElement, CardNumberElement } from "react-stripe-elements"; | |
import { injectStripe } from "react-stripe-elements"; | |
class CardSection extends React.Component { | |
render() { | |
return ( |
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
/* /pages/index.js */ | |
import RestaurantList from "../components/RestaurantList"; | |
import React from "react"; | |
import { | |
Alert, | |
Button, | |
Col, | |
Input, |
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
/* /pages/_app.js */ | |
import Layout from "../components/Layout"; | |
import withData from "../lib/apollo"; | |
import App, { Container } from "next/app"; | |
import React from "react"; | |
class MyApp extends App { | |
static async getInitialProps({ Component, router, ctx }) { |
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
/* /pages/restaurants.js */ | |
import gql from "graphql-tag"; | |
import { withRouter } from "next/router"; | |
import { graphql } from "react-apollo"; | |
import { compose } from "recompose"; | |
import { | |
Button, | |
Card, | |
CardBody, |
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
/* /components/Layout.js */ | |
import React from "react"; | |
import Head from "next/head"; | |
import Link from "next/link"; | |
import { unsetToken } from "../lib/auth"; | |
import { Container, Nav, NavItem } from "reactstrap"; | |
import defaultPage from "../hocs/defaultPage"; | |
import Cookie from "js-cookie"; |
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
/* /pages/_app.js */ | |
import Layout from "../components/Layout"; | |
import withData from "../lib/apollo"; | |
import AppProvider from "../components/Context/AppProvider"; | |
import defaultPage from "../hocs/defaultPage"; | |
import { compose } from "recompose"; | |
import App, { Container } from "next/app"; | |
import React from "react"; |
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
/* /pages/restaurants.js */ | |
import gql from "graphql-tag"; | |
import { withRouter } from "next/router"; | |
import { graphql } from "react-apollo"; | |
import { compose } from "recompose"; | |
import { withContext } from "../components/Context/AppProvider"; | |
import { | |
Button, | |
Card, |
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
"use strict"; | |
/** | |
* Order.js controller | |
* | |
* @description: A set of functions called "actions" for managing `Order`. | |
*/ | |
const stripe = require("stripe")("sk_test_INSERT YOUR API KEY"); |