Skip to content

Instantly share code, notes, and snippets.

View ryanbelke's full-sized avatar
💭
coding

Ryan Beke ryanbelke

💭
coding
  • Austin, Tx
View GitHub Profile
@ryanbelke
ryanbelke / Layout.js
Created October 10, 2018 03:07
Initial Layout.js file
import React from "react";
import Head from "next/head";
import Link from "next/link";
import { Container, Nav, NavItem } from "reactstrap";
class Layout extends React.Component {
constructor(props) {
super(props);
}
@ryanbelke
ryanbelke / _app.js
Last active January 4, 2020 23:02
Initial _app.js file
/* _app.js */
import React from "react";
import App, { Container } from "next/app";
import Head from "next/head";
export default class MyApp extends App {
static async getInitialProps({ Component, router, ctx }) {
let pageProps = {};
@ryanbelke
ryanbelke / Layout.js
Last active September 29, 2019 00:01
Initial Layout.js
/* /components/Layout.js */
import React from "react";
import Head from "next/head";
import Link from "next/link";
import { Container, Nav, NavItem } from "reactstrap";
class Layout extends React.Component {
constructor(props) {
/* /pages/index.js */
import { Button, Alert } from "reactstrap";
import Layout from "../components/Layout";
export default () => {
return (
<Layout>
<div>
<Alert color="primary">
Hello Project is strapi-next with Bootstrap
</Alert>
/* pages/index.js */
import { Button, Alert } from "reactstrap";
export default () => {
return (
<div>
<div>
<Alert color="primary">
Hello Project is strapi-next with Bootstrap
</Alert>
/* pages/register.js */
export default () => {
return <h1>Sign Up</h1>;
};
/* pages/login.js */
export default () => {
return <h1>Sign In</h1>;
};
/* components/RestaurantList/index.js */
import gql from "graphql-tag";
import Link from "next/link";
import { graphql } from "react-apollo";
import {
Button,
Card,
CardBody,
CardColumns,
CardImg,
/* /lib/apollo.js */
import { HttpLink } from "apollo-link-http";
import { withData } from "next-apollo";
const API_URL = process.env.NEXT_PUBLIC_API_URL || "http://localhost:1337"
const config = {
link: new HttpLink({
uri: `${API_URL}/graphql`, // Server URL (must be absolute)
import Link from "next/link";
<div className="card-footer">
<Link
as={`/restaurants/${res._id}`}
href={`/restaurants?id=${res._id}`}
>
<a className="btn btn-primary">View</a>
</Link>
</div>