Skip to content

Instantly share code, notes, and snippets.

View kingisaac95's full-sized avatar

Kingdom Orjiewuru kingisaac95

View GitHub Profile
@kingisaac95
kingisaac95 / Name_v1.jsx
Created December 5, 2017 17:32
Receive and render
import React from 'react';
const Name = ({ data: { bio, avatar, handleClick } }) => {
return (
<div>
<button onClick={handleClick}>Click Me</button>
<h4>About: {bio}</h4>
<img src={avatar} alt="avatar"/>
</div>
);
@kingisaac95
kingisaac95 / Workshop_v1.jsx
Created December 5, 2017 17:32
Fetch and render
import React, { Component } from 'react';
import request from 'axios';
import Name from './Name.jsx';
class WorkShop extends Component {
constructor(props) {
super(props);
this.state = {
user: {},
@kingisaac95
kingisaac95 / RavePayment.jsx
Last active September 29, 2017 15:06
A simple script for rave-payment library that + a little button for triggering the modal.
import React, { Component } from 'react'
// import the library
import RavePaymentModal from 'react-ravepayment'
class App extends Component {
state = {
key: "FLWPUBK-XXXXXXXXXXXXXXXXXXXXXXXXXX-X", // RavePay PUBLIC KEY
email: "[email protected]", // customer email
amount: "1000" // equals NGN 1000. Minimum amount allow of NGN500,
@kingisaac95
kingisaac95 / resolvers.js
Last active September 19, 2017 15:40
DMS Resolver v1
const documents = [
{
id: 1,
title: 'document 1',
content: 'The first document'
},
{
id: 2,
title: 'document 2',
content: 'The second document'
@kingisaac95
kingisaac95 / index.js
Created September 19, 2017 13:07
DMS Server v1
const express = require('express');
const bodyParser = require('body-parser');
// handle graphql request and response based on schema
const { graphqlExpress } = require('apollo-server-express');
const schema = require('./schema');
let app = express();
@kingisaac95
kingisaac95 / index.js
Last active September 19, 2017 13:12
DMS Schema v1
const { makeExecutableSchema } = require('graphql-tools');
const typeDefinitions = `
type Document {
id: ID!
title: String!
content: String!
}
type User {