Compare commits

..

12 Commits

Author SHA1 Message Date
Aditya Sankaran
64657fa3af fixed login and register. working on frontend now 2019-10-03 09:29:22 -04:00
Leon Liang
d072a5ff95 Merge pull request #24 from ClaytonWWilson/profile_display
Profile display
2019-10-02 23:30:05 -04:00
Leon Liang
9c0dac507f Light blue color scheme 2019-10-02 23:29:05 -04:00
Leon Liang
5168de65c1 Merge branch 'master' into profile_display 2019-10-02 23:24:21 -04:00
Leon Liang
2536547c63 Theming 2019-10-02 23:21:30 -04:00
Leon Liang
42a07ffa5e resolved merge conflict in app.css 2019-10-02 23:10:12 -04:00
Leon Liang
7558602a90 Added post card 2019-10-02 23:08:34 -04:00
Aditya Sankaran
3b682bae18 Revert "Can successfully register and login in UI"
This reverts commit 893cad7e7e.

reverting commit
2019-10-02 21:38:23 -04:00
Aditya Sankaran
5acc7a64e0 Revert "Modified code for posts in homes"
This reverts commit 71b6965830.

   reversing commit
2019-10-02 21:35:23 -04:00
Aaron Sun
71b6965830 Modified code for posts in homes 2019-10-02 20:45:45 -04:00
Aaron Sun
893cad7e7e Can successfully register and login in UI 2019-10-02 20:40:46 -04:00
Leon Liang
15f106ed1a added theme.js 2019-10-02 15:10:02 -04:00
11 changed files with 390 additions and 146 deletions

View File

@@ -41,20 +41,3 @@ exports.getallPostsforUser = (req, res) => {
return res.status(500).json({error: 'Failed to fetch all posts written by specific user.'}) return res.status(500).json({error: 'Failed to fetch all posts written by specific user.'})
}) })
} }
exports.getallPostsrelatedtoTopics = (req, res) => {
admin.firestore().collection('posts').where('microBlogTopics', '==', 'Joker').get()
.then((data) => {
let posts = [];
data.forEach(function(doc) {
posts.push(doc.data());
});
return res.status(200).json(posts);
})
.catch((err) => {
console.err(err);
return res.status(500).json({error: 'Failed to fetch all posts with a specific Topic.'})
}
)
}

View File

@@ -70,9 +70,15 @@
"integrity": "sha512-foQHhvyB0RR+mb/+wmHXd/VOU+D8fruFEW1k79Q9wzyTPpovMBa1Mcns5fwEWBhUfi8bmoEtaGB8RSAHnTFzTg==" "integrity": "sha512-foQHhvyB0RR+mb/+wmHXd/VOU+D8fruFEW1k79Q9wzyTPpovMBa1Mcns5fwEWBhUfi8bmoEtaGB8RSAHnTFzTg=="
}, },
"@firebase/database": { "@firebase/database": {
<<<<<<< HEAD
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.5.3.tgz",
"integrity": "sha512-LnXKRE1AmjlS+iRF7j8vx+Ni8x85CmLP5u5Pw5rDKhKLn2eTR1tJKD937mUeeGEtDHwR1rrrkLYOqRR2cSG3hQ==",
=======
"version": "0.5.4", "version": "0.5.4",
"resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.5.4.tgz", "resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.5.4.tgz",
"integrity": "sha512-Hz1Bi3fzIcNNocE4EhvvwoEQGurG2BGssWD3/6a2bzty+K1e57SLea2Ied8QYNBUU1zt/4McHfa3Y71EQIyn/w==", "integrity": "sha512-Hz1Bi3fzIcNNocE4EhvvwoEQGurG2BGssWD3/6a2bzty+K1e57SLea2Ied8QYNBUU1zt/4McHfa3Y71EQIyn/w==",
>>>>>>> 7969d3b10bc35a9078834c5ee2ba8c8fd60d338f
"requires": { "requires": {
"@firebase/database-types": "0.4.3", "@firebase/database-types": "0.4.3",
"@firebase/logger": "0.1.25", "@firebase/logger": "0.1.25",
@@ -107,7 +113,11 @@
"@firebase/firestore": { "@firebase/firestore": {
"version": "1.5.3", "version": "1.5.3",
"resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-1.5.3.tgz", "resolved": "https://registry.npmjs.org/@firebase/firestore/-/firestore-1.5.3.tgz",
<<<<<<< HEAD
"integrity": "sha512-CPYLvkGZBKE47oQC9a0q13UMVRj3LvnSbB1nOerktE3CGRHKy44LxDumamN8Kj067hV/80mKK9FdbeUufwO/Rg==",
=======
"integrity": "sha512-O/yAbXpitOA6g627cUl0/FHYlkTy1EiEKMKOlnlMOJF2fH+nLVZREXjsrCC7N2tIvTn7yYwfpZ4zpSNvrhwiTA==", "integrity": "sha512-O/yAbXpitOA6g627cUl0/FHYlkTy1EiEKMKOlnlMOJF2fH+nLVZREXjsrCC7N2tIvTn7yYwfpZ4zpSNvrhwiTA==",
>>>>>>> 7969d3b10bc35a9078834c5ee2ba8c8fd60d338f
"requires": { "requires": {
"@firebase/firestore-types": "1.5.0", "@firebase/firestore-types": "1.5.0",
"@firebase/logger": "0.1.25", "@firebase/logger": "0.1.25",
@@ -597,6 +607,12 @@
"integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==",
"dev": true "dev": true
}, },
"ansi-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
},
"ansi-styles": { "ansi-styles": {
"version": "3.2.1", "version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
@@ -1174,9 +1190,15 @@
} }
}, },
"end-of-stream": { "end-of-stream": {
<<<<<<< HEAD
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
"integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
=======
"version": "1.4.3", "version": "1.4.3",
"resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.3.tgz", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.3.tgz",
"integrity": "sha512-cbNhPFS6MlYlWTGncSiDYbdqKhwWFy7kNeb1YSOG6K65i/wPTkLVCJQj0hXA4j0m5Da+hBWnqopEnu1FFelisQ==", "integrity": "sha512-cbNhPFS6MlYlWTGncSiDYbdqKhwWFy7kNeb1YSOG6K65i/wPTkLVCJQj0hXA4j0m5Da+hBWnqopEnu1FFelisQ==",
>>>>>>> 7969d3b10bc35a9078834c5ee2ba8c8fd60d338f
"optional": true, "optional": true,
"requires": { "requires": {
"once": "^1.4.0" "once": "^1.4.0"
@@ -1252,6 +1274,7 @@
"progress": "^2.0.0", "progress": "^2.0.0",
"regexpp": "^2.0.1", "regexpp": "^2.0.1",
"semver": "^5.5.1", "semver": "^5.5.1",
"strip-ansi": "^4.0.0",
"strip-json-comments": "^2.0.1", "strip-json-comments": "^2.0.1",
"table": "^5.2.3", "table": "^5.2.3",
"text-table": "^0.2.0" "text-table": "^0.2.0"
@@ -1687,7 +1710,8 @@
"functional-red-black-tree": { "functional-red-black-tree": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
"integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
"optional": true
}, },
"gaxios": { "gaxios": {
"version": "2.0.1", "version": "2.0.1",
@@ -2235,9 +2259,15 @@
} }
}, },
"gtoken": { "gtoken": {
<<<<<<< HEAD
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.0.0.tgz",
"integrity": "sha512-XaRCfHJxhj06LmnWNBzVTAr85NfAErq0W1oabkdqwbq3uL/QTB1kyvGog361Uu2FMG/8e3115sIy/97Rnd4GjQ==",
=======
"version": "4.1.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.1.0.tgz", "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-4.1.0.tgz",
"integrity": "sha512-wqyn2gf5buzEZN4QNmmiiW2i2JkEdZnL7Z/9p44RtZqgt4077m4khRgAYNuu8cBwHWCc6MsP6eDUn/KkF6jFIw==", "integrity": "sha512-wqyn2gf5buzEZN4QNmmiiW2i2JkEdZnL7Z/9p44RtZqgt4077m4khRgAYNuu8cBwHWCc6MsP6eDUn/KkF6jFIw==",
>>>>>>> 7969d3b10bc35a9078834c5ee2ba8c8fd60d338f
"optional": true, "optional": true,
"requires": { "requires": {
"gaxios": "^2.0.0", "gaxios": "^2.0.0",
@@ -2411,7 +2441,8 @@
"imurmurhash": { "imurmurhash": {
"version": "0.1.4", "version": "0.1.4",
"resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
"integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=",
"optional": true
}, },
"inflight": { "inflight": {
"version": "1.0.6", "version": "1.0.6",
@@ -2426,7 +2457,8 @@
"inherits": { "inherits": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
"optional": true
}, },
"inquirer": { "inquirer": {
"version": "6.5.2", "version": "6.5.2",
@@ -2444,6 +2476,7 @@
"mute-stream": "0.0.7", "mute-stream": "0.0.7",
"run-async": "^2.2.0", "run-async": "^2.2.0",
"rxjs": "^6.4.0", "rxjs": "^6.4.0",
"string-width": "^2.1.0",
"strip-ansi": "^5.1.0", "strip-ansi": "^5.1.0",
"through": "^2.3.6" "through": "^2.3.6"
}, },
@@ -2492,6 +2525,14 @@
"integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=",
"optional": true "optional": true
}, },
"is-fullwidth-code-point": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"requires": {
"number-is-nan": "^1.0.0"
}
},
"is-obj": { "is-obj": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
@@ -2888,6 +2929,7 @@
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@@ -3332,7 +3374,8 @@
"signal-exit": { "signal-exit": {
"version": "3.0.2", "version": "3.0.2",
"resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz",
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
"optional": true
}, },
"slice-ansi": { "slice-ansi": {
"version": "2.1.0", "version": "2.1.0",
@@ -3341,7 +3384,8 @@
"dev": true, "dev": true,
"requires": { "requires": {
"ansi-styles": "^3.2.0", "ansi-styles": "^3.2.0",
"astral-regex": "^1.0.0" "astral-regex": "^1.0.0",
"is-fullwidth-code-point": "^2.0.0"
} }
}, },
"snakeize": { "snakeize": {
@@ -3381,12 +3425,31 @@
"resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz",
"integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo="
}, },
"string-width": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^2.0.0",
"strip-ansi": "^4.0.0"
}
},
"string_decoder": { "string_decoder": {
"version": "0.10.31", "version": "0.10.31",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
"optional": true "optional": true
}, },
"strip-ansi": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"requires": {
"ansi-regex": "^3.0.0"
}
},
"strip-json-comments": { "strip-json-comments": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
@@ -3433,6 +3496,7 @@
"dev": true, "dev": true,
"requires": { "requires": {
"emoji-regex": "^7.0.1", "emoji-regex": "^7.0.1",
"is-fullwidth-code-point": "^2.0.0",
"strip-ansi": "^5.1.0" "strip-ansi": "^5.1.0"
} }
}, },
@@ -3691,7 +3755,8 @@
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"optional": true
}, },
"write": { "write": {
"version": "1.0.3", "version": "1.0.3",

View File

@@ -62,9 +62,9 @@
} }
}, },
"@material-ui/styles": { "@material-ui/styles": {
"version": "4.4.3", "version": "4.5.0",
"resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.4.3.tgz", "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.5.0.tgz",
"integrity": "sha512-kNUdHFWsrvWKIEPx8Xy2/qayqsGMrYmCMq+FIiJiYczVZl5hiS8j5+KayonnpVta/O+Dktk+cxWkVcgwtxMrHg==", "integrity": "sha512-O0NSAECHK9f3DZK6wy56PZzp8b/7KSdfpJs8DSC7vnXUAoMPCTtchBKLzMtUsNlijiJFeJjSxNdQfjWXgyur5A==",
"requires": { "requires": {
"@babel/runtime": "^7.4.4", "@babel/runtime": "^7.4.4",
"@emotion/hash": "^0.7.1", "@emotion/hash": "^0.7.1",
@@ -74,21 +74,21 @@
"csstype": "^2.5.2", "csstype": "^2.5.2",
"deepmerge": "^4.0.0", "deepmerge": "^4.0.0",
"hoist-non-react-statics": "^3.2.1", "hoist-non-react-statics": "^3.2.1",
"jss": "10.0.0-alpha.25", "jss": "^10.0.0",
"jss-plugin-camel-case": "10.0.0-alpha.25", "jss-plugin-camel-case": "^10.0.0",
"jss-plugin-default-unit": "10.0.0-alpha.25", "jss-plugin-default-unit": "^10.0.0",
"jss-plugin-global": "10.0.0-alpha.25", "jss-plugin-global": "^10.0.0",
"jss-plugin-nested": "10.0.0-alpha.25", "jss-plugin-nested": "^10.0.0",
"jss-plugin-props-sort": "10.0.0-alpha.25", "jss-plugin-props-sort": "^10.0.0",
"jss-plugin-rule-value-function": "10.0.0-alpha.25", "jss-plugin-rule-value-function": "^10.0.0",
"jss-plugin-vendor-prefixer": "10.0.0-alpha.25", "jss-plugin-vendor-prefixer": "^10.0.0",
"prop-types": "^15.7.2" "prop-types": "^15.7.2"
} }
}, },
"@material-ui/system": { "@material-ui/system": {
"version": "4.4.3", "version": "4.5.0",
"resolved": "https://registry.npmjs.org/@material-ui/system/-/system-4.4.3.tgz", "resolved": "https://registry.npmjs.org/@material-ui/system/-/system-4.5.0.tgz",
"integrity": "sha512-Cb05vLXsaCzssXD/iZKa0/qC6YOwbFWnYdnOEdkXZ3Fn2Ytz7rsnMgFejUSQV1luVhUBlEIm8DVz40N25WwW7w==", "integrity": "sha512-vR0PbMTzLnuuVCoYNQ13zyhLa/4s/UA9P9JbNuHBOOkfrHn53ShINiG0v05EgfwizfULLtc7mNvsGAgIyyp/hQ==",
"requires": { "requires": {
"@babel/runtime": "^7.4.4", "@babel/runtime": "^7.4.4",
"deepmerge": "^4.0.0", "deepmerge": "^4.0.0",
@@ -119,9 +119,9 @@
"integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw==" "integrity": "sha512-KfRL3PuHmqQLOG+2tGpRO26Ctg+Cq1E01D2DMriKEATHgWLfeNDmq9e29Q9WIky0dQ3NPkd1mzYH8Lm936Z9qw=="
}, },
"@types/react": { "@types/react": {
"version": "16.9.3", "version": "16.9.4",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.3.tgz", "resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.4.tgz",
"integrity": "sha512-Ogb2nSn+2qQv5opoCv7Ls5yFxtyrdUYxp5G+SWTrlGk7dmFKw331GiezCgEZj9U7QeXJi1CDtws9pdXU1zUL4g==", "integrity": "sha512-ItGNmJvQ0IvWt8rbk5PLdpdQhvBVxAaXI9hDlx7UMd8Ie1iMIuwMNiKeTfmVN517CdplpyXvA22X4zm4jGGZnw==",
"requires": { "requires": {
"@types/prop-types": "*", "@types/prop-types": "*",
"csstype": "^2.2.0" "csstype": "^2.2.0"
@@ -5196,9 +5196,9 @@
} }
}, },
"jss": { "jss": {
"version": "10.0.0-alpha.25", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/jss/-/jss-10.0.0-alpha.25.tgz", "resolved": "https://registry.npmjs.org/jss/-/jss-10.0.0.tgz",
"integrity": "sha512-zqKnXv181B9vue2yYhmVhc+6ggbbxHF/33rjXfXEjaa22nOvknTI21QDfq3oZ8uCC50kcFp3Z8KU1ghUXdFvIA==", "integrity": "sha512-TPpDFsiBjuERiL+dFDq8QCdiF9oDasPcNqCKLGCo/qED3fNYOQ8PX2lZhknyTiAt3tZrfOFbb0lbQ9lTjPZxsQ==",
"requires": { "requires": {
"@babel/runtime": "^7.3.1", "@babel/runtime": "^7.3.1",
"csstype": "^2.6.5", "csstype": "^2.6.5",
@@ -5207,69 +5207,69 @@
} }
}, },
"jss-plugin-camel-case": { "jss-plugin-camel-case": {
"version": "10.0.0-alpha.25", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/jss-plugin-camel-case/-/jss-plugin-camel-case-10.0.0-alpha.25.tgz", "resolved": "https://registry.npmjs.org/jss-plugin-camel-case/-/jss-plugin-camel-case-10.0.0.tgz",
"integrity": "sha512-J5ZEGDTy9ddqdTUPAF4SJQ25u5kiG1ORP8F+ZPEZAkkiMQJp+/Aol4I7xhTS2aW1Lhg8xNxdhdRfBi5yU7wOvg==", "integrity": "sha512-yALDL00+pPR4FJh+k07A8FeDvfoPPuXU48HLy63enAubcVd3DnS+2rgqPXglHDGixIDVkCSXecl/l5GAMjzIbA==",
"requires": { "requires": {
"@babel/runtime": "^7.3.1", "@babel/runtime": "^7.3.1",
"hyphenate-style-name": "^1.0.3", "hyphenate-style-name": "^1.0.3",
"jss": "10.0.0-alpha.25" "jss": "10.0.0"
} }
}, },
"jss-plugin-default-unit": { "jss-plugin-default-unit": {
"version": "10.0.0-alpha.25", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/jss-plugin-default-unit/-/jss-plugin-default-unit-10.0.0-alpha.25.tgz", "resolved": "https://registry.npmjs.org/jss-plugin-default-unit/-/jss-plugin-default-unit-10.0.0.tgz",
"integrity": "sha512-auOG459B+yEqkojgaXH02SYO9+xjmAxlmP+WbzhVpXqOFJ2CN/kaxd8P4NJZLdj3BQxHiM7WIyMVh786StE+EA==", "integrity": "sha512-sURozIOdCtGg9ap18erQ+ijndAfEGtTaetxfU3H4qwC18Bi+fdvjlY/ahKbuu0ASs7R/+WKCP7UaRZOjUDMcdQ==",
"requires": { "requires": {
"@babel/runtime": "^7.3.1", "@babel/runtime": "^7.3.1",
"jss": "10.0.0-alpha.25" "jss": "10.0.0"
} }
}, },
"jss-plugin-global": { "jss-plugin-global": {
"version": "10.0.0-alpha.25", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/jss-plugin-global/-/jss-plugin-global-10.0.0-alpha.25.tgz", "resolved": "https://registry.npmjs.org/jss-plugin-global/-/jss-plugin-global-10.0.0.tgz",
"integrity": "sha512-cS98Q8X8jwltuaBZd9eYuxMXxkUL+mJGl2Ok3/nmJzH9nLzj6i7kLxSoDtuJNqsRmbP7ogIXVozJUq9lUu2hlQ==", "integrity": "sha512-80ofWKSQUo62bxLtRoTNe0kFPtHgUbAJeOeR36WEGgWIBEsXLyXOnD5KNnjPqG4heuEkz9eSLccjYST50JnI7Q==",
"requires": { "requires": {
"@babel/runtime": "^7.3.1", "@babel/runtime": "^7.3.1",
"jss": "10.0.0-alpha.25" "jss": "10.0.0"
} }
}, },
"jss-plugin-nested": { "jss-plugin-nested": {
"version": "10.0.0-alpha.25", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/jss-plugin-nested/-/jss-plugin-nested-10.0.0-alpha.25.tgz", "resolved": "https://registry.npmjs.org/jss-plugin-nested/-/jss-plugin-nested-10.0.0.tgz",
"integrity": "sha512-7sk7/6mX1YTgXe+AyeD1zEyKTgIGbbhYtg+wWQcHJlE1flW2JHfcQ5mw84FgHcHQRQ8Dq3l9I3aEY51ev0J1Wg==", "integrity": "sha512-waxxwl/po1hN3azTyixKnr8ReEqUv5WK7WsO+5AWB0bFndML5Yqnt8ARZ90HEg8/P6WlqE/AB2413TkCRZE8bA==",
"requires": { "requires": {
"@babel/runtime": "^7.3.1", "@babel/runtime": "^7.3.1",
"jss": "10.0.0-alpha.25", "jss": "10.0.0",
"tiny-warning": "^1.0.2" "tiny-warning": "^1.0.2"
} }
}, },
"jss-plugin-props-sort": { "jss-plugin-props-sort": {
"version": "10.0.0-alpha.25", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/jss-plugin-props-sort/-/jss-plugin-props-sort-10.0.0-alpha.25.tgz", "resolved": "https://registry.npmjs.org/jss-plugin-props-sort/-/jss-plugin-props-sort-10.0.0.tgz",
"integrity": "sha512-8B/6QLQuUX8cIlZbXdjEm5l0jCX4EgacYMcFJhdKwDKEZYeAghpgQQrCKl0/CYHW7iFge5wim67P+uL6QxMzyw==", "integrity": "sha512-41mf22CImjwNdtOG3r+cdC8+RhwNm616sjHx5YlqTwtSJLyLFinbQC/a4PIFk8xqf1qpFH1kEAIw+yx9HaqZ3g==",
"requires": { "requires": {
"@babel/runtime": "^7.3.1", "@babel/runtime": "^7.3.1",
"jss": "10.0.0-alpha.25" "jss": "10.0.0"
} }
}, },
"jss-plugin-rule-value-function": { "jss-plugin-rule-value-function": {
"version": "10.0.0-alpha.25", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/jss-plugin-rule-value-function/-/jss-plugin-rule-value-function-10.0.0-alpha.25.tgz", "resolved": "https://registry.npmjs.org/jss-plugin-rule-value-function/-/jss-plugin-rule-value-function-10.0.0.tgz",
"integrity": "sha512-CQQtWO+/OZRGaFRBSGQUgAci9YlVtdoXcWQKBNo70tmpp+kaXKlFNCYaL3jmHbJHMiwKQYG2RYFQNIrwJ9SGmA==", "integrity": "sha512-Jw+BZ8JIw1f12V0SERqGlBT1JEPWax3vuZpMym54NAXpPb7R1LYHiCTIlaJUyqvIfEy3kiHMtgI+r2whGgRIxQ==",
"requires": { "requires": {
"@babel/runtime": "^7.3.1", "@babel/runtime": "^7.3.1",
"jss": "10.0.0-alpha.25" "jss": "10.0.0"
} }
}, },
"jss-plugin-vendor-prefixer": { "jss-plugin-vendor-prefixer": {
"version": "10.0.0-alpha.25", "version": "10.0.0",
"resolved": "https://registry.npmjs.org/jss-plugin-vendor-prefixer/-/jss-plugin-vendor-prefixer-10.0.0-alpha.25.tgz", "resolved": "https://registry.npmjs.org/jss-plugin-vendor-prefixer/-/jss-plugin-vendor-prefixer-10.0.0.tgz",
"integrity": "sha512-5FXpB/TiwckbrkoDCmd27YsWCESl1K4hAX/oro2/geEXgnVQvDgQOf2eWCsjYO2K1lYPPXtskMfws/Q3eKmbYg==", "integrity": "sha512-qslqvL0MUbWuzXJWdUxpj6mdNUX8jr4FFTo3aZnAT65nmzWL7g8oTr9ZxmTXXgdp7ANhS1QWE7036/Q2isFBpw==",
"requires": { "requires": {
"@babel/runtime": "^7.3.1", "@babel/runtime": "^7.3.1",
"css-vendor": "^2.0.6", "css-vendor": "^2.0.6",
"jss": "10.0.0-alpha.25" "jss": "10.0.0"
} }
}, },
"jsx-ast-utils": { "jsx-ast-utils": {

View File

@@ -4,6 +4,8 @@
"private": true, "private": true,
"dependencies": { "dependencies": {
"@material-ui/core": "^4.4.3", "@material-ui/core": "^4.4.3",
"@material-ui/styles": "^4.5.0",
"@material-ui/system": "^4.5.0",
"axios": "^0.19.0", "axios": "^0.19.0",
"clsx": "^1.0.4", "clsx": "^1.0.4",
"create-react-app": "^3.1.2", "create-react-app": "^3.1.2",

View File

@@ -47,3 +47,4 @@
max-width: 1200px; max-width: 1200px;
color: #1da1f2; color: #1da1f2;
} }

View File

@@ -2,10 +2,13 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import './App.css'; import './App.css';
import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider';
import createMuiTheme from '@material-ui/core/styles/createMuiTheme';
import { BrowserRouter as Router } from 'react-router-dom'; import { BrowserRouter as Router } from 'react-router-dom';
import Route from 'react-router-dom/Route'; import Route from 'react-router-dom/Route';
import Navbar from './components/layout/NavBar'; import Navbar from './components/layout/NavBar';
import themeObject from './util/theme';
import home from './pages/Home'; import home from './pages/Home';
import register from './pages/Register'; import register from './pages/Register';
@@ -16,9 +19,12 @@ import writeMicroblog from './Writing_Microblogs.js';
import edit from './pages/edit.js'; import edit from './pages/edit.js';
import userLine from './Userline.js'; import userLine from './Userline.js';
const theme = createMuiTheme(themeObject);
class App extends Component { class App extends Component {
render() { render() {
return ( return (
<MuiThemeProvider theme={theme}>
<Router> <Router>
<div className='container' > <div className='container' >
<Navbar /> <Navbar />
@@ -30,10 +36,11 @@ class App extends Component {
<Route exact path="/user" component={user}/> <Route exact path="/user" component={user}/>
<Route exact path="/home" component={writeMicroblog}/> <Route exact path="/home" component={writeMicroblog}/>
<Route exact path="/edit" component={edit}/> <Route exact path="/edit" component={edit}/>
<Route exact path="/userline" component={userLine}/> <Route exact path="/user" component={userLine}/>
</div> </div>
</Router> </Router>
</MuiThemeProvider>
); );
} }
} }

View File

@@ -1,21 +0,0 @@
import React, { Component, Fragment } from 'react';
import PropTypes from 'prop-types';
import withStyles from '@material-ui/core/styles/withStyles';
// MUI Stuff
import Button from '@material-ui/core/Button';
import TextField from '@material-ui/core/TextField';
import Dialog from '@material-ui/core/Dialog';
import DialogContent from '@material-ui/core/DialogContent';
import DialogTitle from '@material-ui/core/DialogTitle';
import CircularProgress from '@material-ui/core/CircularProgress';
import AddIcon from '@material-ui/icons/Add';
import CloseIcon from '@material-ui/icons/Close';
class SinglePost extends Component{
state = {
open: false,
body: '',
errors: {}
}
};

View File

@@ -1,26 +1,73 @@
/* eslint-disable */ /* eslint-disable */
import React, { Component } from 'react'; import React, { Component } from 'react';
import '../App.css'; import '../App.css';
import axios from 'axios';
import PropTypes from 'prop-types';
import logo from '../images/twistter-logo.png'; import logo from '../images/twistter-logo.png';
import TextField from '@material-ui/core/TextField'; import TextField from '@material-ui/core/TextField';
class Login extends Component { class Login extends Component {
constructor() {
super();
this.state = {
email: '',
password: '',
errors: {}
};
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
};
handleSubmit = (event) => {
event.preventDefault();
const userData = {
email: this.state.email,
password: this.state.password
};
axios.post('http://localhost:5001/twistter-e4649/us-central1/api/login', userData)
.then(res => {
console.log(res.data);
localStorage.setItem('firebaseIdToken', `Bearer ${res.data.token}`);
this.props.history.push('/home');
})
.catch(err => {
this.setState({
errors: err.response.data
});
});
};
handleChange = (event) => {
this.setState({
[event.target.name]: event.target.value
});
};
render() { render() {
const { classes } = this.props;
const { errors } = this.state;
return ( return (
<div> <div>
<img src={logo} className="app-logo" alt="logo" /> <img src={logo} className="app-logo" alt="logo" />
<br/><br/> <br/><br/>
<b>Log in to Twistter</b> <b>Log in to Twistter</b>
<br/><br/> <br/><br/>
<TextField className="authInput" id="email" name="email" label="Email" /> <form noValidate onSubmit={this.handleSubmit}>
<TextField className="authInput" id="email" name="email" label="Email" helperText={errors.email} error={errors.email ? true : false}
value={this.state.email} onChange={this.handleChange} />
<br/><br/> <br/><br/>
<TextField className="authInput" id="password" name="password" label="Password" /> <TextField className="authInput" id="password" name="password" label="Password" helperText={errors.password} error={errors.password ? true : false}
value={this.state.password} onChange={this.handleChange} />
<br/><br/> <br/><br/>
<button className="authButtons register" type="submit">Sign in</button> <button className="authButtons register" type="submit">Sign in</button>
</form>
</div> </div>
); );
}; };
} }
Login.propTypes = {
classes: PropTypes.object.isRequired
};
export default Login; export default Login;

View File

@@ -2,28 +2,96 @@ import React, { Component } from 'react';
import '../App.css'; import '../App.css';
import logo from '../images/twistter-logo.png'; import logo from '../images/twistter-logo.png';
import axios from 'axios';
import TextField from '@material-ui/core/TextField'; import TextField from '@material-ui/core/TextField';
import PropTypes from 'prop-types';
class Register extends Component { class Register extends Component {
constructor() {
super();
this.state = {
email: '',
handle: '',
password: '',
confirmPassword: '',
errors: {}
};
this.handleSubmit = this.handleSubmit.bind(this);
this.handleChange = this.handleChange.bind(this);
};
handleSubmit = (event) => {
const newUserData = {
email: this.state.email,
handle: this.state.handle,
password: this.state.password,
confirmPassword: this.state.confirmPassword
};
axios.post('http://localhost:5001/twistter-e4649/us-central1/api/signup', newUserData)
.then(res => {
console.log(res.data);
localStorage.setItem('firebaseIdToken', `Bearer ${res.data.token}`);
this.props.history.push('/');
})
.catch(err => {
this.setState({
errors: err.response.data
});
});
alert("You successfully registered");
event.preventDefault();
this.setState({email: '', handle: '', password: '', confirmPassword: ''});
};
handleChange = (event) => {
this.setState({
[event.target.name]: event.target.value
});
};
render() { render() {
const { classes } = this.props;
const { errors } = this.state;
return ( return (
<div> <div>
<img src={logo} className="app-logo" alt="logo" /> <img src={logo} className="app-logo" alt="logo" />
<br/><br/> <br/><br/>
<b>Create your account</b> <b>Create your account</b>
<br/><br/> <br/><br/>
<TextField className="authInput" id="email" name="email" label="Email" /> <form noValidate onSubmit={this.handleSubmit}>
<TextField className="authInput" id="email" name="email" label="Email" helperText={errors.email} error={errors.email ? true : false}
value={this.state.email} onChange={this.handleChange}/>
<br/><br/> <br/><br/>
<TextField className="authInput" id="username" name="username" label="Username" /> <TextField className="authInput" id="username" name="handle" label="Username" helperText={errors.handle} error={errors.handle ? true : false}
value={this.state.handle} onChange={this.handleChange} />
<br/><br/> <br/><br/>
<TextField className="authInput" id="password" name="password" label="Password" /> <TextField className="authInput" id="password" name="password" label="Password" helperText={errors.password} error={errors.password ? true : false}
value={this.state.password} onChange={this.handleChange} />
<br/><br/> <br/><br/>
<TextField className="authInput" id="confirmPassword" name="confirmPassword" label="Confirm Password" /> <TextField className="authInput" id="confirmPassword" name="confirmPassword" label="Confirm Password" helperText={errors.confirmPassword} error={errors.confirmPassword ? true : false}
value={this.state.confirmPassword} onChange={this.handleChange} />
<br/><br/> <br/><br/>
{
errors.general &&
(<div className={classes.customError}>
{errors.general}
</div>)
}
<button class="authButtons register" id="submit">Sign up</button> <button class="authButtons register" id="submit">Sign up</button>
</form>
</div> </div>
); );
} }
} }
Register.propTypes = {
classes: PropTypes.object.isRequired
};
export default Register; export default Register;

View File

@@ -1,40 +1,35 @@
/* eslint-disable */ /* eslint-disable */
import React, { Component } from 'react'; import React, { Component } from 'react';
import PropTypes from 'prop-types'; //import '../App.css';
import StaticProfile from '../components/profile/StaticProfile'; import { makeStyles, styled } from '@material-ui/core/styles';
import Grid from '@material-ui/core/Grid'; import Grid from '@material-ui/core/Grid';
import Card from '@material-ui/core/Card';
import CardMedia from '@material-ui/core/CardMedia';
import CardContent from '@material-ui/core/CardContent';
import PostSkeleton from '../util/PostSkeleton'; const PostCard = styled(Card)({
background: 'linear-gradient(45deg, #1da1f2 90%)',
import { connect } from 'react-redux'; border: 3,
borderRadius: 3,
height:225,
width: 645,
padding: '0 30px',
});
class user extends Component { class user extends Component {
render() { render() {
const postMarkup = PostSkeleton;
return ( return (
<b>User page</b> <div>
// <Grid container spacing={16}> <h1>User Profile</h1>
// <Grid item sm={8} xs={12}> <br/><br/>
// <b>postMarkup</b> <PostCard>Some card and content</PostCard>
// {postMarkup} <br/><br/>
// </Grid> </div>
// {/* <Grid item sm={4} xs={12}>
// <StaticProfile profile={this.state.profile} />
// </Grid> */}
// </Grid>
) )
} }
} }
user.propTypes = {
// getUserData: PropTypes.func.isRequired,
//data: PropTypes.object.isRequired
};
const mapStateToProps = (state) => ({
data: state.data
});
export default connect(user); export default user;

View File

@@ -0,0 +1,97 @@
export default {
palette: {
primary: {
light: '#1da1f2',
main: '#1da1f2',
dark: '#008394',
contrastText: '#fff'
},
secondary: {
light: '#ff6333',
main: '#ff3d00',
dark: '#b22a00',
contrastText: '#fff'
}
},
typography: {
useNextVariants: true
},
form: {
textAlign: 'center'
},
image: {
margin: '20px auto 20px auto'
},
pageTitle: {
margin: '10px auto 10px auto'
},
textField: {
margin: '10px auto 10px auto'
},
button: {
marginTop: 20,
position: 'relative'
},
customError: {
color: 'red',
fontSize: '0.8rem',
marginTop: 10
},
progress: {
position: 'absolute'
},
invisibleSeparator: {
border: 'none',
margin: 4
},
visibleSeparator: {
width: '100%',
borderBottom: '1px solid rgba(0,0,0,0.1)',
marginBottom: 20
},
paper: {
padding: 20
},
profile: {
'& .image-wrapper': {
textAlign: 'center',
position: 'relative',
'& button': {
position: 'absolute',
top: '80%',
left: '70%'
}
},
'& .profile-image': {
width: 200,
height: 200,
objectFit: 'cover',
maxWidth: '100%',
borderRadius: '50%'
},
'& .profile-details': {
textAlign: 'center',
'& span, svg': {
verticalAlign: 'middle'
},
'& a': {
color: '#00bcd4'
}
},
'& hr': {
border: 'none',
margin: '0 0 10px 0'
},
'& svg.button': {
'&:hover': {
cursor: 'pointer'
}
}
},
buttons: {
textAlign: 'center',
'& a': {
margin: '20px 10px'
}
}
};