Instantly share code, notes, and snippets.

View routes.js
import React from 'react';
import Loadable from 'react-loadable'
import DefaultLayout from './containers/DefaultLayout';
function Loading() {
return <div>Loading...</div>;
}
const Dashboard = Loadable({
loader: () =>
import ('./views/Dashboard'),
View App.js
import React, { Component } from 'react';
import { HashRouter, Route, Switch } from 'react-router-dom';
import './App.css';
import '@coreui/icons/css/coreui-icons.min.css';
import 'flag-icon-css/css/flag-icon.min.css';
import 'font-awesome/css/font-awesome.min.css';
View Login.js
import React, { Component } from 'react';
import { Button, Card, CardBody, CardGroup, Col, Container, Form, Input, InputGroup, InputGroupAddon, InputGroupText, Row } from 'reactstrap';
import fav from './favicon.ico';
import axios from 'axios';
import swal from 'sweetalert';
import createHistory from 'history/createBrowserHistory'
const history = createHistory()
//import { Redirect, Route, Switch, } from 'react-router-dom';
class Login extends Component {
View AjouterFacture.js
class AjouterFacture extends Component {
constructor(props) {
super(props);
this.state = {
rowData: [],
Produits: [],
QuantiteF: "",
View EditClient.js
import React, { Component } from 'react';
import {
Badge,
ButtonDropdown,
Button,
Card,
CardBody,
CardFooter,
CardHeader,
Col,
View LineItem.js
import React, {
Component
}
from 'react';
class LineItem extends Component {
constructor(props) {
super(props);
this.state = Object.assign({}, props.lineItemData);
this.handleDeleteClick = this.handleDeleteClick.bind(this);
View AjouterFacture.js
import React, {
Component
}
from 'react';
from 'reactstrap';
import axios from 'axios';
import LineItem from './LineItem';
import moment from 'moment';
class AjouterFacture extends Component {
View package.json
{
"name": "@coreui/coreui-free-react-admin-template",
"version": "2.0.5",
"description": "CoreUI React Open Source Bootstrap 4 Admin Template",
"author": "Łukasz Holeczek",
"homepage": "https://coreui.io",
"copyright": "Copyright 2018 creativeLabs Łukasz Holeczek",
"license": "MIT",
"private": true,
"repository": {
View ListeClients.js
import React, { Component } from 'react';
import { Badge, Card, CardBody, CardHeader, Col, Pagination, PaginationItem, PaginationLink, Row, Table } from 'reactstrap';
import Modal from 'react-modal';
import axios from 'axios';
import ListeClientFooter from '../../../containers/DefaultLayout/ListeClientFooter.js';
class ListeClients extends Component {
View Server.js
var express = require("express");
var login = require('./routes/loginroutes');
var clients = require('./routes/clientroutes');
var cors = require('cors');
var bodyParser = require('body-parser');
/*
Module:multer
multer is middleware used to handle multipart form data
*/