Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
39f9693
Add re-direction upon successful PoS creation
May 23, 2019
0497a52
Merge branch 'lightswarm124' of https://github.com/BitcoinBay/CryptoP…
ReemaGowda May 23, 2019
900917e
changed cashier button route
lightswarm124 May 24, 2019
c4b3a33
Add listing of logged-in user's PoS systems
May 24, 2019
e07da19
Add styling for the user PoS list
May 24, 2019
68c501c
remove depreciated layouts
lightswarm124 May 24, 2019
5b916d3
made few changes in payment sucess page
ReemaGowda May 24, 2019
9f2c3ee
added sass modules
ReemaGowda May 25, 2019
8460868
Merge remote-tracking branch 'origin/lkloosterman-frontend' into ligh…
lightswarm124 May 27, 2019
85f57fe
simplified currency toggling
lightswarm124 May 27, 2019
9b809c0
fixed the error
ReemaGowda May 27, 2019
c94c067
Remove unused imports and variables
May 27, 2019
a6fd373
fixed the user error
ReemaGowda May 27, 2019
2bf6677
Merge branch 'develop' of https://github.com/BitcoinBay/CryptoPoSFron…
ReemaGowda May 27, 2019
dd66fb2
Merge branch 'develop' of github.com:BitcoinBay/CryptoPoSFrontEnd int…
May 27, 2019
fce6b57
added fews styling
ReemaGowda May 27, 2019
c227d10
update frontend
lightswarm124 May 27, 2019
e34e578
Merge branch 'develop' of https://github.com/BitcoinBay/CryptoPoSFron…
ReemaGowda May 27, 2019
91b192b
added new functionlity toogle paid and upaid status
ReemaGowda May 27, 2019
7a2d3fa
checking the status updating
ReemaGowda May 27, 2019
a745630
fixed up socket and qr codes
lightswarm124 May 27, 2019
f91aa11
blah
ReemaGowda May 27, 2019
f2925ea
Please send address status BCH working
ReemaGowda May 27, 2019
ab03c72
Amount is getting updated to send the qr address
ReemaGowda May 27, 2019
ad7c91c
centered the layout
ReemaGowda May 27, 2019
1d9cb9a
updated decimal fixing for currencies
lightswarm124 May 27, 2019
9c422d5
Add new component for the PoS dashboard
May 27, 2019
f807920
Add new routes and add parameters to existing ones
May 27, 2019
4945f3b
Move PoS specific buttons to PoS dashboard
May 27, 2019
ff850f3
Add CSS to make dashboard links look better
May 27, 2019
4e622b7
qr
ReemaGowda May 28, 2019
2b2f6b8
QR
ReemaGowda May 28, 2019
a1f4412
frontend
lightswarm124 May 28, 2019
8a23e00
fixing the responsiveness
ReemaGowda May 29, 2019
3dbbe6e
Merge remote-tracking branch 'origin/QR' into lightswarm124
lightswarm124 May 29, 2019
471247e
Make certain dashboard styles inline
May 29, 2019
644f901
Change some styles to inline to stop conflicts
May 29, 2019
a31107e
Make PoS id and the PoSs XPub available
May 29, 2019
99326db
Add selector for initial XPub's currency type
May 29, 2019
f3b532e
Merge remote-tracking branch 'origin/lkloosterman-frontend' into ligh…
lightswarm124 May 29, 2019
a073621
merge with lars branch
lightswarm124 May 29, 2019
aa10a31
Moved the new order to cashier page ,responsiveness
ReemaGowda May 29, 2019
9a6e22d
fixing the mergr confilt
ReemaGowda May 29, 2019
078eb06
removed denomiatedin
ReemaGowda May 29, 2019
988f14e
Space out Customer and Cashier button links
May 29, 2019
7642710
Merge branch 'develop' of github.com:BitcoinBay/CryptoPoSFrontEnd int…
May 29, 2019
f78c3bb
Fix stylesheet issues
May 29, 2019
2b4c634
cashier page
lightswarm124 May 29, 2019
4e53e74
Merge remote-tracking branch 'origin/lkloosterman-frontend' into ligh…
lightswarm124 May 30, 2019
5ff8422
Merge remote-tracking branch 'origin/QR' into lightswarm124
lightswarm124 May 30, 2019
22f2fc0
Change alignment of code for PoS buttons
May 30, 2019
0245ff9
Add delete PoS functionality
May 30, 2019
040dc07
correctly changing address formats for different cryptos
lightswarm124 May 30, 2019
d158836
Merge remote-tracking branch 'origin/feature/pos-deletion' into light…
lightswarm124 May 30, 2019
9358939
transcation history fetched data from blockcyper api
ReemaGowda May 30, 2019
b78617d
toggling crypto
lightswarm124 May 30, 2019
6abd5ff
Merge remote-tracking branch 'origin/QR' into develop
lightswarm124 Jun 4, 2019
a19780e
listening for transactions
lightswarm124 Jun 4, 2019
85e81bf
modified frontend UI
lightswarm124 Jun 5, 2019
afc1cd9
checking to feature branch
yash2701 Jun 6, 2019
051cd37
Change some wording for form
Jun 6, 2019
68ca251
Change some of the layout
Jun 6, 2019
9465056
Get rid of seperate styles file
Jun 6, 2019
011f6d9
Add functionality for adding new payment methods
Jun 6, 2019
29fb14c
linked the trancation to posdash board
ReemaGowda Jun 6, 2019
0298b30
commit temp
lightswarm124 Jun 6, 2019
670b72d
Merge remote-tracking branch 'origin/feature/pos-deletion' into light…
lightswarm124 Jun 6, 2019
aa5512f
Merge branch 'lightswarm124' of https://github.com/BitcoinBay/CryptoP…
ReemaGowda Jun 6, 2019
5d9c558
cashier getting correct json responses for xpubs
lightswarm124 Jun 6, 2019
e4e393c
Merge remote-tracking branch 'origin/QR' into lightswarm124
lightswarm124 Jun 6, 2019
41d5204
modified the bitbox-js repo
lightswarm124 Jun 6, 2019
eb9a32a
conditional rendering
lightswarm124 Jun 6, 2019
128544b
conditional rendering
lightswarm124 Jun 6, 2019
ccce9d1
merging branches
lightswarm124 Jun 7, 2019
9461e41
test
ReemaGowda Jun 10, 2019
9af4a12
update from lightswarm124
yash2701 Jun 10, 2019
9fb4a5f
Merge branch 'lightswarm124' of https://github.com/BitcoinBay/CryptoP…
ReemaGowda Jun 10, 2019
f079c14
update from lightswarm124
yash2701 Jun 10, 2019
31ee46e
button hoverable fixed
ReemaGowda Jun 10, 2019
30b65bd
fixing the button onclick focus materialUI
ReemaGowda Jun 10, 2019
e873069
fixed cashier and customer
lightswarm124 Jun 10, 2019
eb57c98
Merge remote-tracking branch 'origin/QR' into lightswarm124
lightswarm124 Jun 10, 2019
1687834
no bip21 urls
lightswarm124 Jun 11, 2019
68e55ea
Add react-jss dependency
Jun 24, 2019
c265b57
Change tab name to Bitcoin Bay
Jun 24, 2019
4762119
Remove the unnecessary navbar component usage
Jun 24, 2019
c14627b
Add action type for setting the active PoS system
Jun 24, 2019
7c53ffe
Add formatting indent
Jun 24, 2019
5b86529
Use a search URL parameter instead of a query in router link
Jun 24, 2019
4b40890
Reworked to use Redux for PoS information, and changed CSS styling
Jun 24, 2019
23fc264
Add formatting whitespace
Jun 24, 2019
ab77196
Take out the tutorial landing page header
Jun 24, 2019
cbdf5c7
Rework to use search params vs queries in router links
Jun 24, 2019
b3e8456
Remove trailing comma
Jun 24, 2019
04beaab
Merge remote-tracking branch 'origin/develop' into feature/pos-deletion
Jun 24, 2019
f866fa6
Fix page after merge
Jun 25, 2019
4f051f9
Take out redirection after XPub add
Jun 25, 2019
5bcd685
modified addresses
lightswarm124 Jun 26, 2019
6757e3f
Merge remote-tracking branch 'origin/feature/pos-deletion' into light…
lightswarm124 Jun 26, 2019
02c9ac4
merging with pos-specific url
lightswarm124 Jun 27, 2019
1b2b0e0
Merge branch 'lightswarm124' of https://github.com/BitcoinBay/CryptoP…
lightswarm124 Jun 27, 2019
9d2b045
added testnet tokens
lightswarm124 Jun 28, 2019
060029a
added testnet tokens
lightswarm124 Jun 28, 2019
2db7e15
modified utxo for testnet
lightswarm124 Jul 2, 2019
d4ec9b2
Initial commit for branch
Jul 2, 2019
9ccc8d4
Merge branch 'lightswarm124' of github.com:BitcoinBay/CryptoPoSFrontE…
Jul 2, 2019
83bfaff
Add settings drawer
Jul 4, 2019
f8f1cc6
reworking transaction order history
lightswarm124 Jul 5, 2019
b4a6864
working on transaction history page
lightswarm124 Jul 5, 2019
8486757
Add materialize-css to dependencies
Jul 8, 2019
4e8e0bd
Add whitespace for formatting
Jul 8, 2019
ee7233c
Fix materialize version number
Jul 8, 2019
927be6b
Change the route name for transaction history page
Jul 8, 2019
d12ef93
Remove unnecessary import
Jul 8, 2019
0594e45
Use functionality to add transactions to database
Jul 8, 2019
47a676f
Use IP address for socket listen address
Jul 8, 2019
bf9dfea
Rework the order page to transaction list
Jul 8, 2019
474d17a
Finally get rid of evil seperate CSS files for good
Jul 8, 2019
b7e4ffa
Change something
Jul 8, 2019
1166165
Merge remote-tracking branch 'origin/txHistory' into lkloosterman-fro…
Jul 8, 2019
94201b7
Make buttons disable when currencies aren't available
Jul 11, 2019
1c1d066
Get rid of unnecessary imports
Jul 11, 2019
561affb
Switch over to new JWT token authentication method and remove old
Jul 18, 2019
10bd777
Switch to new JWT token authentication method
Jul 22, 2019
9916d6d
Switch to use of new JWT token authentication method
Jul 22, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,37 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@chris.troutner/bitbox-js": "https://github.com/christroutner/bitbox-js",
"@chris.troutner/bitbox-js": "https://github.com/BitcoinBay/bitbox-js",
"@material-ui/core": "^4.1.3",
"@types/jest": "^24.0.13",
"@types/node": "^12.0.2",
"@types/react": "^16.8.17",
"@types/react-dom": "^16.8.4",
"axios": "^0.18.0",
"babel-plugin-react-css-modules": "^5.2.6",
"bitbox-sdk": "^7.3.0",
"classnames": "^2.2.6",
"eslint": "^5.16.0",
"ethereumjs-wallet": "^0.6.3",
"is-empty": "^1.2.0",
"jwt-decode": "^2.2.0",
"link-react": "^3.0.0",
"materialize-css": "^1.0.0-rc.2",
"materialize-css": "^1.0.0",
"node-sass": "^4.12.0",
"qrcode.react": "^0.9.3",
"rc-if-else": "^1.1.0",
"react": "^16.8.6",
"react-bootstrap": "^1.0.0-beta.8",
"react-dom": "^16.8.6",
"react-helmet": "^5.2.1",
"react-jss": "^8.6.1",
"react-native-qrcode": "^0.2.7",
"react-qr-code": "^0.1.3",
"react-redux": "^7.0.3",
"react-router-dom": "^5.0.0",
"react-scripts": "3.0.1",
"react-super-responsive-table": "^4.3.12",
"react-table": "^6.10.0",
"redux": "^4.0.1",
"redux-thunk": "^2.3.0",
"semantic-ui-react": "^0.87.1",
Expand Down
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<title>MERN Auth App</title>
<link href="https://fonts.googleapis.com/css?family=Poppins|Roboto:300,400,500,700&display=swap" rel="stylesheet">
<title>Bitcoin Bay</title>
</head>
<body>
<noscript>
Expand Down
38 changes: 11 additions & 27 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,62 +1,46 @@

import React, { Component } from "react";
import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
import jwt_decode from "jwt-decode";
import { BrowserRouter as Router, Route } from "react-router-dom";
import setAuthToken from "./utils/setAuthToken";

import { setCurrentUser, logoutUser } from "./actions/authActions";
import { Provider } from "react-redux";
import store from "./store";

import Navbar from "./components/layout/Navbar";
//import Navbar from "./components/layout/Navbar";
import Landing from "./components/layout/Landing";
import Cashier from "./components/layout/Cashier";
import Customer from "./components/layout/Customer";
import Register from "./components/auth/Register";
import Login from "./components/auth/Login";
import PrivateRoute from "./components/private-route/PrivateRoute";
import Dashboard from "./components/dashboard/Dashboard";
import CreatePoS from "./components/create-pos/CreatePoS";
import POSDashboard from "./components/pos-dashboard/POSDashboard";
import TransactionList from "./components/layout/TransactionList";

import "./App.css";
import PaymentSucess from "./components/layout/PaymentSucess";

// Check for token to keep user logged in
if (localStorage.jwtToken) {
// Set auth token header auth
const token = localStorage.jwtToken;
setAuthToken(token);
// Decode token and get user info and exp
const decoded = jwt_decode(token);
// Set user and isAuthenticated
store.dispatch(setCurrentUser(decoded));
// Check for expired token
const currentTime = Date.now() / 1000; // to get in milliseconds
if (decoded.exp < currentTime) {
// Logout user
store.dispatch(logoutUser());

// Redirect to login
window.location.href = "./login";
}
}

class App extends Component {
render() {
return (
<Provider store={store}>
<Router>
<div className="App">
<Navbar />
<Route exact path="/" component={Landing} />
<Route exact path="/register" component={Register} />
<Route exact path="/login" component={Login} />
<Switch>
<PrivateRoute exact path="/dashboard" component={Dashboard} />
<PrivateRoute exact path="/cashier" component={Cashier} />
<PrivateRoute exact path="/customer" component={Customer} />
<PrivateRoute exact path="/PaymentSucess" component= {PaymentSucess}/>
<PrivateRoute exact path="/create-pos" component={CreatePoS} />
</Switch>
<Route exact path="/dashboard" component={Dashboard} />
<Route exact path="/cashier" component={Cashier} />
<Route exact path="/customer" component={Customer} />
<Route exact path="/create-pos" component={CreatePoS} />
<Route exact path="/pos-dashboard" component={POSDashboard} />
<Route exact path="/transactions" component={TransactionList}/>
</div>
</Router>
</Provider>
Expand Down
35 changes: 8 additions & 27 deletions src/actions/authActions.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import axios from "axios";
import setAuthToken from "../utils/setAuthToken";
import jwt_decode from "jwt-decode";

import { GET_ERRORS, SET_CURRENT_USER, USER_LOADING } from "./types";
import { GET_ERRORS } from "./types";

// Register User
export const registerUser = (userData, history) => dispatch => {
Expand All @@ -18,21 +17,18 @@ export const registerUser = (userData, history) => dispatch => {
};

// Login - get user token
export const loginUser = userData => dispatch => {
export const loginUser = (userData, history) => dispatch => {
axios
.post("/api/users/login", userData)
.then(res => {
// Save to localStorage

// Set token to localStorage
const { token } = res.data;
localStorage.setItem("jwtToken", token);

// Set token to Auth header
setAuthToken(token);
// Decode token to get user data
const decoded = jwt_decode(token);
// Set current user
dispatch(setCurrentUser(decoded));

history.push("/dashboard");
})
.catch(err =>
dispatch({
Expand All @@ -42,27 +38,12 @@ export const loginUser = userData => dispatch => {
);
};

// Set logged in user
export const setCurrentUser = decoded => {
return {
type: SET_CURRENT_USER,
payload: decoded
};
};

// User loading
export const setUserLoading = () => {
return {
type: USER_LOADING
};
};

// Log user out
export const logoutUser = () => dispatch => {
export const logoutUser = (history) => dispatch => {
// Remove token from local storage
localStorage.removeItem("jwtToken");
// Remove auth header for future requests
setAuthToken(false);
// Set current user to empty object {} which will set isAuthenticated to false
dispatch(setCurrentUser({}));

history.push("/login");
};
3 changes: 1 addition & 2 deletions src/actions/types.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
export const GET_ERRORS = "GET_ERRORS";
export const USER_LOADING = "USER_LOADING";
export const SET_CURRENT_USER = "SET_CURRENT_USER";
export const SET_POS = "SET_POS";
6 changes: 5 additions & 1 deletion src/components/QRAddress21.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import React from 'react';
import PropTypes from 'prop-types';
// import QRCode from 'qrcode-react';

var QRCode = require('qrcode.react');

export default class QRAddress21 extends React.Component {
Expand All @@ -16,10 +17,13 @@ export default class QRAddress21 extends React.Component {

return(
<div >
<QRCode value={ value } size={parseInt(this.state.size)}/>
<QRCode value={ value } size={parseInt(this.state.size)} />
<p className="add">{ value }</p>
</div>
);
}
};

QRAddress21.propTypes = {
value: PropTypes.string
};
7 changes: 3 additions & 4 deletions src/components/auth/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,13 @@ class Login extends Component {
}

componentDidMount() {
// If logged in and user navigates to Login page, should redirect them to dashboard
if (this.props.auth.isAuthenticated) {
if (localStorage.getItem("jwtToken")) {
this.props.history.push("/dashboard");
}
}

componentWillReceiveProps(nextProps) {
if (nextProps.auth.isAuthenticated) {
if (localStorage.getItem("jwtToken")) {
this.props.history.push("/dashboard");
}

Expand All @@ -46,7 +45,7 @@ class Login extends Component {
password: this.state.password
};

this.props.loginUser(userData);
this.props.loginUser(userData, this.props.history);
};

render() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/auth/Register.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Register extends Component {

componentDidMount() {
// If logged in and user navigates to Register page, should redirect them to dashboard
if (this.props.auth.isAuthenticated) {
if (localStorage.getItem("jwtToken")) {
this.props.history.push("/dashboard");
}
}
Expand Down
Loading