Skip to content

Instantly share code, notes, and snippets.

View theSekyi's full-sized avatar

Emmanuel Sekyi theSekyi

View GitHub Profile
import $ from 'jquery';
class MobileMenu {
constructor() {
this.siteHeader = $('.nav');
this.menuIcon = $('.nav__menu-icon');
this.menuContent = $('.nav__content');
this.events();
}
import React from 'react';
import { Link } from 'react-router-dom';
import $ from 'jquery';
import '../styles/styles.css';
import MobileMenu from './MobileMenu';
import Logo from '../icons/images/logo.png';
class Nav extends React.Component {
constructor() {
super();
// Your code here
class Point {
constructor(x,y){
this.x = x;
this.y = y;
}
plus(a,b){
return this.x + a , this.y + b
import React from 'react';
import { Link } from 'react-router-dom';
class Nav extends React.Component {
state = {
isVisible: false
};
onClick = () => this.setState(state => ({ isVisible: !state.isVisible }));
import React, { Component } from 'react';
class Why extends Component {
render() {
return (
<div className="why">
<section id="#why">
<h3 className="why__mainTitle"> Why RIP </h3>
<div className="why__i">
<h3 className="why__title">Lorem Ipsum</h3>
import React from 'react';
import NavS from './NavS';
import cookie from 'react-cookies';
class ProjectionsHeader extends React.Component {
constructor(props) {
super(props);
this.state = {
lump: cookie.load('lump'),
monthly: cookie.load('monthly')
import React from 'react';
import Nav from './Nav';
import ProjectionsHeader from './projectionsHeader';
import Chart from './chart';
import cookie from 'react-cookies';
class Projections extends React.Component {
constructor() {
super();
this.state = {
// // const url = 'http://35.227.59.39:8001/api/utils/nav_performance';
// // let Dailyrate = fetch(url)
// // .then(resp => resp.json())
// // .then(function(values) {
// // return values[7].unit;
// // });
// // //.catch();
let currentYear = new Date().getFullYear();
let currentDate = new Date();
@theSekyi
theSekyi / api.js
Last active January 24, 2018 12:19
let currentYear = new Date().getFullYear();
let currentDate = new Date();
let currentMonth = currentDate.getUTCMonth() + 1;
let currentDay = currentDate.getUTCDate();
let oldDay = currentDay - 2;
let newDay = currentDay - 1;
if (currentMonth < 10) {
currentMonth = '0' + currentMonth;
}
if (currentDay < 10) {
let navOld = fetch(oldNavUrl)
.then(response => response.json())
.then(data => {
return data.payload.nav;
});
console.log(navOld)