Skip to content

Commit

Permalink
Setup notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
C-Rodg committed Nov 29, 2017
1 parent d3202f7 commit 17ede70
Show file tree
Hide file tree
Showing 5 changed files with 214 additions and 31 deletions.
121 changes: 98 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
{
"name": "preview-generator",
"version": "1.0.0",
"description":
"A landing page for creating IIS virtual directories and applications using NodeJS.",
"description": "A landing page for creating IIS virtual directories and applications using NodeJS.",
"main": "index.js",
"scripts": {
"dev":
"webpack-dev-server --hot --host 0.0.0.0 --config=./webpack.dev.config.js",
"dev": "webpack-dev-server --hot --host 0.0.0.0 --config=./webpack.dev.config.js",
"start": "node index.js",
"build": "webpack --config webpack.build.config.js",
"watch": "webpack --config webpack.build.config.js --watch"
Expand All @@ -15,7 +13,11 @@
"type": "git",
"url": "git+https://github.com/C-Rodg/IIS-Preview-Generator.git"
},
"keywords": ["NodeJS", "express", "IIS"],
"keywords": [
"NodeJS",
"express",
"IIS"
],
"author": "C-Rodg",
"license": "MIT",
"bugs": {
Expand All @@ -24,7 +26,8 @@
"homepage": "https://github.com/C-Rodg/IIS-Preview-Generator#readme",
"dependencies": {
"axios": "^0.17.1",
"express": "^4.16.2"
"express": "^4.16.2",
"react-toastify": "^3.0.0"
},
"devDependencies": {
"babel-core": "^6.26.0",
Expand Down
35 changes: 33 additions & 2 deletions src/components/App.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,51 @@
import React, { Component } from "react";
import axios from "axios";
import { ToastContainer, toast } from "react-toastify";

import Header from "./Header";
import Card from "./Card";
import Loading from "./Loading";
import { setTimeout } from "timers";

const successToast = {
className: "success-toast",
bodyClassName: "toast-msg"
};

const errorToast = {
className: "error-toast",
bodyClassName: "toast-msg"
};

class App extends Component {
state = {
loading: false
};
createPreview = () => {
// send to node backend
// Set loading = true

this.setState({ loading: true }, () => {
// Call backend node service
// OnSuccess =>
//toast.success("Preview created successfully!", successToast);
//this.setState({ loading: false });
// OnError =>
//toast.success("Unable to create preview..", errorToast);
//this.setState({ loading: false });
});
};

render() {
return (
<div className="app">
<ToastContainer autoClose={100000000} />
<Header />
<main className="container">
<Card onCreatePreview={this.createPreview} />
{!this.state.loading ? (
<Card onCreatePreview={this.createPreview} />
) : (
<Loading />
)}
</main>
</div>
);
Expand Down
Loading

0 comments on commit 17ede70

Please sign in to comment.