Skip to content

Commit

Permalink
React Styled Components Refactor
Browse files Browse the repository at this point in the history
Refactor all css to styled components
Functional and class components refactor
Api converted to only one endpoint
Minor Fixes
  • Loading branch information
lfdo20 committed Apr 2, 2018
1 parent 7178e74 commit ecc95af
Show file tree
Hide file tree
Showing 13 changed files with 440 additions and 232 deletions.
14 changes: 12 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
"extends": "airbnb-base",
"plugins": [

"react"
],
"rules": {
"no-unused-vars": "off",
Expand All @@ -12,9 +12,19 @@ module.exports = {
"no-confusing-arrow": "off",
"object-curly-newline": "off",
"one-var-declaration-per-line": "off",
"prefer-destructuring": "off"
"prefer-destructuring": "off",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"no-unused-expressions": "off",
"camelcase": "off",
"arrow-body-style": "off"
},
"env": {
"node": true
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
}
}
};
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ typings/
# backup directory
.bkp

# vscode directory
.vscode

# data files

bddata.json
gifdata.json
nvdata.json
Expand Down
2 changes: 1 addition & 1 deletion dist/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ function botDialog(msg, match) {
});
}

var dialogMatchRegx = /^(.+)?(@bomdiacracobot|\sbot|bote)(.+)?$/gi;
var dialogMatchRegx = /^(.+\s)?(@bomdiacracobot|bot|bote)(\s.+)?$/gi;
bot.onText(dialogMatchRegx, function (msg, match) {
botDialog(msg, match);
});
Expand Down
9 changes: 2 additions & 7 deletions dist/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ var app = express();

app.use(express.static(path.join(__dirname, '../web')));

app.get('/api/length', function (req, res) {
app.get('/api', function (req, res) {
res.json({
bdlen: (0, _bot.dataValues)().bddata.bomdia.length,
giflen: (0, _bot.dataValues)().gifdata.ckdgif.length,
gifvalidlen: (0, _bot.dataValues)().gifdata.newgif.length,
bdc: (0, _bot.dataValues)().bdiadaycount,
proxData: (0, _bot.dataProx)()
});
});

app.get('/api/bdias', function (req, res) {
res.json({
proxData: (0, _bot.dataProx)(),
bdias: (0, _bot.dataValues)().bddata.latebdreceived
});
});
Expand Down
Loading

0 comments on commit ecc95af

Please sign in to comment.