Advertisement
Guest User

Navigation.jsx

a guest
Apr 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { Component } from "react";
  2. import logo from "../images/evli-logo-n.svg";
  3. import '../styles/Navigation.css'
  4.  
  5. class Navigation extends Component {
  6.   constructor(props) {
  7.     super(props);
  8.     this.ossi = this.ossi.bind(this);
  9.   }
  10.  
  11.   ossi() {
  12.     fetch('http://localhost:8080/customers', {
  13.       mode: 'cors',
  14.       method: 'POST'
  15.     }).then(resp => {
  16.       return resp.json() // <- Tähän jotain muuta
  17.     }).then(data => {
  18.      
  19.     }).catch(function(error) {
  20.      
  21.     });
  22.   }
  23.  
  24.   render() {
  25.     return (
  26.       <div className="nav">
  27.         <img src={logo} className="evli-logo" alt="logo" />
  28.         <ul>
  29.           <li className='active'>Sopimuksen luonti</li>
  30.           <li>Arkisto</li>
  31.           <li>Asetukset</li>
  32.           <li>Poistu</li>
  33.           <li onClick={() => this.ossi()}>Ossin testinappula</li>
  34.         </ul>
  35.       </div>
  36.     );
  37.   }
  38. }
  39.  
  40. export default Navigation;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement