This file contains 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 React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import { addTodo, deleteTodo } from "./action"; | |
import { connect } from "react-redux"; | |
import './App.css'; | |
class App extends Component { | |
state = { | |
todo: '', | |
todos: [] |
This file contains 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
export const Types = { | |
ADD_TODO: 'ADD_TODO', | |
DELETE_TODO: 'DELETE_TODO' | |
} | |
export const addTodo = (todo) => ({ | |
type: Types.ADD_TODO, | |
payload: todo | |
}) |
This file contains 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 { Types } from './action' | |
const initialState = { | |
todos: [] | |
} | |
const reducer = (state=initialState, action) => { | |
switch(action.type){ | |
case Types.ADD_TODO: { | |
const id = state.todos.length + 1 |
This file contains 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 React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import { Provider } from 'react-redux' | |
import { createStore } from 'redux' | |
import reducer from './reducer' | |
import './index.css'; | |
import App from './App'; | |
import * as serviceWorker from './serviceWorker'; | |
const store = createStore(reducer); |
This file contains 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 React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
class App extends Component { | |
state = { | |
todo: '', | |
todos: [] | |
} | |
handleChange = (e) => { | |
this.setState({ |
This file contains 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 React, { Component } from 'react'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
class App extends Component { | |
state = { | |
todo: '', | |
todos: [] | |
} | |
handleChange = (e) => { | |
this.setState({ |
This file contains 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 jwt from 'jsonwebtoken' | |
const verifyToken = (req, res) => { | |
const headers = req.headers['authorization'] | |
if (!headers) { | |
// any error | |
} | |
const token = req.headers.authorization.split(' ')[1] | |
const user = jwt.verify(token, //secretkey) | |
req.user = user; |
This file contains 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 { expect, should } from 'chai'; | |
const url = '../index'; | |
const testObject = { | |
emptyEmail: { | |
email: '', | |
password: 'tuij' | |
}, | |
wrongEmailFormat: { | |
email: 'danielopeyemi*', |
This file contains 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
<link href="https://fonts.googleapis.com/css?family=Chicle|Kaushan+Script" rel="stylesheet"> | |
<div class="container"> | |
<div class='row'> | |
<div class='col-md-2 col-lg-3 col-sm-1'></div> | |
<div class='col-md-8 col-lg-6 col-sm-10 col-xs-12'> | |
<div class="card message"> | |
<h1 class="text-center">Random Quote Generator</h1> | |
<div> | |
<i class="fa fa-quote-left" id='left'></i> | |
<h4 class='quoteMessage text-center'>Be a Programmer, It's the Best thing Ever</h4> |
NewerOlder