Compare commits

...

282 Commits

Author SHA1 Message Date
dependabot[bot]
5e8309c57b Bump express from 4.17.1 to 4.18.2 in /twistter-frontend
Bumps [express](https://github.com/expressjs/express) from 4.17.1 to 4.18.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.1...4.18.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-13 16:42:25 +00:00
Clayton Wilson
d1f42aa5cd Update README.md 2022-03-06 11:12:16 -05:00
Clayton Wilson
f118ed76d1 Added screenshots 2022-03-06 10:09:02 -06:00
DreamCoder23
b9cbd610a9 Update README.md 2020-10-11 23:17:34 -07:00
daabbf80f6 Actually fix deploy error 2019-12-06 14:58:51 -05:00
f9acefaafb Fixed deploy error 2019-12-06 14:55:01 -05:00
948eff32c2 Fix 2019-12-06 14:26:42 -05:00
6de219505a Fix admin alert posts displaying 2019-12-06 14:25:05 -05:00
7132a2ab45 Fix error in getOtherUsersPosts 2019-12-06 14:10:17 -05:00
5474543af4 add catch in addSubscription 2019-12-06 13:56:48 -05:00
6f77d03e2d Add back verify button for Admin 2019-12-06 13:51:21 -05:00
da6e7436ea Merge branch 'master' of https://github.com/ClaytonWWilson/CS307-Team24 2019-12-06 13:35:32 -05:00
e7afac9a19 Fix post topics being added to followed topics list 2019-12-06 13:35:28 -05:00
Aditya Sankaran
9449d3544b Merge branch 'master' of https://github.com/ClaytonWWilson/CS307-Team24 2019-12-06 13:06:52 -05:00
4f2e07756d tell the user if they aren't following anybody 2019-12-06 13:04:59 -05:00
Aditya Sankaran
f2cf7542a8 fix 2019-12-06 13:04:43 -05:00
ff7677bfb3 Merge pull request #113 from ClaytonWWilson/admin-delete
Admin delete
2019-12-06 12:56:40 -05:00
978af53a74 Merge pull request #114 from ClaytonWWilson/temp-branch
Display disabled DMs as red and fix errors in login and signup
2019-12-06 12:53:57 -05:00
a0a522f1d2 Display disabled DMs as red and fix errors in login and signup 2019-12-06 12:53:27 -05:00
Aditya Sankaran
988c807af2 Merge branch 'master' of https://github.com/ClaytonWWilson/CS307-Team24 2019-12-06 12:27:00 -05:00
Aditya Sankaran
01b449d01d separated list of topics by comma and space 2019-12-06 12:26:29 -05:00
f30a9ae27c Fix merge errors, but posts are not displaying on home.js 2019-12-06 12:07:36 -05:00
a459e6581e Merge branch 'master' into admin-delete 2019-12-06 11:45:50 -05:00
Leon Liang
b769ab930a Merge pull request #112 from ClaytonWWilson/fix_unfollow
Fix unfollow
2019-12-06 02:28:42 -05:00
Leon Liang
116f97bf64 fixed topic.id bug 2019-12-06 02:26:01 -05:00
Leon Liang
a4efc15d58 allow follow topic only when following user 2019-12-06 02:23:28 -05:00
Leon Liang
39613584e7 fixed unfollow user and topics 2019-12-06 02:17:52 -05:00
a1f9a4bef3 Fixing errors on the otherUsers page 2019-12-05 21:39:38 -05:00
c85eeccd4c Display formatted time on otherUser page 2019-12-05 21:16:46 -05:00
Leon Liang
bb50e0fa5d Merge pull request #111 from ClaytonWWilson/filter_timeli
fixed up add subscription method
2019-12-05 19:25:44 -05:00
Leon Liang
f111553827 fixed up add subscription method 2019-12-05 19:24:50 -05:00
Aditya Sankaran
5e935f3508 Merge branch 'master' of https://github.com/ClaytonWWilson/CS307-Team24 2019-12-05 19:20:50 -05:00
Aditya Sankaran
80a2e1894c sorted posts chronologically everywhere 2019-12-05 19:20:05 -05:00
8acd29e842 Merge branch 'master' of https://github.com/ClaytonWWilson/CS307-Team24 2019-12-05 19:14:47 -05:00
b402c96864 Fixing DMs with users who have them disabled 2019-12-05 19:13:00 -05:00
asankaran35
76792148cd Merge pull request #110 from ClaytonWWilson/chronological
can sort posts chronologically in userline and formatted topics listi…
2019-12-05 18:56:18 -05:00
Aditya Sankaran
a92681451f syntax error 2019-12-05 18:54:43 -05:00
Aditya Sankaran
e3522876d7 can sort posts chronologically in userline and formatted topics listing for each post 2019-12-05 18:50:29 -05:00
Leon Liang
c7859e0f0a Merge pull request #109 from ClaytonWWilson/finalfix
fixed user and topic relationship. allow add topic directly
2019-12-05 17:25:53 -05:00
Leon Liang
aad9dc0273 Merge branch 'master' into finalfix 2019-12-05 17:25:19 -05:00
Leon Liang
30df98343e added user post tuple 2019-12-05 17:22:55 -05:00
719294f0ed Fix DM code layout 2019-12-05 16:13:56 -05:00
fc9994d42e fixed circular progress on home 2019-12-05 13:47:10 -05:00
Leon Liang
de72bd9223 added alert to user's page 2019-12-05 13:45:58 -05:00
b85bee7cba Fix merge issue 2019-12-05 13:41:24 -05:00
76330fd234 Merge pull request #108 from ClaytonWWilson/send-microblog-loading
Send microblog loading
2019-12-05 13:38:53 -05:00
b007666317 Merge branch 'master' into send-microblog-loading 2019-12-05 13:38:04 -05:00
a0d2532c22 Add circular progress to home page 2019-12-05 13:35:19 -05:00
739b1cc92a Add circular progress to other user page 2019-12-05 13:22:29 -05:00
57087a5ea3 Add circular progress to user page 2019-12-05 13:08:59 -05:00
Leon Liang
3424a7d34f Merge pull request #107 from ClaytonWWilson/finalfix
filter by followed user
2019-12-05 13:02:52 -05:00
1aff5ba99b Add circular progress to writing_microblogs 2019-12-05 12:56:05 -05:00
Leon Liang
2bcf6bfcb3 filter by followed user 2019-12-05 12:48:26 -05:00
Danny Voltz
bae2947003 Merge branch 'admin-delete' of https://github.com/ClaytonWWilson/CS307-Team24 into admin-delete:x 2019-12-05 12:25:19 -05:00
Danny Voltz
96423cee8a Admin User Stories 2019-12-05 12:12:25 -05:00
f9a45ffe07 Merge pull request #84 from ClaytonWWilson/dms
Direct Messages
2019-12-04 22:47:50 -05:00
Aditya Sankaran
17c7e989ef cleared modal for quoting when hitting cancel button 2019-12-04 19:37:53 -05:00
Aditya Sankaran
efecf3b02a fixed stuff 2019-12-04 18:48:08 -05:00
Aditya Sankaran
8b4c32b81f syntax error 2019-12-04 18:20:28 -05:00
Aditya Sankaran
323cb5bcee Revert "module fuse and syntax errors fixed"
This reverts commit 4a4733f593.
2019-12-04 18:15:37 -05:00
Aditya Sankaran
4a4733f593 module fuse and syntax errors fixed 2019-12-04 18:09:36 -05:00
asankaran35
35cec7abf3 Merge pull request #106 from ClaytonWWilson/likes
Likes
2019-12-04 17:42:03 -05:00
asankaran35
6989091fb1 Merge branch 'master' into likes 2019-12-04 17:41:28 -05:00
Aditya Sankaran
699ea23750 quoting fix 2019-12-04 17:16:41 -05:00
0bcfdcdd6c Fix deploy error 2019-12-04 17:10:26 -05:00
4e5b100968 Fix merge issues and change layout of NavBar 2019-12-04 16:57:56 -05:00
374c4d45b0 Merge branch 'master' into dms 2019-12-04 15:56:42 -05:00
7efed257f2 Merge pull request #105 from ClaytonWWilson/display-profile-images-on-posts
Posts on Home now display profile images
2019-12-04 15:37:59 -05:00
99ffbe52a4 Posts on Home now display profile images 2019-12-04 15:37:09 -05:00
Aditya Sankaran
856cb8630e readded post.js. got deleted for some reason 2019-12-04 14:42:43 -05:00
0776728e73 Merge pull request #60 from ClaytonWWilson/edit-profile-image-upload
Edit profile image upload
2019-12-04 00:31:07 -05:00
77a3ba9f69 Fix merge issues 2019-12-04 00:30:23 -05:00
7a0a5725b7 Merge branch 'master' into edit-profile-image-upload 2019-12-04 00:02:03 -05:00
79051f2243 Error checking and deleting old profile image 2019-12-03 23:46:04 -05:00
94db3f451d Merge pull request #104 from ClaytonWWilson/fix-warnings
Fix warnings
2019-12-03 20:55:55 -05:00
fd1718a1f4 Fixing more errors 2019-12-03 20:54:54 -05:00
7fd976d4cb Merge branch 'master' into fix-warnings 2019-12-03 20:34:08 -05:00
72d099e05e Fixing errors and warnings 2019-12-03 20:26:31 -05:00
Leon Liang
f3fcd5ee8d Merge pull request #103 from ClaytonWWilson/others_topic
changed color if user is following the same topic
2019-12-03 19:16:17 -05:00
Leon Liang
7141bf9000 changed color if user is following the same topic 2019-12-03 19:15:23 -05:00
ebca5192e0 Change storageBucket to variable 2019-12-03 18:20:20 -05:00
Leon Liang
acecf704dc Merge pull request #102 from ClaytonWWilson/otheruser_posts
display posts on other user's page
2019-12-03 18:14:40 -05:00
Leon Liang
56e836451d display posts on other user's page 2019-12-03 18:11:10 -05:00
1747a29c2e Fix not image not uploading when deployed 2019-12-03 17:47:09 -05:00
041e53c36f Merge pull request #101 from ClaytonWWilson/confirm-delete
Confirm delete
2019-12-03 16:40:00 -05:00
2d426840c0 Add @ next to handle on editProfile 2019-12-03 16:37:57 -05:00
5b5e785142 Changed the path of the editProfile page 2019-12-03 16:37:04 -05:00
a4cce0b75e Circular progress when the editProfile page is loading 2019-12-03 16:26:54 -05:00
825c126c6c Delete asks you to confirm 2019-12-03 16:26:16 -05:00
49a4d55f1e Rename edit class to editProfile to be more descriptive 2019-12-03 14:04:40 -05:00
b4f4dec9ca Merge pull request #93 from ClaytonWWilson/fix-login-loading
Display loading icon when the user logs in or signs up
2019-12-03 13:50:55 -05:00
f0c4a2974f Fix mismatched parenthesis 2019-12-03 13:49:37 -05:00
c26ff21b20 Merge branch 'master' into fix-login-loading 2019-12-03 13:44:12 -05:00
3092fabfd2 Merge pull request #85 from ClaytonWWilson/microblogs-material-ui
Changing Writing_Microblogs to Material-UI and other UI tweaks
2019-12-03 13:35:27 -05:00
1a6aae6545 Fixed mismatched parenthesis 2019-12-03 13:33:48 -05:00
4abaa13b09 Merge branch 'master' into microblogs-material-ui 2019-12-03 13:24:36 -05:00
09a3ccd12d Merge branch 'master' into dms 2019-12-03 13:21:30 -05:00
f7058a520d Merge pull request #99 from ClaytonWWilson/improve-search
Improved speed of search and made it fuzzy search
2019-12-03 13:19:53 -05:00
1a02b53d0f Improved speed of search and made it fuzzy search 2019-12-03 00:54:06 -05:00
e4ea325fb8 Liking posts with Redux and Material UI 2019-12-02 20:18:44 -05:00
Leon Liang
6e32b25861 Merge pull request #98 from ClaytonWWilson/fix_follow
add topics when publish new post
2019-12-02 18:39:09 -05:00
Leon Liang
684ccd1a85 Merge branch 'master' into fix_follow 2019-12-02 18:38:54 -05:00
Leon Liang
f0ddaa30b1 add topics when publish new post 2019-12-02 18:31:33 -05:00
8244631d4d Fix some code after merge 2019-12-02 16:40:22 -05:00
4d97afcb09 Merge branch 'master' into microblogs-material-ui 2019-12-02 16:29:52 -05:00
88064c55a3 Merge branch 'master' into dms 2019-12-02 16:21:26 -05:00
7c7256acbd Fixed having multiple return statements in post.js 2019-12-02 15:47:26 -05:00
cff0fd4e05 DMs are deleted when the delete function runs 2019-12-02 15:46:13 -05:00
Leon Liang
e218708e0a Merge pull request #95 from ClaytonWWilson/fix_follow
Fix follow
2019-12-02 00:08:07 -05:00
Leon Liang
445c8b39de allow delete without refreshing page 2019-12-02 00:00:25 -05:00
Aditya Sankaran
6e8b7f410a saved liked posts 2019-12-01 15:55:53 -05:00
Aditya Sankaran
07a8f0b7bb userline frontend shows quoted posts 2019-11-30 18:23:46 -05:00
Aditya Sankaran
54cd1c44a7 edited userline database function 2019-11-30 18:11:33 -05:00
Aditya Sankaran
ca7f793d4c likeCount updating auto 2019-11-30 16:50:20 -05:00
Aditya Sankaran
a36212c23d quoting mblogs userline 2019-11-30 12:16:30 -05:00
Aditya Sankaran
b83eb0c897 saved states of post for each user 2019-11-29 20:18:51 -05:00
fee2225745 Disable or enable Direct Messages 2019-11-27 23:06:25 -05:00
0d8850c45d Comment out logging in fbAuth.js 2019-11-27 21:53:02 -05:00
f7ef0cb333 Fix DM message content overflowing 2019-11-27 21:52:14 -05:00
731e01c552 Comment out some lines in users.js that were throwing errors 2019-11-27 21:51:16 -05:00
asankaran35
0c9778949a Merge pull request #94 from ClaytonWWilson/engage_microblog
Engage microblog
2019-11-27 21:09:32 -05:00
asankaran35
1a2af4e9bb Merge branch 'master' into engage_microblog 2019-11-27 21:08:55 -05:00
Aditya Sankaran
c34f06f130 formatted feed and userline 2019-11-27 20:57:42 -05:00
3814377817 Display loading icon when the user logs in or signs up 2019-11-25 13:55:03 -05:00
Leon Liang
9fff6ed81c changed status code for follow/unfollow 2019-11-22 18:23:49 -05:00
445687cc54 Automatically display new Direct Messages 2019-11-22 18:21:52 -05:00
331509da7f Direct Messages sending DMs 2019-11-22 16:44:53 -05:00
Leon Liang
64cc9bd156 Merge pull request #91 from ClaytonWWilson/fix_profile
Fix profile
2019-11-21 20:21:24 -05:00
Leon Liang
6a78d74930 simplified backend get/remove topic function 2019-11-21 20:20:54 -05:00
Leon Liang
4e817c9647 integrated backend change, added pointer cursor 2019-11-21 20:09:47 -05:00
Leon Liang
7976110e2b modified function to add/delete topic only from user 2019-11-21 19:59:04 -05:00
Leon Liang
3da2449050 change topic display to user-specific topics 2019-11-21 18:10:44 -05:00
Leon Liang
607ea3fd55 Merge pull request #83 from ClaytonWWilson/edit-profile-linking
Changing profile page layout
2019-11-21 17:58:56 -05:00
Aditya Sankaran
e8110d643f finished quoting microblogs 2019-11-21 15:42:43 -05:00
e06cc614cb Dynamic front-end adding new DM channels 2019-11-20 20:48:49 -05:00
709df1492d Changed how back-end DMs worked 2019-11-20 20:32:11 -05:00
Leon Liang
c3091cc10a Merge pull request #90 from ClaytonWWilson/auto_complete
completed search page and redirect to user profile page
2019-11-19 22:31:52 -05:00
Leon Liang
81749c19ce completed search page and redirect to user profile page 2019-11-19 22:30:15 -05:00
Aditya Sankaran
1ccc195036 liking and unliking work 2019-11-19 21:09:07 -05:00
Leon Liang
0aaa9014b9 Merge pull request #88 from ClaytonWWilson/user_page
User page
2019-11-19 19:22:48 -05:00
3d9266778d Direct Messages can use redux for creating new DM channels 2019-11-19 19:04:25 -05:00
Leon Liang
2de3da928a added UI for follow and unfollow other user 2019-11-19 19:03:28 -05:00
297619cacb Tweaking DM back-end functions 2019-11-19 19:02:13 -05:00
Leon Liang
42c53fdbc4 Add profile image, topics for other user page 2019-11-19 15:56:39 -05:00
Leon Liang
c8aa1fd050 Added page to display other users' profile 2019-11-19 13:57:24 -05:00
a59c2feb4a Fix sorting so empty DM channels go to the bottom of the list 2019-11-19 01:30:00 -05:00
0f1cfe0393 Front-end layout mostly completed 2019-11-19 01:18:20 -05:00
Leon Liang
c6022dbc38 Merge pull request #86 from ClaytonWWilson/subscribe
Added function to follow and unfollow users
2019-11-15 17:49:59 -05:00
Leon Liang
1d26eb97ad Added function to follow and unfollow users 2019-11-15 17:47:47 -05:00
63e917f54c Fixed the sorting of messages 2019-11-15 15:20:39 -05:00
2f5ec1c5ac Basic style for direct messages 2019-11-12 23:50:53 -05:00
19f8f70bf2 Fixing DMList errors 2019-11-08 18:48:00 -05:00
02197ee940 Sending Direct Messages 2019-11-08 17:54:56 -05:00
5507247a7f Create a new DM channel between two users 2019-11-08 11:42:46 -05:00
5560b6e13c Refactor DM enabled checking to make it re-usable 2019-11-06 01:01:50 -05:00
19d78596b5 Check for DMs enabled or disabled 2019-11-05 22:43:29 -05:00
9372a092ad Fix edit profile button link 2019-11-05 17:43:19 -05:00
7a6ac8499c fix merge 2019-11-05 17:38:11 -05:00
6149e15b35 Profile page kinda works on mobile 2019-11-05 17:35:16 -05:00
80670d054e Main layout of profile page 2019-11-05 17:19:28 -05:00
947e5b01a4 Converted tabs back to spaces 2019-11-05 17:16:34 -05:00
7cc8a3f11f Fixing up profile UI 2019-11-05 17:04:33 -05:00
7476833f0a Main layout of profile page 2019-11-05 16:32:16 -05:00
a2ed627f2b Back-end for getting all the DMs for a user 2019-11-04 13:21:47 -05:00
bbbfc4b750 Editprofile move button positions 2019-11-03 21:10:57 -05:00
38df4ef087 Added styles and spaced cards 2019-11-03 15:29:39 -05:00
2bd1c08c2c Writing_Microblogs to Material-UI and UI improvements 2019-11-03 15:17:14 -05:00
Danny Voltz
6924af58a7 progress for admin delete 2019-11-01 15:40:26 -05:00
903ea35662 Fix indents 2019-11-01 16:19:54 -04:00
e644498108 Merge pull request #67 from ClaytonWWilson/verify-profile
Users can be verified and have a check mark displayed on their profiles
2019-11-01 16:11:53 -04:00
97bc9c4fb1 Verify users front-end 2019-11-01 16:11:02 -04:00
Shobhit Makhija
f2dac314e5 Merge pull request #74 from ClaytonWWilson/Beautify
Fixing UI
2019-11-01 15:39:57 -04:00
b01aa92f96 Add post id 2019-11-01 15:39:08 -04:00
shobhitm23
d3bfd8b5f3 Fixing UI 2019-11-01 15:36:22 -04:00
d6876eab0b Fix .then() must return 2019-11-01 14:28:49 -04:00
f4bedea2c7 Merge branch 'master' into verify-profile 2019-11-01 13:40:30 -04:00
d4ea00d2e9 Merge pull request #72 from ClaytonWWilson/fix-delete
Fix delete
2019-11-01 13:26:25 -04:00
acd33d6a96 Merge branch 'master' into fix-delete 2019-11-01 13:26:11 -04:00
3fa4cd7033 Changing writing microblogs to Material-UI 2019-11-01 13:02:37 -04:00
ab07d45205 Fix loading on image upload, so it waits for new image 2019-11-01 10:12:54 -04:00
f1e4362205 Change imageFileName from const to let 2019-11-01 00:37:49 -04:00
1e4b2d16ef Fix edge case 2019-11-01 00:29:22 -04:00
e8e69cec31 Delete removes all data now 2019-11-01 00:26:01 -04:00
Leon Liang
ae89e3d63b Merge pull request #69 from ClaytonWWilson/search_page
added search page
2019-10-31 16:57:38 -04:00
Leon Liang
f60c045483 Merge branch 'master' into search_page 2019-10-31 16:57:22 -04:00
Leon Liang
1842eef2f8 added search page 2019-10-31 16:54:34 -04:00
56323801aa Merge pull request #65 from ClaytonWWilson/auth-backend-3
Auth backend 3
2019-10-31 16:14:22 -04:00
ce984df437 Merge branch 'master' into auth-backend-3 2019-10-31 16:09:17 -04:00
112988c8fb Add '@' to profile handle 2019-10-31 15:46:33 -04:00
325d37f0de Back-end for verifying users 2019-10-31 15:12:22 -04:00
Leon Liang
35e5cf8e9d revert changes that I f ed up 2019-10-31 15:11:16 -04:00
Leon Liang
649b9b4a69 Merge pull request #68 from ClaytonWWilson/delete_topic
Delete topic
2019-10-31 14:44:41 -04:00
Leon Liang
e73b2d02f3 Merge branch 'master' into delete_topic 2019-10-31 14:44:03 -04:00
Leon Liang
50bc73870b delete topic fully works 2019-10-31 14:32:54 -04:00
ca1d86acf1 Users can be verified and have a check mark displayed on their profiles 2019-10-31 13:56:40 -04:00
Aaron Sun
da14700987 Fixed a small bug with the Delete Account button 2019-10-30 18:15:01 -04:00
Aaron Sun
26afabe709 All posts from db can now show on home page timeline 2019-10-30 18:04:35 -04:00
Aaron Sun
a61c296ddf Made the posts look prettier 2019-10-30 16:12:53 -04:00
Aaron Sun
1337071bec UI can now display all features of a post 2019-10-30 15:07:19 -04:00
Aaron Sun
cd19364efc Can now display post body on profile page 2019-10-30 11:40:44 -04:00
3c31db9bf5 Converted tabs back to spaces 2019-10-29 23:02:36 -04:00
Aaron Sun
8438ce27cf Get user's posts works now 2019-10-29 22:25:38 -04:00
Aaron Sun
6db14e3868 Improved the profile page format 2019-10-29 19:39:11 -04:00
c96c77cd9f Debugging upload issues 2019-10-29 15:00:21 -04:00
DreamCoder23
16567e2373 Merge pull request #63 from ClaytonWWilson/auth-backend-3
Auth backend 3
2019-10-29 14:40:02 -04:00
Aaron Sun
d3a77afe43 Pulled and merged the latest code from master 2019-10-29 14:02:56 -04:00
fb6c1e3d98 Image upload edit some return messages 2019-10-29 12:40:38 -04:00
Aaron Sun
42b73632c0 Delete user's posts fully works now 2019-10-29 10:34:09 -04:00
3d875e2bde Fixing up profile UI 2019-10-28 23:25:12 -04:00
Leon Liang
b20408c144 delete topic 2019-10-28 21:38:32 -04:00
Aaron Sun
c482f56762 Invalid credential message displays after non-exisitng email is passed in 2019-10-28 20:14:38 -04:00
Aaron Sun
9525ff7d0a Delete post works in Postman but not in actual database 2019-10-28 17:57:03 -04:00
Shobhit Makhija
f602b8251f Merge pull request #61 from ClaytonWWilson/filteredPosts
Arrow-callback warning
2019-10-28 01:34:43 -04:00
shobhitm23
70a12dcca4 Arrow-callback warning 2019-10-28 00:21:29 -04:00
3001ec0b38 Merge branch 'master' into edit-profile-image-upload 2019-10-27 23:46:15 -04:00
e8a403f575 Delete old profile image 2019-10-27 23:43:35 -04:00
Aaron Sun
657277bcad Username and user id now show in post data 2019-10-27 23:11:24 -04:00
Aaron Sun
d69828ef7f Merge branch 'master' of https://github.com/ClaytonWWilson/CS307-Team24 into auth-backend-3 2019-10-27 20:48:15 -04:00
44d3450b10 Profile image upload frontend and backend finished 2019-10-27 18:06:47 -04:00
Aaron Sun
5fa4caf0a3 Log in with username fully works now 2019-10-27 17:47:04 -04:00
Aaron Sun
fd226b454e Delete users fully works now 2019-10-27 14:46:31 -04:00
Leon Liang
97998a8f09 merge changes 2019-10-27 13:24:53 -04:00
Leon Liang
13a1401759 Reformat code 2019-10-27 02:53:12 -04:00
Leon Liang
0bbc453d54 Merge pull request #55 from ClaytonWWilson/delete_topic
Delete topic
2019-10-27 00:10:56 -04:00
Leon Liang
e236ceeb4b Merge branch 'master' into delete_topic 2019-10-27 00:10:38 -04:00
Leon Liang
1c81ae1663 show user's profile image 2019-10-27 00:09:17 -04:00
Leon Liang
c356dd18fa added UI allowing topic creation 2019-10-27 00:08:38 -04:00
Aditya Sankaran
19780a1395 made userline not hardcoded 2019-10-26 17:06:42 -04:00
Aditya Sankaran
981795b288 writing microblogs not hardcoded anymore 2019-10-26 16:57:25 -04:00
Leon Liang
ec041732d9 reformat 2019-10-25 23:14:25 -04:00
Leon Liang
eb3766edb2 Merge pull request #54 from ClaytonWWilson/delete_topic
added function to delete topic
2019-10-25 23:13:27 -04:00
Leon Liang
d9f6fb5d8e added function to delete topic 2019-10-25 23:04:09 -04:00
b31a571b29 Add followedTopics array on signup 2019-10-25 19:27:45 -04:00
60f83da514 Merge pull request #47 from ClaytonWWilson/block_topics
Fix login page loop bug
2019-10-25 15:31:12 -04:00
41bcc78c3a Fix login page loop bug 2019-10-25 15:20:10 -04:00
f82f9984c6 Comment out axios.defaults.baseUrl 2019-10-25 14:33:23 -04:00
Aditya Sankaran
6335690046 Merge branch 'master' of https://github.com/ClaytonWWilson/CS307-Team24 2019-10-25 13:15:53 -04:00
Aditya Sankaran
9d1f987ac1 added userID property for posts 2019-10-25 13:15:17 -04:00
Leon Liang
b255006f7a Merge pull request #45 from ClaytonWWilson/display_topic
Display topic
2019-10-25 01:57:14 -04:00
Leon Liang
f13580c727 display topics under profile 2019-10-25 01:56:07 -04:00
Leon Liang
4ec560de75 made logo background transparent 2019-10-25 00:00:43 -04:00
Leon Liang
65ac1c7384 Merge pull request #43 from ClaytonWWilson/add_topic_user
created functions retrieving all topics
2019-10-24 23:13:39 -04:00
Leon Liang
340d3537a6 created functions retrieving all topics 2019-10-24 23:13:03 -04:00
Leon Liang
de44f1eb89 Merge branch 'master' of github.com:ClaytonWWilson/CS307-Team24 2019-10-24 22:43:32 -04:00
Leon Liang
5405d96150 created function to add topic 2019-10-24 22:42:46 -04:00
0e6af081fa Merge pull request #42 from ClaytonWWilson/update-navbar
Update navbar
2019-10-24 22:41:04 -04:00
Clayton Wilson
021e25de86 Make NavBar display login/signup/logout correctly 2019-10-24 22:38:42 -04:00
Leon Liang
de38339cad Merge pull request #39 from ClaytonWWilson/profile_display
Profile display: able to see from /user
2019-10-24 22:12:27 -04:00
Leon Liang
a498b4748f Merge branch 'master' into profile_display 2019-10-24 22:12:02 -04:00
Leon Liang
4200c05ca1 added profile display 2019-10-24 22:08:49 -04:00
Leon Liang
6e9a86e5ce changed getUser 2019-10-24 22:08:28 -04:00
Leon Liang
97650f6539 added axios baseURL 2019-10-24 22:08:09 -04:00
Leon Liang
4aa029c649 modified getUserDetails 2019-10-24 19:34:31 -04:00
1b3ac4d05a Merge pull request #35 from ClaytonWWilson/edit-profile-fix
Fixing editProfile bugs and making the database storage more efficient
2019-10-24 19:32:05 -04:00
64c10cd172 Rename variable to make code more concise 2019-10-24 19:30:21 -04:00
Leon Liang
37cce6c828 deleted profile.js 2019-10-24 17:48:39 -04:00
Leon Liang
bcaf0920a6 deleted staticProfile 2019-10-24 17:45:41 -04:00
Leon Liang
b16c3eb50f Merge pull request #33 from ClaytonWWilson/auth-backend-3
Auth backend 3
2019-10-24 17:09:58 -04:00
Leon Liang
79d23af3fc Merge branch 'master' into auth-backend-3 2019-10-24 17:09:45 -04:00
Leon Liang
52bd8eed64 Merge branch 'master' of github.com:ClaytonWWilson/CS307-Team24 2019-10-24 17:07:29 -04:00
Leon Liang
ac28b3e19e getUserDetails is now working 2019-10-24 17:06:44 -04:00
Leon Liang
570866ff40 getUserDetail returns only user handle 2019-10-24 16:27:22 -04:00
Leon Liang
bdad36957c package lock 2019-10-24 16:25:29 -04:00
Leon Liang
e524bc2811 pass in fbAuth to getUserDetails 2019-10-24 16:25:19 -04:00
Leon Liang
714e6a4e07 new adminsdk 2019-10-24 16:24:56 -04:00
Leon Liang
cdbf0fcdc6 renew adminsdk 2019-10-24 16:24:33 -04:00
Clayton Wilson
8f5020f881 Fixing editProfile bugs and making the database storage more efficient 2019-10-24 15:44:53 -04:00
Aaron Sun
eea2f56b49 Code for removing user from db still in progress (commented out) 2019-10-24 15:27:20 -04:00
de4018a6d2 Merge pull request #34 from ClaytonWWilson/edit-profile-fix
Update fbAuth so the user data from firebase is stored in req.userData
2019-10-24 13:23:03 -04:00
Clayton Wilson
b17fb1f3f0 Update fbAuth so the user data from firebase is stored in req.userData 2019-10-23 23:16:43 -04:00
Aaron Sun
45f88861c8 Delete Account works on the UI now 2019-10-23 18:08:42 -04:00
Aaron Sun
ad853923c8 Delete Account on UI can log the user out 2019-10-23 17:18:52 -04:00
Aaron Sun
bc0b2549b4 Delete user backend code works 2019-10-22 20:45:48 -04:00
Leon Liang
e984afff74 modified profile.js 2019-10-22 18:26:21 -04:00
Aaron Sun
1b66f18dd5 Log in with username partially works 2019-10-22 16:50:38 -04:00
Leon Liang
dede04aa8e added dependency 2019-10-22 15:08:38 -04:00
Leon Liang
bb0343ab30 Remove redundant profile 2019-10-22 15:08:07 -04:00
Aaron Sun
7b8e40c7b0 Merge branch 'master' of https://github.com/ClaytonWWilson/CS307-Team24 2019-10-22 14:33:46 -04:00
c5942a6634 Merge pull request #31 from ClaytonWWilson/login-frontend
Comment out extra /user path declaration
2019-10-22 13:57:05 -04:00
e062ffbb41 Comment out extra /user path declaration 2019-10-22 13:17:43 -04:00
Aaron Sun
cb4885cadf Switched proxy back to cloud 2019-10-20 21:49:21 -04:00
Aaron Sun
d2032eef75 Login with username works now 2019-10-20 21:45:24 -04:00
48 changed files with 5943 additions and 892 deletions

View File

@@ -1,2 +1,14 @@
# CS307-Team24 # CS307-Team24
CS307 Team 24 Twistter website. CS307 Team 24 Twistter website
### Images
<p>
<img alt="00.png" src="./screenshots/00.png" width="1000">
<img alt="01.png" src="./screenshots/01.png" width="1000">
<img alt="02.png" src="./screenshots/02.png" width="1000">
<img alt="03.png" src="./screenshots/03.png" width="1000">
<img alt="04.png" src="./screenshots/04.png" width="1000">
<img alt="05.png" src="./screenshots/05.png" width="1000">
<img alt="06.png" src="./screenshots/06.png" width="1000">
<img alt="07.png" src="./screenshots/07.png" width="1000">
</p>

View File

@@ -1,43 +1,543 @@
/* eslint-disable prefer-arrow-callback */
/* eslint-disable promise/always-return */ /* eslint-disable promise/always-return */
const admin = require('firebase-admin'); const { admin, db } = require("../util/admin");
exports.putPost = (req, res) => {
exports.putPost = (req, res) => {
const newPost = { const newPost = {
body: req.body.body, body: req.body.body,
userHandle: req.body.userHandle, userHandle: req.user.handle,
userImage: req.body.userImage, userImage: req.body.userImage,
userID: req.user.uid,
microBlogTitle: req.body.microBlogTitle, microBlogTitle: req.body.microBlogTitle,
createdAt: new Date().toISOString(), createdAt: new Date().toISOString(),
likeCount: 0, likeCount: 0,
commentCount: 0, commentCount: 0,
microBlogTopics: req.body.microBlogTopics microBlogTopics: req.body.microBlogTopics,
quoteBody: null
}; };
admin.firestore().collection('posts').add(newPost) admin
.then((doc) => { .firestore()
.collection("posts")
.add(newPost)
.then(doc => {
doc.update({ postId: doc.id });
const resPost = newPost; const resPost = newPost;
resPost.postId = doc.id; resPost.postId = doc.id;
return res.status(200).json(resPost); return res.status(200).json(resPost);
}) })
.catch((err) => { .catch(err => {
console.error(err); console.error(err);
return res.status(500).json({ error: 'something is wrong'}); return res.status(500).json({ error: "something went wrong" });
}); });
}; };
exports.getallPostsforUser = (req, res) => { exports.deletePost = (req, res) => {
let posts = db.collection("posts")
.where("userHandle", "==", req.user.handle)
.get()
.then((query) => {
query.forEach((snap) => {
snap.ref.delete();
});
return;
})
};
admin.firestore().collection('posts').where('userHandle', '==', 'new user' ).get() exports.getallPostsforUser = (req, res) => {
.then((data) => { var post_query = admin
.firestore()
.collection("posts")
.where("userHandle", "==", req.user.handle);
post_query
.get()
.then(function(myPosts) {
let posts = []; let posts = [];
data.forEach(function(doc) { myPosts.forEach(function(doc) {
posts.push(doc.data()); posts.push(doc.data());
}); });
posts.sort((a, b) => -a.createdAt.localeCompare(b.createdAt));
return res.status(200).json(posts); return res.status(200).json(posts);
}) })
.catch((err) => {
console.error(err); .then(function() {
return res.status(500).json({error: 'Failed to fetch all posts written by specific user.'}) return res
.status(200)
.json("Successfully retrieved all user's posts from database.");
}) })
.catch(function(err) {
return res
.status(500)
.json({message: "Failed to retrieve user's posts from database.", error: err});
});
};
exports.hidePost = (req, res) => {
/* db
.collection("posts")
.doc(${req.params.postId}) */
const postId = req.body.postId;
db.doc(`/posts/${postId}`)
.update({
hidden: true
})
.then(() => {
return res.status(200).json({message: "ok"});
})
.catch((error) => {
return res.status(500).json(error);
})
};
exports.getallPosts = (req, res) => {
let posts = [];
let users = {};
// Get all the posts
var postsPromise = new Promise((resolve, reject) => {
db.collection("posts")
.get()
.then(allPosts => {
allPosts.forEach(post => {
posts.push(post.data());
});
posts.sort((a, b) => -a.createdAt.localeCompare(b.createdAt));
resolve();
})
.catch(error => {
reject(error);
});
});
// Get all users
var usersPromise = new Promise((resolve, reject) => {
db.collection("users")
.get()
.then(allUsers => {
allUsers.forEach(user => {
users[user.data().handle] = user.data();
});
resolve();
})
.catch(error => {
reject(error);
});
});
// Wait for the two promises
Promise.all([postsPromise, usersPromise])
.then(() => {
let newPosts = [];
// Add the image url of the person who made the post to all of the post objects
posts.forEach(post => {
post.profileImage = users[post.userHandle].imageUrl
? users[post.userHandle].imageUrl
: null;
newPosts.push(post);
});
return res.status(200).json(newPosts);
})
.catch(error => {
return res.status(500).json({ error });
});
};
exports.getAlert = (req, res) => {
var post_query = admin
.firestore()
.collection("posts")
.where("microBlogTitle", "==", "Alert");
post_query
.get()
.then(function(myPosts) {
let posts = [];
myPosts.forEach(function(doc) {
posts.push(doc.data());
});
posts.sort((a, b) => -a.createdAt.localeCompare(b.createdAt));
return res.status(200).json(posts);
})
.then(function() {
return res
.status(200)
.json("Successfully retrieved all user's posts from database.");
})
.catch(function(err) {
return res
.status(500)
.json("Failed to retrieve user's posts from database.", err);
});
};
exports.getOtherUsersPosts = (req, res) => {
var post_query = admin
.firestore()
.collection("posts")
.where("userHandle", "==", req.body.handle);
// post_query += admin
// .firestore()
// .collection("posts")
// .where("microBlogTitle", "==", "Alert").where("userHandle", "==", "Admin");
post_query
.get()
.then(function(myPosts) {
let posts = [];
myPosts.forEach(function(doc) {
posts.push(doc.data());
});
posts.sort((a, b) => -a.createdAt.localeCompare(b.createdAt));
return res.status(200).json(posts);
})
.then(function() {
return res
.status(200)
.json("Successfully retrieved all user's posts from database.");
})
.catch(function(err) {
return res
.status(500)
.json("Failed to retrieve user's posts from database.", err);
});
};
exports.quoteWithPost = (req, res) => {
let quoteData;
const quoteDoc = admin
.firestore()
.collection("quote")
.where("userHandle", "==", req.user.handle)
.where("quoteId", "==", req.params.postId)
.limit(1);
const postDoc = db.doc(`/posts/${req.params.postId}`);
postDoc
.get()
.then(doc => {
if (doc.exists) {
quoteData = doc.data();
return quoteDoc.get();
} else {
return res.status(404).json({ error: "Post not found" });
} }
})
.then(data => {
if (data.empty) {
return admin
.firestore()
.collection("quote")
.add({
quoteId: req.params.postId,
userHandle: req.user.handle,
quoteBody: req.body.quoteBody
})
.then(() => {
const post = {
body: quoteData.body,
userHandle: req.user.handle,
quoteBody: req.body.quoteBody,
createdAt: new Date().toISOString(),
userImage: req.body.userImage,
likeCount: 0,
commentCount: 0,
userID: req.user.uid,
microBlogTitle: quoteData.microBlogTitle,
microBlogTopics: quoteData.microBlogTopics,
quoteId: req.params.postId
};
return admin
.firestore()
.collection("posts")
.add(post)
.then(doc => {
doc.update({ postId: doc.id });
const resPost = post;
resPost.postId = doc.id;
return res.status(200).json(resPost);
});
});
} else {
return res.status(400).json({ error: "Post has already been quoted." });
}
})
.catch(err => {
return res.status(500).json({ error: err });
});
};
exports.quoteWithoutPost = (req, res) => {
let quoteData;
const quoteDoc = admin
.firestore()
.collection("quote")
.where("userHandle", "==", req.user.handle)
.where("quoteId", "==", req.params.postId)
.limit(1);
const postDoc = db.doc(`/posts/${req.params.postId}`);
postDoc
.get()
.then(doc => {
if (doc.exists) {
quoteData = doc.data();
return quoteDoc.get();
} else {
return res.status(404).json({ error: "Post not found" });
}
})
.then(data => {
if (data.empty) {
return admin
.firestore()
.collection("quote")
.add({
quoteId: req.params.postId,
userHandle: req.user.handle,
quoteBody: null
})
.then(() => {
const post = {
userHandle: req.user.handle,
body: quoteData.body,
quoteBody: null,
createdAt: new Date().toISOString(),
likeCount: 0,
commentCount: 0,
userID: req.user.uid,
userImage: req.body.userImage,
microBlogTitle: quoteData.microBlogTitle,
microBlogTopics: quoteData.microBlogTopics,
quoteId: req.params.postId
};
return admin
.firestore()
.collection("posts")
.add(post)
.then(doc => {
doc.update({ postId: doc.id });
const resPost = post;
resPost.postId = doc.id;
return res.status(200).json(resPost);
});
});
} else {
return res.status(400).json({ error: "Post has already been quoted." });
}
})
.catch(err => {
// return res.status(500).json({ error: "Something is wrong" });
return res.status(500).json({ error: err });
});
};
exports.checkforLikePost = (req, res) => {
const likedPostDoc = admin
.firestore()
.collection("likes")
.where("userHandle", "==", req.user.handle)
.where("postId", "==", req.params.postId)
.limit(1);
let result;
likedPostDoc
.get()
.then(data => {
if (data.empty) {
result = false;
return res.status(200).json(result);
} else {
result = true;
return res.status(200).json(result);
}
})
.catch(err => {
console.log(err);
return res.status(500).json({ error: err });
});
};
exports.likePost = (req, res) => {
const postId = req.params.postId;
let likedPostDoc;
db.doc(`/users/${req.userData.handle}`)
.get()
.then(userDoc => {
let likes = userDoc.data().likes;
if (likes === undefined || likes === null) {
likes = [];
}
if (likes.includes(postId)) {
return res
.status(400)
.json({ error: "This user has already liked this post" });
}
likes.push(postId);
return userDoc.ref.update({ likes });
})
.then(() => {
return db.doc(`/posts/${postId}`).get();
})
.then(postDoc => {
let postData = postDoc.data();
postData.likeCount++;
likedPostDoc = postData;
return postDoc.ref.update({ likeCount: postData.likeCount });
})
.then(() => {
return res.status(201).json(likedPostDoc);
})
.catch(err => {
console.log(err);
return res.status(500).json({ error: err });
});
// let postData;
// const likeDoc = admin.firestore().collection('likes').where('userHandle', '==', req.user.handle)
// .where('postId', '==', req.params.postId).limit(1);
// const postDoc = db.doc(`/posts/${req.params.postId}`);
// postDoc.get()
// .then((doc) => {
// if(doc.exists) {
// postData = doc.data();
// return likeDoc.get();
// }
// else
// {
// return res.status(404).json({error: 'Post not found'});
// }
// })
// .then((data) => {
// if (data.empty) {
// return admin.firestore().collection('likes').add({
// postId : req.params.postId,
// userHandle: req.user.handle
// })
// .then(() => {
// postData.likeCount++;
// return postDoc.update({likeCount : postData.likeCount})
// })
// .then(() => {
// return res.status(200).json(postData);
// })
// }
// })
// .catch((err) => {
// return res.status(500).json({error: 'Something is wrong'});
// })
};
exports.unlikePost = (req, res) => {
const postId = req.params.postId;
let likedPostDoc;
db.doc(`/users/${req.userData.handle}`)
.get()
.then(userDoc => {
let likes = userDoc.data().likes;
if (likes === undefined || likes === null) {
likes = [];
}
if (!likes.includes(postId)) {
return res
.status(400)
.json({ error: "This user hasn't liked this post yet" });
}
let i;
for (i = 0; i < likes.length; i++) {
if (likes[i] === postId) {
likes.splice(i, 1);
}
}
return userDoc.ref.update({ likes });
})
.then(() => {
return db.doc(`/posts/${postId}`).get();
})
.then(postDoc => {
let postData = postDoc.data();
postData.likeCount--;
likedPostDoc = postData;
return postDoc.ref.update({ likeCount: postData.likeCount });
})
.then(() => {
return res.status(201).json(likedPostDoc);
})
.catch(err => {
console.log(err);
return res.status(500).json({ error: err });
});
// let postData;
// const likeDoc = admin.firestore().collection('likes').where('userHandle', '==', req.user.handle)
// .where('postId', '==', req.params.postId).limit(1);
// const postDoc = db.doc(`/posts/${req.params.postId}`);
// postDoc.get()
// .then((doc) => {
// if(doc.exists) {
// postData = doc.data();
// return likeDoc.get();
// }
// else
// {
// return res.status(404).json({error: 'Post not found'});
// }
// })
// .then((data) => {
// return db
// .doc(`/likes/${data.docs[0].id}`)
// .delete()
// .then(() => {
// postData.likeCount--;
// return postDoc.update({ likeCount: postData.likeCount });
// })
// .then(() => {
// res.status(200).json(postData);
// });
// })
// .catch((err) => {
// console.error(err);
// return res.status(500).json({error: 'Something is wrong'});
// })
};
exports.getLikes = (req, res) => {
db.doc(`/users/${req.userData.handle}`)
.get()
.then(doc => {
let likes = doc.data().likes;
if (likes === undefined || likes === null) {
likes = [];
}
return res.status(200).json({ likes });
})
.catch(err => {
console.log(err);
return res.status(500).json({ error: err });
});
};
exports.getFilteredPosts = (req, res) => {
admin
.firestore()
.collection("posts")
.where("userHandle", "==", "new user")
.where("microBlogTopics", "==");
};

128
functions/handlers/topic.js Normal file
View File

@@ -0,0 +1,128 @@
const { admin, db } = require("../util/admin");
exports.putTopic = (req, res) => {
let new_following = [];
let userRef = db.doc(`/users/${req.userData.handle}`);
userRef
.get()
.then(doc => {
new_following = doc.data().followedTopics;
new_following.push(req.body.following);
// add stuff
userRef
.set({ followedTopics: new_following }, { merge: true })
.then(doc => {
return res
.status(201)
.json({ message: `Following ${req.body.following}` });
})
.catch(err => {
return res.status(500).json({ err });
});
return res.status(200).json({ message: "OK" });
})
.catch(err => {
return res.status(500).json({ err });
});
};
exports.putNewTopic = (req, res) => {
let new_following = [];
let userRef = db.doc(`/users/${req.userData.handle}`);
userRef
.get()
.then(doc => {
let topics = [];
new_following = doc.data().following;
// new_following.push(req.body.following);
new_following.forEach(follow => {
if (follow.handle === req.body.handle) {
// topics = follow.topics;
follow.topics.push(req.body.topic);
}
});
// return res.status(201).json({ new_following });
// add stuff
userRef
.set({ following: new_following }, { merge: true })
.then(doc => {
return res
.status(201)
.json({ message: `Following ${req.body.topic}` });
})
.catch(err => {
return res.status(500).json({ err });
});
return res.status(200).json({ message: "OK" });
})
.catch(err => {
return res.status(500).json({ err });
});
};
exports.getAllTopics = (req, res) => {
admin
.firestore()
.collection("topics")
.get()
.then(data => {
let topics = [];
data.forEach(function(doc) {
topics.push({
topic: doc.data().topic,
id: doc.id
});
});
return res.status(200).json(topics);
})
.catch(err => {
console.error(err);
return res.status(500).json({ error: "Failed to fetch all topics." });
});
};
exports.deleteTopic = (req, res) => {
let new_following = [];
let userRef = db.doc(`/users/${req.userData.handle}`);
userRef
.get()
.then(doc => {
new_following = doc.data().followedTopics;
// remove username from array
new_following.forEach(function(follower, index) {
if (follower === `${req.body.unfollow}`) {
new_following.splice(index, 1);
}
});
// update database
userRef
.set({ followedTopics: new_following }, { merge: true })
.then(doc => {
return res
.status(202)
.json({ message: `Successfully unfollow ${req.body.unfollow}` });
})
.catch(err => {
return res.status(500).json({ err });
});
return res.status(200).json({ message: "ok" });
})
.catch(err => {
return res.status(500).json({ err });
});
};
exports.getUserTopics = (req, res) => {
let data = [];
db.doc(`/users/${req.body.handle}`)
.get()
.then(doc => {
data = doc.data().followedTopics;
return res.status(200).json({ data });
})
.catch(err => {
return res.status(500).json({ err });
});
};

File diff suppressed because it is too large Load Diff

View File

@@ -11,11 +11,25 @@ app.use(cors());
*------------------------------------------------------------------*/ *------------------------------------------------------------------*/
const { const {
getAuthenticatedUser, getAuthenticatedUser,
getDirectMessages,
sendDirectMessage,
createDirectMessage,
checkDirectMessagesEnabled,
toggleDirectMessages,
getAllHandles,
getUserDetails, getUserDetails,
getProfileInfo, getProfileInfo,
login, login,
signup, signup,
updateProfileInfo deleteUser,
updateProfileInfo,
uploadProfileImage,
verifyUser,
unverifyUser,
getUserHandles,
addSubscription,
getSubs,
removeSub
} = require("./handlers/users"); } = require("./handlers/users");
// Adds a user to the database and registers them in firebase with // Adds a user to the database and registers them in firebase with
@@ -27,7 +41,31 @@ app.post("/signup", signup);
// and password // and password
app.post("/login", login); app.post("/login", login);
app.get("/getUser/:handle", getUserDetails); //Deletes user account
app.delete("/delete", fbAuth, deleteUser);
// Returns all direct messages that the user is participating in
app.get("/dms", fbAuth, getDirectMessages);
// Send a message in a DM from one user to another
app.post("/dms/send", fbAuth, sendDirectMessage);
// Create a new DM between two users
app.post("/dms/new", fbAuth, createDirectMessage);
// Checks if the user provided has DMs enabled or not
app.post("/dms/enabled", checkDirectMessagesEnabled);
// Used to toggle DMs on or off for the current user
app.post("/dms/toggle", fbAuth, toggleDirectMessages);
app.get("/getUser", fbAuth, getUserDetails);
app.post("/getUserDetails", fbAuth, getUserDetails);
// Returns a list of all usernames
// Used for searching
app.get("/getAllHandles", fbAuth, getAllHandles);
// Returns all profile data of the currently logged in user // Returns all profile data of the currently logged in user
app.get("/getProfileInfo", fbAuth, getProfileInfo); app.get("/getProfileInfo", fbAuth, getProfileInfo);
@@ -35,16 +73,98 @@ app.get("/getProfileInfo", fbAuth, getProfileInfo);
// Updates the currently logged in user's profile information // Updates the currently logged in user's profile information
app.post("/updateProfileInfo", fbAuth, updateProfileInfo); app.post("/updateProfileInfo", fbAuth, updateProfileInfo);
// Returns all user data for the logged in user.
// Used when setting the state in Redux.
app.get("/user", fbAuth, getAuthenticatedUser); app.get("/user", fbAuth, getAuthenticatedUser);
// Uploads a profile image
app.post("/user/image", fbAuth, uploadProfileImage);
// Verifies the user sent to the request
// Must be run by the Admin user
app.post("/verifyUser", fbAuth, verifyUser);
// Unverifies the user sent to the request
// Must be run by admin
app.post("/unverifyUser", fbAuth, unverifyUser);
// get user handles with search phase
app.post("/getUserHandles", fbAuth, getUserHandles);
// get user's subscription
app.get("/getSubs", fbAuth, getSubs);
// add user to another user's "following" data field
app.post("/addSubscription", fbAuth, addSubscription);
// remove one subscription
app.post("/removeSub", fbAuth, removeSub);
/*------------------------------------------------------------------* /*------------------------------------------------------------------*
* handlers/post.js * * handlers/post.js *
*------------------------------------------------------------------*/ *------------------------------------------------------------------*/
const { getallPostsforUser, putPost } = require("./handlers/post");
app.get("/getallPostsforUser", getallPostsforUser);
const {
getallPostsforUser,
getallPosts,
putPost,
hidePost,
likePost,
unlikePost,
getLikes,
quoteWithPost,
quoteWithoutPost,
checkforLikePost,
getOtherUsersPosts,
getAlert
} = require("./handlers/post");
app.get("/getallPostsforUser", fbAuth, getallPostsforUser);
app.get("/getallPosts", getallPosts);
//Hides Post
app.post("/hidePost", fbAuth, hidePost);
// Adds one post to the database // Adds one post to the database
app.post("/putPost", fbAuth, putPost); app.post("/putPost", fbAuth, putPost);
app.get("/likes", fbAuth, getLikes);
app.get("/like/:postId", fbAuth, likePost);
app.get("/unlike/:postId", fbAuth, unlikePost);
app.get("/checkforLikePost/:postId", fbAuth, checkforLikePost);
app.post("/quoteWithPost/:postId", fbAuth, quoteWithPost);
app.post("/quoteWithoutPost/:postId", fbAuth, quoteWithoutPost);
app.post("/getOtherUsersPosts", fbAuth, getOtherUsersPosts);
app.get("/getAlert", fbAuth, getAlert);
/*------------------------------------------------------------------*
* handlers/topic.js *
*------------------------------------------------------------------*/
const {
putTopic,
getAllTopics,
deleteTopic,
getUserTopics,
putNewTopic
} = require("./handlers/topic");
// add topic to database
app.post("/putTopic", fbAuth, putTopic);
// get all topics from database
app.get("/getAllTopics", fbAuth, getAllTopics);
// delete a specific topic
app.post("/deleteTopic", fbAuth, deleteTopic);
// get topic for this user
app.post("/getUserTopics", fbAuth, getUserTopics);
app.post("/putNewTopic", fbAuth, putNewTopic);
exports.api = functions.https.onRequest(app); exports.api = functions.https.onRequest(app);

View File

@@ -34,21 +34,6 @@
"dom-storage": "2.1.0", "dom-storage": "2.1.0",
"tslib": "1.10.0", "tslib": "1.10.0",
"xmlhttprequest": "1.8.0" "xmlhttprequest": "1.8.0"
},
"dependencies": {
"@firebase/logger": {
"version": "0.1.25",
"resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.1.25.tgz",
"integrity": "sha512-/lRhuepVcCCnQ2jcO5Hr08SYdmZDTQU9fdPdzg+qXJ9k/QnIrD2RbswXQcL6mmae3uPpX7fFXQAoScJ9pzp50w=="
},
"@firebase/util": {
"version": "0.2.28",
"resolved": "https://registry.npmjs.org/@firebase/util/-/util-0.2.28.tgz",
"integrity": "sha512-ZQMAWtXj8y5kvB6izs0aTM/jG+WO8HpqhXA/EwD6LckJ+1P5LnAhaLZt1zR4HpuCE+jeP5I32Id5RJ/aifFs6A==",
"requires": {
"tslib": "1.10.0"
}
}
} }
}, },
"@firebase/app-types": { "@firebase/app-types": {
@@ -70,15 +55,9 @@
"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",
@@ -113,11 +92,7 @@
"@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",
@@ -126,21 +101,6 @@
"@grpc/proto-loader": "^0.5.0", "@grpc/proto-loader": "^0.5.0",
"grpc": "1.23.3", "grpc": "1.23.3",
"tslib": "1.10.0" "tslib": "1.10.0"
},
"dependencies": {
"@firebase/logger": {
"version": "0.1.25",
"resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.1.25.tgz",
"integrity": "sha512-/lRhuepVcCCnQ2jcO5Hr08SYdmZDTQU9fdPdzg+qXJ9k/QnIrD2RbswXQcL6mmae3uPpX7fFXQAoScJ9pzp50w=="
},
"@firebase/util": {
"version": "0.2.28",
"resolved": "https://registry.npmjs.org/@firebase/util/-/util-0.2.28.tgz",
"integrity": "sha512-ZQMAWtXj8y5kvB6izs0aTM/jG+WO8HpqhXA/EwD6LckJ+1P5LnAhaLZt1zR4HpuCE+jeP5I32Id5RJ/aifFs6A==",
"requires": {
"tslib": "1.10.0"
}
}
} }
}, },
"@firebase/firestore-types": { "@firebase/firestore-types": {
@@ -173,16 +133,6 @@
"@firebase/util": "0.2.28", "@firebase/util": "0.2.28",
"idb": "3.0.2", "idb": "3.0.2",
"tslib": "1.10.0" "tslib": "1.10.0"
},
"dependencies": {
"@firebase/util": {
"version": "0.2.28",
"resolved": "https://registry.npmjs.org/@firebase/util/-/util-0.2.28.tgz",
"integrity": "sha512-ZQMAWtXj8y5kvB6izs0aTM/jG+WO8HpqhXA/EwD6LckJ+1P5LnAhaLZt1zR4HpuCE+jeP5I32Id5RJ/aifFs6A==",
"requires": {
"tslib": "1.10.0"
}
}
} }
}, },
"@firebase/installations-types": { "@firebase/installations-types": {
@@ -190,6 +140,11 @@
"resolved": "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.1.2.tgz", "resolved": "https://registry.npmjs.org/@firebase/installations-types/-/installations-types-0.1.2.tgz",
"integrity": "sha512-fQaWIW8hyX1XUN7+FCSPjvM1agFjGidVuF4Sxi7aFwfyh5t+4fD2VpM4wCQbWmodnx4fZLvsuQd9mkxxU+lGYQ==" "integrity": "sha512-fQaWIW8hyX1XUN7+FCSPjvM1agFjGidVuF4Sxi7aFwfyh5t+4fD2VpM4wCQbWmodnx4fZLvsuQd9mkxxU+lGYQ=="
}, },
"@firebase/logger": {
"version": "0.1.25",
"resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.1.25.tgz",
"integrity": "sha512-/lRhuepVcCCnQ2jcO5Hr08SYdmZDTQU9fdPdzg+qXJ9k/QnIrD2RbswXQcL6mmae3uPpX7fFXQAoScJ9pzp50w=="
},
"@firebase/messaging": { "@firebase/messaging": {
"version": "0.4.11", "version": "0.4.11",
"resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.4.11.tgz", "resolved": "https://registry.npmjs.org/@firebase/messaging/-/messaging-0.4.11.tgz",
@@ -198,16 +153,6 @@
"@firebase/messaging-types": "0.3.2", "@firebase/messaging-types": "0.3.2",
"@firebase/util": "0.2.28", "@firebase/util": "0.2.28",
"tslib": "1.10.0" "tslib": "1.10.0"
},
"dependencies": {
"@firebase/util": {
"version": "0.2.28",
"resolved": "https://registry.npmjs.org/@firebase/util/-/util-0.2.28.tgz",
"integrity": "sha512-ZQMAWtXj8y5kvB6izs0aTM/jG+WO8HpqhXA/EwD6LckJ+1P5LnAhaLZt1zR4HpuCE+jeP5I32Id5RJ/aifFs6A==",
"requires": {
"tslib": "1.10.0"
}
}
} }
}, },
"@firebase/messaging-types": { "@firebase/messaging-types": {
@@ -225,21 +170,6 @@
"@firebase/performance-types": "0.0.3", "@firebase/performance-types": "0.0.3",
"@firebase/util": "0.2.28", "@firebase/util": "0.2.28",
"tslib": "1.10.0" "tslib": "1.10.0"
},
"dependencies": {
"@firebase/logger": {
"version": "0.1.25",
"resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.1.25.tgz",
"integrity": "sha512-/lRhuepVcCCnQ2jcO5Hr08SYdmZDTQU9fdPdzg+qXJ9k/QnIrD2RbswXQcL6mmae3uPpX7fFXQAoScJ9pzp50w=="
},
"@firebase/util": {
"version": "0.2.28",
"resolved": "https://registry.npmjs.org/@firebase/util/-/util-0.2.28.tgz",
"integrity": "sha512-ZQMAWtXj8y5kvB6izs0aTM/jG+WO8HpqhXA/EwD6LckJ+1P5LnAhaLZt1zR4HpuCE+jeP5I32Id5RJ/aifFs6A==",
"requires": {
"tslib": "1.10.0"
}
}
} }
}, },
"@firebase/performance-types": { "@firebase/performance-types": {
@@ -272,8 +202,13 @@
"@firebase/storage-types": "0.3.3", "@firebase/storage-types": "0.3.3",
"@firebase/util": "0.2.28", "@firebase/util": "0.2.28",
"tslib": "1.10.0" "tslib": "1.10.0"
}
},
"@firebase/storage-types": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.3.3.tgz",
"integrity": "sha512-fUp4kpbxwDiWs/aIBJqBvXgFHZvgoND2JA0gJYSEsXtWtVwfgzY/710plErgZDeQKopX5eOR1sHskZkQUy0U6w=="
}, },
"dependencies": {
"@firebase/util": { "@firebase/util": {
"version": "0.2.28", "version": "0.2.28",
"resolved": "https://registry.npmjs.org/@firebase/util/-/util-0.2.28.tgz", "resolved": "https://registry.npmjs.org/@firebase/util/-/util-0.2.28.tgz",
@@ -281,13 +216,6 @@
"requires": { "requires": {
"tslib": "1.10.0" "tslib": "1.10.0"
} }
}
}
},
"@firebase/storage-types": {
"version": "0.3.3",
"resolved": "https://registry.npmjs.org/@firebase/storage-types/-/storage-types-0.3.3.tgz",
"integrity": "sha512-fUp4kpbxwDiWs/aIBJqBvXgFHZvgoND2JA0gJYSEsXtWtVwfgzY/710plErgZDeQKopX5eOR1sHskZkQUy0U6w=="
}, },
"@firebase/webchannel-wrapper": { "@firebase/webchannel-wrapper": {
"version": "0.2.26", "version": "0.2.26",
@@ -608,10 +536,9 @@
"dev": true "dev": true
}, },
"ansi-regex": { "ansi-regex": {
"version": "3.0.0", "version": "4.1.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg=="
"dev": true
}, },
"ansi-styles": { "ansi-styles": {
"version": "3.2.1", "version": "3.2.1",
@@ -1190,15 +1117,9 @@
} }
}, },
"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"
@@ -1280,6 +1201,12 @@
"text-table": "^0.2.0" "text-table": "^0.2.0"
}, },
"dependencies": { "dependencies": {
"ansi-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true
},
"debug": { "debug": {
"version": "4.1.1", "version": "4.1.1",
"resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
@@ -1294,6 +1221,15 @@
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
"dev": true "dev": true
},
"strip-ansi": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
"dev": true,
"requires": {
"ansi-regex": "^3.0.0"
}
} }
} }
}, },
@@ -1556,33 +1492,6 @@
"@firebase/polyfill": "0.3.22", "@firebase/polyfill": "0.3.22",
"@firebase/storage": "0.3.12", "@firebase/storage": "0.3.12",
"@firebase/util": "0.2.28" "@firebase/util": "0.2.28"
},
"dependencies": {
"@firebase/database": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/@firebase/database/-/database-0.5.4.tgz",
"integrity": "sha512-Hz1Bi3fzIcNNocE4EhvvwoEQGurG2BGssWD3/6a2bzty+K1e57SLea2Ied8QYNBUU1zt/4McHfa3Y71EQIyn/w==",
"requires": {
"@firebase/database-types": "0.4.3",
"@firebase/logger": "0.1.25",
"@firebase/util": "0.2.28",
"faye-websocket": "0.11.3",
"tslib": "1.10.0"
}
},
"@firebase/logger": {
"version": "0.1.25",
"resolved": "https://registry.npmjs.org/@firebase/logger/-/logger-0.1.25.tgz",
"integrity": "sha512-/lRhuepVcCCnQ2jcO5Hr08SYdmZDTQU9fdPdzg+qXJ9k/QnIrD2RbswXQcL6mmae3uPpX7fFXQAoScJ9pzp50w=="
},
"@firebase/util": {
"version": "0.2.28",
"resolved": "https://registry.npmjs.org/@firebase/util/-/util-0.2.28.tgz",
"integrity": "sha512-ZQMAWtXj8y5kvB6izs0aTM/jG+WO8HpqhXA/EwD6LckJ+1P5LnAhaLZt1zR4HpuCE+jeP5I32Id5RJ/aifFs6A==",
"requires": {
"tslib": "1.10.0"
}
}
} }
}, },
"firebase-admin": { "firebase-admin": {
@@ -1710,8 +1619,7 @@
"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",
@@ -2259,15 +2167,9 @@
} }
}, },
"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",
@@ -2441,8 +2343,7 @@
"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",
@@ -2457,8 +2358,7 @@
"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",
@@ -2528,10 +2428,8 @@
"is-fullwidth-code-point": { "is-fullwidth-code-point": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
"requires": { "dev": true
"number-is-nan": "^1.0.0"
}
}, },
"is-obj": { "is-obj": {
"version": "2.0.0", "version": "2.0.0",
@@ -2929,7 +2827,6 @@
"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"
} }
@@ -3374,8 +3271,7 @@
"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",
@@ -3428,11 +3324,28 @@
"string-width": { "string-width": {
"version": "2.1.1", "version": "2.1.1",
"resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
"dev": true,
"requires": { "requires": {
"code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^2.0.0", "is-fullwidth-code-point": "^2.0.0",
"strip-ansi": "^4.0.0" "strip-ansi": "^4.0.0"
},
"dependencies": {
"ansi-regex": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true
},
"strip-ansi": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
"integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
"dev": true,
"requires": {
"ansi-regex": "^3.0.0"
}
}
} }
}, },
"string_decoder": { "string_decoder": {
@@ -3442,12 +3355,11 @@
"optional": true "optional": true
}, },
"strip-ansi": { "strip-ansi": {
"version": "4.0.0", "version": "5.2.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
"dev": true,
"requires": { "requires": {
"ansi-regex": "^3.0.0" "ansi-regex": "^4.1.0"
} }
}, },
"strip-json-comments": { "strip-json-comments": {
@@ -3755,8 +3667,7 @@
"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

@@ -14,9 +14,11 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.19.0", "axios": "^0.19.0",
"busboy": "^0.3.1",
"firebase": "^6.6.2", "firebase": "^6.6.2",
"firebase-admin": "^8.6.0", "firebase-admin": "^8.6.0",
"firebase-functions": "^3.1.0" "firebase-functions": "^3.1.0",
"strip-ansi": "^5.2.0"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^5.12.0", "eslint": "^5.12.0",

View File

@@ -4,12 +4,12 @@ const { admin, db } = require('./admin');
// The function will only execute if the user is logged in, or rather, they have // The function will only execute if the user is logged in, or rather, they have
// a valid token // a valid token
module.exports = (req, res, next) => { module.exports = (req, res, next) => {
console.log(req); // console.log(req);
console.log(req.body); // console.log(req.body);
console.log(req.headers); // console.log(req.headers);
console.log(req.headers.authorization); // console.log(req.headers.authorization);
console.log(JSON.stringify(req.body)); // console.log(JSON.stringify(req.body));
console.log(JSON.stringify(req.header)); // console.log(JSON.stringify(req.header));
let idToken; let idToken;
@@ -32,6 +32,7 @@ module.exports = (req, res, next) => {
.then((data) => { .then((data) => {
req.user.handle = data.docs[0].data().handle; // Save username req.user.handle = data.docs[0].data().handle; // Save username
req.user.imageUrl = data.docs[0].data().imageUrl; req.user.imageUrl = data.docs[0].data().imageUrl;
req.userData = data.docs[0].data(); // Stores all user data from the database
return next(); return next();
}) })
.catch((err) => { .catch((err) => {

View File

@@ -9,23 +9,39 @@ const isEmpty = (str) => {
else return false; else return false;
}; };
exports.validateUpdateProfileInfo = (data) => { exports.validateUpdateProfileInfo = (req) => {
const newData = req.body;
// const oldData = req.userData;
let errors = {}; let errors = {};
let profileData = {}; let profileData = req.userData;
// ?: Should users be able to change their handles and emails? // ?: Should users be able to change their handles and emails?
// Only adds the key to the database if the values are not empty // Deletes any unused keys so that they aren't stored in the database
if (!isEmpty(data.firstName)) profileData.firstName = data.firstName.trim(); if (newData.firstName) {
if (!isEmpty(data.lastName)) profileData.lastName = data.lastName.trim(); profileData.firstName = newData.firstName.toString().trim();
if (!isEmpty(data.bio)) profileData.bio = data.bio.trim(); } else {
delete profileData.firstName;
}
if (isEmpty(data.email)) { if (newData.lastName) {
profileData.lastName = newData.lastName.toString().trim();
} else {
delete profileData.lastName;
}
if (newData.bio) {
profileData.bio = newData.bio.toString().trim();
} else {
delete profileData.bio;
}
if (isEmpty(newData.email)) {
errors.email = "Must not be empty."; errors.email = "Must not be empty.";
} else if (!isEmail(data.email)) { } else if (!isEmail(newData.email)) {
errors.email = "Must be a valid email."; errors.email = "Must be a valid email.";
} else { } else {
profileData.email = data.email; profileData.email = newData.email;
} }
return { return {

37
package-lock.json generated
View File

@@ -16,6 +16,15 @@
"resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
"integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
}, },
"axios": {
"version": "0.19.0",
"resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz",
"integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==",
"requires": {
"follow-redirects": "1.5.10",
"is-buffer": "^2.0.2"
}
},
"body-parser": { "body-parser": {
"version": "1.19.0", "version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
@@ -164,6 +173,24 @@
"unpipe": "~1.0.0" "unpipe": "~1.0.0"
} }
}, },
"follow-redirects": {
"version": "1.5.10",
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
"integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
"requires": {
"debug": "=3.1.0"
},
"dependencies": {
"debug": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
"integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
"requires": {
"ms": "2.0.0"
}
}
}
},
"forwarded": { "forwarded": {
"version": "0.1.2", "version": "0.1.2",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz", "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
@@ -204,6 +231,16 @@
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz",
"integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA=="
}, },
"is-buffer": {
"version": "2.0.4",
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz",
"integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A=="
},
"jwt-decode": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-2.2.0.tgz",
"integrity": "sha1-fYa9VmefWM5qhHBKZX3TkruoGnk="
},
"media-typer": { "media-typer": {
"version": "0.3.0", "version": "0.3.0",
"resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",

BIN
screenshots/00.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
screenshots/01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
screenshots/02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
screenshots/03.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
screenshots/04.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 184 KiB

BIN
screenshots/05.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

BIN
screenshots/06.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
screenshots/07.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -1,12 +0,0 @@
{
"type": "service_account",
"project_id": "twistter-e4649",
"private_key_id": "1e57494429e4fd7d17f6fc28524e14b8e5227596",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCyRdMZwXrpf3HB\nsVrGZVoPt+S+ahkT4SCCEWV/Q4O4hVyW277Rs0p7k5ZkZfkhcVVBUqKGMgW/Esvz\npx0VIgpg3gg308kMRmC3MGzYbodjynVyDHatyAZhhUi9cg0N2K9+vSsW5eSmWROe\nfVvB8hvr6m5xGVdJFA7DV4/0vm2cfy+Q/FlFb6vFmQTZtPZzGFf5BKoNMe7pMxey\n4zspAIZgRmxWDbAqqzX0PYk/WbXFgH/wn2X25S+ArHhoay2Hms65/NbWCV6mpFUJ\nYqzrlCn/WcwXGAm7tjmu00yD+bARabImh8R7+PSBaHMQ+SGdri2snIXWsvB/xi9/\nSNFqzHynAgMBAAECggEAVty/zapg1bnTt0FPziBfIA6FpaPzoSSN3uJUFozSdwuA\nAD+E/A9EiO7yFew71egvVrtJVmK0OxQRDSDNglkKPoWg8na+XL1D7a5qMpC0ZlKl\nJBNfljBCr6yuMySJqMf+Rp4siyUr4kO/0/cXyOnLYglhk7j5tzFPOi4FhgZtSRU9\nYckk5wwcBObUFE0Rmqf0gPcI9WuFUkusIjz3rjuEju1/U6E/VV5gHmMuQy3f9LHB\nnsiLAobx9+TGgs12CvkjWYpW5raUCCn5z/EYNPZSt7rg9CSWqXW009HCfTqi6i7o\nNpZ7qpp5DVQdHNFJunSGvI+k44+i8OE7HEY4xXt+OQKBgQDZ/E1QwJQoHuzPkrGW\nAc0a+NQeG8NwaXwsezlvYXMTbL27SxKXC3dzPT1WgNUKpaKj3wLJPar4NgPPSPi3\nqgmcvMqgwm4B+HPbXc1oxBS7/jD3pWJVyPO9Re17Uc0RYV/DORQhWe1Yq7TyMHvl\nbD/KqIvOxswigVxK4JMIxp4s7wKBgQDRXJfb4BHdR7CGfuTVQ19gH5uLgrK9ezBk\nQOLK+u9yBpoKyYSnD3OH/i0wG5bm3rUegzvwHGKKhDfiLbajMIt04n2DuVUm57HQ\n+Jca29V8XMWfhTbu3kDl+OOFmLvPCwg8C9edNTJWUVYu3EbwsyzCQY5TDroWGQdF\n6cQIkAIbyQKBgQCUtWd1UHuCR16cWOHniQEIhnoGtEAHHx9EJShQkLV1qfhhnlxn\nSL5LkpqWubsc0VR74LbA3N4XCJpevdRXT5vRHoZJV3q+w2UeYQaxkxrmCQoU1/GW\nvklxdRQGzg5M7hXrU7Qk8HlXxYPiuSq8n7WBJqyB+uLmI0P4HO6RzRW5ZwKBgBkr\nf5pQkvU+dCuHP+2fvuyogCPCn8iF8ehroJh0mKrlvklDtu36vpH/7eDVwEubRL0Z\nW/BfCT3L7YgEpOtzn6B6xko60tDtlAQijtAM09qysJOgCV2oXLcJOBlMpm+azO+j\nINXmmlmkR680jlbLw7rK9NhpcdfMRIKUOxwobAh5AoGBAJMN6n7Hy8nJRJZ18iHY\n3hEkVbKrLLMMHFDQj5BZQCeAp1v0Fj30RYJWS4hTzR9ht0MtdmPub460lh9hhqCM\nl3UnCJoz00ApF3Z2FRN/l0KpCFD9Gw2Hjyc3u9sEUpqd8G3cg3IZE6eZ6CZWljFT\nHcuQ2cTFdB8bq8oLUxXeY3Yv\n-----END PRIVATE KEY-----\n",
"client_email": "firebase-adminsdk-pgjve@twistter-e4649.iam.gserviceaccount.com",
"client_id": "102241295911303209723",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-pgjve%40twistter-e4649.iam.gserviceaccount.com"
}

View File

@@ -0,0 +1,12 @@
{
"type": "service_account",
"project_id": "twistter-e4649",
"private_key_id": "382fc005e17340a21dd39079feca75371330644d",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDL1bwTpEluR6dJ\nVfS/K1d76j2I3Wrn4qSbrTYm4/cAPBPlsBRO0bwrkhr+g0I6rwW/fFz8udjNAFB1\nfDfz769buR6go5us71I5LxMNviIhzFr59ZsEkcnUCgW8G7koicLEjWdstI4lJxZT\nRRolH+SFpPwsQAY399zjdBiCC8STbavVVhe+ChEDl/S2K72W7A7nWSMbLsyGsz2o\nQ9uIG3onwFNE7WRIeObWCxSBKlydMmTJ+p/CsTdFY4fUHb97QsMEmzRJox10kmyt\nP9l5wfJ2wUYvRXRJKq7Mwx1UnLduXP2oe/XvR5fzJLJ780HO6BNBf5IKcTHXHVBA\ne6ZtiL5dAgMBAAECggEAFvfN1NttjXL0KKak3hMA1+z8Y2WqXC1aUFMOMlz8Qhct\nmXNjy8CFAYEvGtVTgHqkR9Vi7PShYfLSc3U8diI155H5H4S6pUaPmfNHTwRzosyn\ncQRPJA6sEqvRGvHMxVfwjbvultMpiTTZpnxiMSNiLqT5PUs26CuSb5bErt1V7dP5\nn/lhY+4rzfXSrw38ZsO/gEvLZ/7iRA+JZgqE3Qs2cD5idxqqOcOLLiW741JpXTmd\n5ug/urJgSyvz+cNo3yHnajEtAxiSfkpU4sUHZ/WWqaRGWxpt3XWILtR9Q/4afPeM\n/T82YvddoW5pUwDpgvZxdVYjopuoxvnS298L0AGySQKBgQDqDD7Yh6SbOR3w4ZN9\nRO7q5KiJbyZmVdZ3lLZddsL/vto9JkUtnLDOMpYnb2TezGfN6ErzAkRQCSUsWK4m\nERbSK6oyUvevhlt/gHGP34uc/OCxGk2D7WCAS3s54ofDt2369tzIpGjsnkYM+h3b\nuZ5lFoWHG1YM3JtgcIIU6UygTwKBgQDe9ArV08wPDuXf4rcldmImQDB7xhGcg9xU\njAKEn5FZW1mvmBy3Sq1qpZj0baZz6eEDn6FBLwH1Ke5gdfrd8WnESUNnFnBBqpA1\nospIgUmKZ1sjyly9CHMQ11Kbzt7+kA9GYZrMbaMjS8M18qFEBZ7CoPLv5DLyabJW\nOkPzTwb/kwKBgQDR3fUkmEzj202bx8pHE97gxfTSd9aJAQN06uaz3GByjyKGnqB9\ni/mGjBnUdrCOj9+s5VT/ntK+qdSpdUODYuOBxiGxSnBK9kFpjTVHe35nYOHiLOHB\nIMPdhtGSUCzJNNvrpBzJ1ZM4SZwq2sSXWFRN9On7Amog0liJG5mpQqGxRQKBgHmP\nzFycF3XaZKH2xm8ppgg/FXBXJYEWMEr07+aJ7kEvWq4wHPAfSoCMe+JB6vDmg2Zr\nYgvdao7W5v83NKpQl5+LZrHNfTWAnxJviSWRQJyzD/Fqw7fZ5Is5K/SCDfn0aC+y\nxilSWhHDnFNM0Hr7KX3rLap43QJpePAk4qnF3AX7AoGBAOe5C1VMKoTapnxvo/FI\nBCvXw05SSEExfXVR0ryoqUxgu1asCkYyJSoWxOZQ+33npQ1/zV1mCXn/lNZcyveW\nZ5/cUw71grW8KBYFrW7LeQIzjZb7xPI3Z4EV0uYd2b69GkQk1buHj/gsswRhGEvx\nJM1DN1SCenbGcVLprM0vVelp\n-----END PRIVATE KEY-----\n",
"client_email": "firebase-adminsdk-pgjve@twistter-e4649.iam.gserviceaccount.com",
"client_id": "102241295911303209723",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/firebase-adminsdk-pgjve%40twistter-e4649.iam.gserviceaccount.com"
}

View File

@@ -1,5 +1,10 @@
This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app). This project was bootstrapped with [Create React App](https://github.com/facebookincubator/create-react-app).
Cloud: https://us-central1-twistter-e4649.cloudfunctions.net/api
Local: http://localhost:5001/twistter-e4649/us-central1/api (npm install --save firebase)
Below you will find some information on how to perform common tasks.<br> Below you will find some information on how to perform common tasks.<br>
You can find the most recent version of this guide [here](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md). You can find the most recent version of this guide [here](https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md).

View File

@@ -61,6 +61,14 @@
} }
} }
}, },
"@material-ui/icons": {
"version": "4.5.1",
"resolved": "https://registry.npmjs.org/@material-ui/icons/-/icons-4.5.1.tgz",
"integrity": "sha512-YZ/BgJbXX4a0gOuKWb30mBaHaoXRqPanlePam83JQPZ/y4kl+3aW0Wv9tlR70hB5EGAkEJGW5m4ktJwMgxQAeA==",
"requires": {
"@babel/runtime": "^7.4.4"
}
},
"@material-ui/styles": { "@material-ui/styles": {
"version": "4.5.0", "version": "4.5.0",
"resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.5.0.tgz", "resolved": "https://registry.npmjs.org/@material-ui/styles/-/styles-4.5.0.tgz",
@@ -1377,35 +1385,6 @@
"resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz",
"integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==" "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w=="
}, },
"body-parser": {
"version": "1.19.0",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz",
"integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==",
"requires": {
"bytes": "3.1.0",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "~1.1.2",
"http-errors": "1.7.2",
"iconv-lite": "0.4.24",
"on-finished": "~2.3.0",
"qs": "6.7.0",
"raw-body": "2.4.0",
"type-is": "~1.6.17"
},
"dependencies": {
"bytes": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
},
"qs": {
"version": "6.7.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz",
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ=="
}
}
},
"boolbase": { "boolbase": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
@@ -1536,6 +1515,15 @@
} }
} }
}, },
"call-bind": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
"integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
"requires": {
"function-bind": "^1.1.1",
"get-intrinsic": "^1.0.2"
}
},
"caller-path": { "caller-path": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz",
@@ -1930,14 +1918,6 @@
"resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz",
"integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=" "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo="
}, },
"content-disposition": {
"version": "0.5.3",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz",
"integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==",
"requires": {
"safe-buffer": "5.1.2"
}
},
"content-type": { "content-type": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
@@ -1961,11 +1941,6 @@
"safe-buffer": "~5.1.1" "safe-buffer": "~5.1.1"
} }
}, },
"cookie": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
"integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg=="
},
"cookie-signature": { "cookie-signature": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
@@ -2409,6 +2384,11 @@
"resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz",
"integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=" "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs="
}, },
"dayjs": {
"version": "1.11.7",
"resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.7.tgz",
"integrity": "sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ=="
},
"debug": { "debug": {
"version": "2.6.9", "version": "2.6.9",
"resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
@@ -2517,11 +2497,6 @@
"resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
"integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
}, },
"destroy": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
"integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
},
"detect-indent": { "detect-indent": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz",
@@ -3084,6 +3059,11 @@
"merge": "^1.2.0" "merge": "^1.2.0"
} }
}, },
"exenv": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/exenv/-/exenv-1.2.2.tgz",
"integrity": "sha1-KueOhdmJQVhnCwPUe+wfA72Ru50="
},
"exit-hook": { "exit-hook": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz", "resolved": "https://registry.npmjs.org/exit-hook/-/exit-hook-1.1.1.tgz",
@@ -3106,46 +3086,249 @@
} }
}, },
"express": { "express": {
"version": "4.17.1", "version": "4.18.2",
"resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", "resolved": "https://registry.npmjs.org/express/-/express-4.18.2.tgz",
"integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", "integrity": "sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==",
"requires": { "requires": {
"accepts": "~1.3.7", "accepts": "~1.3.8",
"array-flatten": "1.1.1", "array-flatten": "1.1.1",
"body-parser": "1.19.0", "body-parser": "1.20.1",
"content-disposition": "0.5.3", "content-disposition": "0.5.4",
"content-type": "~1.0.4", "content-type": "~1.0.4",
"cookie": "0.4.0", "cookie": "0.5.0",
"cookie-signature": "1.0.6", "cookie-signature": "1.0.6",
"debug": "2.6.9", "debug": "2.6.9",
"depd": "~1.1.2", "depd": "2.0.0",
"encodeurl": "~1.0.2", "encodeurl": "~1.0.2",
"escape-html": "~1.0.3", "escape-html": "~1.0.3",
"etag": "~1.8.1", "etag": "~1.8.1",
"finalhandler": "~1.1.2", "finalhandler": "1.2.0",
"fresh": "0.5.2", "fresh": "0.5.2",
"http-errors": "2.0.0",
"merge-descriptors": "1.0.1", "merge-descriptors": "1.0.1",
"methods": "~1.1.2", "methods": "~1.1.2",
"on-finished": "~2.3.0", "on-finished": "2.4.1",
"parseurl": "~1.3.3", "parseurl": "~1.3.3",
"path-to-regexp": "0.1.7", "path-to-regexp": "0.1.7",
"proxy-addr": "~2.0.5", "proxy-addr": "~2.0.7",
"qs": "6.7.0", "qs": "6.11.0",
"range-parser": "~1.2.1", "range-parser": "~1.2.1",
"safe-buffer": "5.1.2", "safe-buffer": "5.2.1",
"send": "0.17.1", "send": "0.18.0",
"serve-static": "1.14.1", "serve-static": "1.15.0",
"setprototypeof": "1.1.1", "setprototypeof": "1.2.0",
"statuses": "~1.5.0", "statuses": "2.0.1",
"type-is": "~1.6.18", "type-is": "~1.6.18",
"utils-merge": "1.0.1", "utils-merge": "1.0.1",
"vary": "~1.1.2" "vary": "~1.1.2"
}, },
"dependencies": { "dependencies": {
"accepts": {
"version": "1.3.8",
"resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",
"integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==",
"requires": {
"mime-types": "~2.1.34",
"negotiator": "0.6.3"
}
},
"body-parser": {
"version": "1.20.1",
"resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.1.tgz",
"integrity": "sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==",
"requires": {
"bytes": "3.1.2",
"content-type": "~1.0.4",
"debug": "2.6.9",
"depd": "2.0.0",
"destroy": "1.2.0",
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"on-finished": "2.4.1",
"qs": "6.11.0",
"raw-body": "2.5.1",
"type-is": "~1.6.18",
"unpipe": "1.0.0"
}
},
"bytes": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",
"integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="
},
"content-disposition": {
"version": "0.5.4",
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
"integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==",
"requires": {
"safe-buffer": "5.2.1"
}
},
"cookie": {
"version": "0.5.0",
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz",
"integrity": "sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw=="
},
"depd": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
"integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="
},
"destroy": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz",
"integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg=="
},
"finalhandler": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz",
"integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==",
"requires": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "2.4.1",
"parseurl": "~1.3.3",
"statuses": "2.0.1",
"unpipe": "~1.0.0"
}
},
"forwarded": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz",
"integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="
},
"http-errors": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz",
"integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==",
"requires": {
"depd": "2.0.0",
"inherits": "2.0.4",
"setprototypeof": "1.2.0",
"statuses": "2.0.1",
"toidentifier": "1.0.1"
}
},
"ipaddr.js": {
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
"integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
},
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
},
"mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg=="
},
"mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"requires": {
"mime-db": "1.52.0"
}
},
"ms": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
"integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="
},
"negotiator": {
"version": "0.6.3",
"resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz",
"integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg=="
},
"on-finished": {
"version": "2.4.1",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",
"integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==",
"requires": {
"ee-first": "1.1.1"
}
},
"proxy-addr": {
"version": "2.0.7",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",
"integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==",
"requires": {
"forwarded": "0.2.0",
"ipaddr.js": "1.9.1"
}
},
"qs": { "qs": {
"version": "6.7.0", "version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==" "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
"requires": {
"side-channel": "^1.0.4"
}
},
"raw-body": {
"version": "2.5.1",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz",
"integrity": "sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==",
"requires": {
"bytes": "3.1.2",
"http-errors": "2.0.0",
"iconv-lite": "0.4.24",
"unpipe": "1.0.0"
}
},
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
},
"send": {
"version": "0.18.0",
"resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz",
"integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==",
"requires": {
"debug": "2.6.9",
"depd": "2.0.0",
"destroy": "1.2.0",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "2.0.0",
"mime": "1.6.0",
"ms": "2.1.3",
"on-finished": "2.4.1",
"range-parser": "~1.2.1",
"statuses": "2.0.1"
}
},
"serve-static": {
"version": "1.15.0",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz",
"integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==",
"requires": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.3",
"send": "0.18.0"
}
},
"setprototypeof": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
"integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="
},
"statuses": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz",
"integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ=="
},
"toidentifier": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="
} }
} }
}, },
@@ -3299,20 +3482,6 @@
"repeat-string": "^1.5.2" "repeat-string": "^1.5.2"
} }
}, },
"finalhandler": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz",
"integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==",
"requires": {
"debug": "2.6.9",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"on-finished": "~2.3.0",
"parseurl": "~1.3.3",
"statuses": "~1.5.0",
"unpipe": "~1.0.0"
}
},
"find-cache-dir": { "find-cache-dir": {
"version": "0.1.1", "version": "0.1.1",
"resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-0.1.1.tgz",
@@ -3399,11 +3568,6 @@
"mime-types": "^2.1.12" "mime-types": "^2.1.12"
} }
}, },
"forwarded": {
"version": "0.1.2",
"resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
"integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
},
"fragment-cache": { "fragment-cache": {
"version": "0.2.1", "version": "0.2.1",
"resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
@@ -3949,6 +4113,11 @@
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
"integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
}, },
"fuse.js": {
"version": "3.4.6",
"resolved": "https://registry.npmjs.org/fuse.js/-/fuse.js-3.4.6.tgz",
"integrity": "sha512-H6aJY4UpLFwxj1+5nAvufom5b2BT2v45P1MkPvdGIK8fWjQx/7o6tTT1+ALV0yawQvbmvCF0ufl2et8eJ7v7Cg=="
},
"gauge": { "gauge": {
"version": "2.7.4", "version": "2.7.4",
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
@@ -3985,6 +4154,16 @@
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
"integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
}, },
"get-intrinsic": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.3.tgz",
"integrity": "sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==",
"requires": {
"function-bind": "^1.1.1",
"has": "^1.0.3",
"has-symbols": "^1.0.3"
}
},
"get-value": { "get-value": {
"version": "2.0.6", "version": "2.0.6",
"resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
@@ -4122,6 +4301,11 @@
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz",
"integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=" "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo="
}, },
"has-symbols": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
"integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A=="
},
"has-unicode": { "has-unicode": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
@@ -4296,25 +4480,6 @@
} }
} }
}, },
"http-errors": {
"version": "1.7.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",
"integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==",
"requires": {
"depd": "~1.1.2",
"inherits": "2.0.3",
"setprototypeof": "1.1.1",
"statuses": ">= 1.5.0 < 2",
"toidentifier": "1.0.0"
},
"dependencies": {
"inherits": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
}
}
},
"http-parser-js": { "http-parser-js": {
"version": "0.4.10", "version": "0.4.10",
"resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.10.tgz", "resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.4.10.tgz",
@@ -4501,11 +4666,6 @@
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
}, },
"ipaddr.js": {
"version": "1.9.0",
"resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz",
"integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA=="
},
"is-absolute-url": { "is-absolute-url": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz", "resolved": "https://registry.npmjs.org/is-absolute-url/-/is-absolute-url-2.1.0.tgz",
@@ -6085,6 +6245,11 @@
} }
} }
}, },
"object-inspect": {
"version": "1.12.2",
"resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.2.tgz",
"integrity": "sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ=="
},
"object-visit": { "object-visit": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz",
@@ -6124,14 +6289,6 @@
} }
} }
}, },
"on-finished": {
"version": "2.3.0",
"resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
"integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
"requires": {
"ee-first": "1.1.1"
}
},
"on-headers": { "on-headers": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz",
@@ -6990,15 +7147,6 @@
"react-is": "^16.8.1" "react-is": "^16.8.1"
} }
}, },
"proxy-addr": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz",
"integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==",
"requires": {
"forwarded": "~0.1.2",
"ipaddr.js": "1.9.0"
}
},
"prr": { "prr": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
@@ -7080,24 +7228,6 @@
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
"integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
}, },
"raw-body": {
"version": "2.4.0",
"resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz",
"integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==",
"requires": {
"bytes": "3.1.0",
"http-errors": "1.7.2",
"iconv-lite": "0.4.24",
"unpipe": "1.0.0"
},
"dependencies": {
"bytes": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
"integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg=="
}
}
},
"rc": { "rc": {
"version": "1.2.8", "version": "1.2.8",
"resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz",
@@ -7159,6 +7289,22 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.9.0.tgz", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.9.0.tgz",
"integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw==" "integrity": "sha512-tJBzzzIgnnRfEm046qRcURvwQnZVXmuCbscxUO5RWrGTXpon2d4c8mI0D8WE6ydVIm29JiLB6+RslkIvym9Rjw=="
}, },
"react-lifecycles-compat": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
"integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA=="
},
"react-modal": {
"version": "3.11.1",
"resolved": "https://registry.npmjs.org/react-modal/-/react-modal-3.11.1.tgz",
"integrity": "sha512-8uN744Yq0X2lbfSLxsEEc2UV3RjSRb4yDVxRQ1aGzPo86QjNOwhQSukDb8U8kR+636TRTvfMren10fgOjAy9eA==",
"requires": {
"exenv": "^1.2.0",
"prop-types": "^15.5.10",
"react-lifecycles-compat": "^3.0.0",
"warning": "^4.0.3"
}
},
"react-redux": { "react-redux": {
"version": "7.1.1", "version": "7.1.1",
"resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.1.1.tgz", "resolved": "https://registry.npmjs.org/react-redux/-/react-redux-7.1.1.tgz",
@@ -8849,38 +8995,6 @@
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
"integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ=="
}, },
"send": {
"version": "0.17.1",
"resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz",
"integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==",
"requires": {
"debug": "2.6.9",
"depd": "~1.1.2",
"destroy": "~1.0.4",
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"etag": "~1.8.1",
"fresh": "0.5.2",
"http-errors": "~1.7.2",
"mime": "1.6.0",
"ms": "2.1.1",
"on-finished": "~2.3.0",
"range-parser": "~1.2.1",
"statuses": "~1.5.0"
},
"dependencies": {
"mime": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
"integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg=="
},
"ms": {
"version": "2.1.1",
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz",
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg=="
}
}
},
"serve-index": { "serve-index": {
"version": "1.9.1", "version": "1.9.1",
"resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz", "resolved": "https://registry.npmjs.org/serve-index/-/serve-index-1.9.1.tgz",
@@ -8918,17 +9032,6 @@
} }
} }
}, },
"serve-static": {
"version": "1.14.1",
"resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz",
"integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==",
"requires": {
"encodeurl": "~1.0.2",
"escape-html": "~1.0.3",
"parseurl": "~1.3.3",
"send": "0.17.1"
}
},
"set-blocking": { "set-blocking": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
@@ -8960,11 +9063,6 @@
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
}, },
"setprototypeof": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz",
"integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw=="
},
"sha.js": { "sha.js": {
"version": "2.2.6", "version": "2.2.6",
"resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.2.6.tgz", "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.2.6.tgz",
@@ -8998,6 +9096,16 @@
"resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz",
"integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==" "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww=="
}, },
"side-channel": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
"integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
"requires": {
"call-bind": "^1.0.0",
"get-intrinsic": "^1.0.2",
"object-inspect": "^1.9.0"
}
},
"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",
@@ -9638,11 +9746,6 @@
} }
} }
}, },
"toidentifier": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz",
"integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw=="
},
"toposort": { "toposort": {
"version": "1.0.7", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/toposort/-/toposort-1.0.7.tgz", "resolved": "https://registry.npmjs.org/toposort/-/toposort-1.0.7.tgz",
@@ -9717,6 +9820,11 @@
"resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
}, },
"typeface-roboto": {
"version": "0.0.75",
"resolved": "https://registry.npmjs.org/typeface-roboto/-/typeface-roboto-0.0.75.tgz",
"integrity": "sha512-VrR/IiH00Z1tFP4vDGfwZ1esNqTiDMchBEXYY9kilT6wRGgFoCAlgkEUMHb1E3mB0FsfZhv756IF0+R+SFPfdg=="
},
"uglify-js": { "uglify-js": {
"version": "3.4.10", "version": "3.4.10",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz", "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.10.tgz",
@@ -9748,6 +9856,11 @@
"resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz", "resolved": "https://registry.npmjs.org/uid-number/-/uid-number-0.0.6.tgz",
"integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE=" "integrity": "sha1-DqEOgDXo61uOREnwbaHHMGY7qoE="
}, },
"underscore": {
"version": "1.13.6",
"resolved": "https://registry.npmjs.org/underscore/-/underscore-1.13.6.tgz",
"integrity": "sha512-+A5Sja4HP1M08MaXya7p5LvjuM7K6q/2EaC0+iovj/wOcMsTzMvDFbasi/oSapiwOlt252IqsKqPjCl7huKS0A=="
},
"union-value": { "union-value": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
@@ -9978,6 +10091,14 @@
"makeerror": "1.0.x" "makeerror": "1.0.x"
} }
}, },
"warning": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz",
"integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==",
"requires": {
"loose-envify": "^1.0.0"
}
},
"watch": { "watch": {
"version": "0.10.0", "version": "0.10.0",
"resolved": "https://registry.npmjs.org/watch/-/watch-0.10.0.tgz", "resolved": "https://registry.npmjs.org/watch/-/watch-0.10.0.tgz",

View File

@@ -4,21 +4,27 @@
"private": true, "private": true,
"dependencies": { "dependencies": {
"@material-ui/core": "^4.4.3", "@material-ui/core": "^4.4.3",
"@material-ui/icons": "^4.5.1",
"@material-ui/styles": "^4.5.0", "@material-ui/styles": "^4.5.0",
"@material-ui/system": "^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",
"dayjs": "^1.8.17",
"fuse.js": "^3.4.6",
"install": "^0.13.0", "install": "^0.13.0",
"jwt-decode": "^2.2.0", "jwt-decode": "^2.2.0",
"node-pre-gyp": "^0.13.0", "node-pre-gyp": "^0.13.0",
"react": "^16.9.0", "react": "^16.9.0",
"react-dom": "^16.9.0", "react-dom": "^16.9.0",
"react-modal": "^3.11.1",
"react-redux": "^7.1.1", "react-redux": "^7.1.1",
"react-router-dom": "^5.1.0", "react-router-dom": "^5.1.0",
"react-scripts": "0.9.5", "react-scripts": "0.9.5",
"redux": "^4.0.4", "redux": "^4.0.4",
"redux-thunk": "^2.3.0" "redux-thunk": "^2.3.0",
"typeface-roboto": "0.0.75",
"underscore": "^1.9.1"
}, },
"devDependencies": {}, "devDependencies": {},
"scripts": { "scripts": {
@@ -39,5 +45,5 @@
"last 1 safari version" "last 1 safari version"
] ]
}, },
"proxy": "https://us-central1-twistter-e4649.cloudfunctions.net/api" "proxy": "http://localhost:5001/twistter-e4649/us-central1/api"
} }

View File

@@ -10,40 +10,49 @@ import jwtDecode from "jwt-decode";
// Redux // Redux
import { Provider } from "react-redux"; import { Provider } from "react-redux";
import store from "./redux/store"; import store from "./redux/store";
import MuiThemeProvider from '@material-ui/core/styles/MuiThemeProvider'; import MuiThemeProvider from "@material-ui/core/styles/MuiThemeProvider";
import createMuiTheme from '@material-ui/core/styles/createMuiTheme'; import createMuiTheme from "@material-ui/core/styles/createMuiTheme";
import themeObject from './util/theme'; import themeObject from "./util/theme";
import { SET_AUTHENTICATED } from './redux/types'; import { SET_AUTHENTICATED } from "./redux/types";
import { logoutUser, getUserData } from './redux/actions/userActions'; import { logoutUser, getUserData } from "./redux/actions/userActions";
// Components // Components
import AuthRoute from "./util/AuthRoute"; import AuthRoute from "./util/AuthRoute";
// Pages // Pages
import home from './pages/Home'; import home from "./pages/Home";
import signup from './pages/Signup'; import signup from "./pages/Signup";
import login from './pages/Login'; import login from "./pages/Login";
import user from './pages/user'; import user from "./pages/user";
import logout from './pages/Logout'; import logout from "./pages/Logout";
import writeMicroblog from './Writing_Microblogs.js'; import Delete from "./pages/Delete";
import editProfile from './pages/editProfile'; import writeMicroblog from "./Writing_Microblogs.js";
import userLine from './Userline.js'; import editProfile from "./pages/editProfile";
import userLine from "./Userline.js";
import verify from "./pages/verify";
import Search from "./pages/Search.js";
import directMessages from "./pages/directMessages";
import otherUser from "./pages/otherUser";
const theme = createMuiTheme(themeObject); const theme = createMuiTheme(themeObject);
const token = localStorage.FBIdToken; const token = localStorage.FBIdToken;
if (token) { if (token) {
try {
const decodedToken = jwtDecode(token); const decodedToken = jwtDecode(token);
if (decodedToken.exp * 1000 < Date.now()) { if (decodedToken.exp * 1000 < Date.now()) {
store.dispatch(logoutUser); store.dispatch(logoutUser());
window.location.href = "/login"; window.location.href = "/login";
} else { } else {
store.dispatch({ type: SET_AUTHENTICATED }); store.dispatch({ type: SET_AUTHENTICATED });
axios.defaults.headers.common['Authorization'] = token; axios.defaults.headers.common["Authorization"] = token;
store.dispatch(getUserData()); store.dispatch(getUserData());
} }
} catch (invalidTokenError) {
store.dispatch(logoutUser());
window.location.href = "/login";
}
} }
class App extends Component { class App extends Component {
render() { render() {
@@ -51,26 +60,30 @@ class App extends Component {
<MuiThemeProvider theme={theme}> <MuiThemeProvider theme={theme}>
<Provider store={store}> <Provider store={store}>
<Router> <Router>
<div className='container' > <div className="container">
<Navbar /> <Navbar />
</div> </div>
<div className="app" style={{height: "700"}}>
<div className="app">
<Switch> <Switch>
{/* AuthRoute checks if the user is logged in and if they are it redirects them to /home */} {/* AuthRoute checks if the user is logged in and if they are it redirects them to /home */}
<AuthRoute exact path="/signup" component={signup} /> <AuthRoute exact path="/signup" component={signup} />
<AuthRoute exact path="/login" component={login} /> <AuthRoute exact path="/login" component={login} />
<Route exact path="/logout" component={logout} /> <AuthRoute exact path="/" component={home} />
<Route exact path="/logout" component={logout} />
<Route exact path="/delete" component={Delete} />
<Route exact path="/home" component={home} />
<Route exact path="/user" component={user} /> <Route exact path="/user" component={user} />
<Route exact path="/home" component={writeMicroblog} /> <Route exact path="/user/edit" component={editProfile} />
<Route exact path="/edit" component={editProfile} /> <Route exact path="/verify" component={verify} />
<Route exact path="/user" component={userLine} /> <Route exact path="/search" component={Search} />
<Route exact path="/dm" component={directMessages} />
<Route exact path="/user/:userhandle" component={otherUser} />
<AuthRoute exact path="/" component={home} /> <AuthRoute exact path="/" component={home} />
</Switch> </Switch>
</div> </div>
</Router> </Router>
</Provider> </Provider>
</MuiThemeProvider> </MuiThemeProvider>

View File

@@ -1,10 +1,10 @@
import React, { Component } from "react"; import React, { Component } from "react";
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 axios from 'axios'; import axios from 'axios';
import Box from '@material-ui/core/Box' import Box from '@material-ui/core/Box'
import {borders} from '@material-ui/system'; // import {borders} from '@material-ui/system';
import { sizing } from '@material-ui/system'; // import { sizing } from '@material-ui/system';
// var moment = require('moment'); // var moment = require('moment');
@@ -50,7 +50,7 @@ class Userline extends Component {
<br></br>Number of comments: {microBlog.commentCount} <br></br>Number of comments: {microBlog.commentCount}
<br></br>Number of likes: {microBlog.likeCount} <br></br>Number of likes: {microBlog.likeCount}
<br></br>Body of post: {microBlog.body} <br></br>Body of post: {microBlog.body}
<br></br>Tagged topics: {microBlog.microBlogTopics.join("," + " ")} <br></br>Tagged topics: {microBlog.microBlogTopics.join(", ")}
</p>)} </p>)}
</p> </p>
</div> </div>

View File

@@ -1,27 +1,52 @@
import React, { Component } from "react"; import React, { Component } from "react";
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 axios from 'axios'; import axios from "axios";
// Material-UI
import TextField from '@material-ui/core/TextField';
// import Typography from '@material-ui/core/Typography';
import Button from '@material-ui/core/Button';
import withStyles from "@material-ui/styles/withStyles";
import CircularProgress from "@material-ui/core/CircularProgress";
const styles = {
container: {
position: "fixed"
},
form: {
width: "300px",
height: "50px",
marginTop: "180px",
marginLeft: "50px"
},
textField: {
marginBottom: 15
},
progress: {
position: "absolute"
},
button: {
positon: "relative",
marginBottom: 30
}
}
class Writing_Microblogs extends Component { class Writing_Microblogs extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.state = { this.state = {
value: '', value: "",
title: '', title: "",
topics: '', topics: "",
characterCount: 250 characterCount: 250,
loading: false
}; };
this.handleChange = this.handleChange.bind(this); this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this); this.handleSubmit = this.handleSubmit.bind(this);
this.handleChangeforPost = this.handleChangeforPost.bind(this); this.handleChangeforPost = this.handleChangeforPost.bind(this);
this.handleChangeforTopics = this.handleChangeforTopics.bind(this); this.handleChangeforTopics = this.handleChangeforTopics.bind(this);
} }
handleChange(event) { handleChange(event) {
@@ -32,77 +57,139 @@ class Writing_Microblogs extends Component {
this.setState({ topics: event.target.value }); this.setState({ topics: event.target.value });
} }
handleSubmit(event) { handleSubmit = (event) => {
// alert('A title for the microblog was inputted: ' + this.state.title + '\nA microblog was posted: ' + this.state.value); // alert('A title for the microblog was inputted: ' + this.state.title + '\nA microblog was posted: ' + this.state.value);
const postData = { const postData = {
body: this.state.value, body: this.state.value,
userHandle: "new user",
userImage: "bing-url", userImage: "bing-url",
microBlogTitle: this.state.title, microBlogTitle: this.state.title,
microBlogTopics: this.state.topics.split(', ') microBlogTopics: this.state.topics.split(", ")
} };
const headers = {
headers: { 'Content-Type': 'application/json'}
}
axios this.setState({
.post('/putPost', postData, headers) loading: true
.then((res) =>{ })
alert('Post was shared successfully!') const headers = {
headers: { "Content-Type": "application/json" }
};
let postPromise = axios
.post("/putPost", postData, headers) // TODO: add topics
.then(res => {
// alert("Post was shared successfully!");
console.log(res.data); console.log(res.data);
}) })
.catch((err) => { .catch(err => {
alert('An error occured.'); alert("An error occured.");
console.error(err); console.error(err);
}) });
console.log(postData.microBlogTopics);
// let topicPromises = [];
// postData.microBlogTopics.forEach(topic => {
// topicPromises.push(axios
// .post("/putTopic", {
// following: topic
// })
// .then(res => {
// console.log(res.data);
// })
// .catch(err => {
// console.error(err);
// })
// )
// });
event.preventDefault(); event.preventDefault();
this.setState({value: '', title: '',characterCount: 250, topics: ''}) // topicPromises.push(postPromise);
Promise.all([postPromise])
.then(() => {
this.setState({
value: "",
title: "",
characterCount: 250,
topics: "",
loading: false
});
})
.catch((error) => {
console.log(error);
})
} }
handleChangeforPost(event) { handleChangeforPost(event) {
this.setState({value: event.target.value })
this.setState({ value: event.target.value });
} }
handleChangeforCharacterCount(event) { handleChangeforCharacterCount(event) {
const charCount = event.target.value.length const charCount = event.target.value.length;
const charRemaining = 250 - charCount const charRemaining = 250 - charCount;
this.setState({characterCount: charRemaining }) this.setState({ characterCount: charRemaining });
} }
render() { render() {
const { classes } = this.props;
return ( return (
<div> <div className={classes.container}>
<div style={{ width: "200px", height: "50px", marginTop: "180px", marginLeft: "50px" }}> <form noValidate className={classes.form}>
<form> <TextField
<textarea placeholder="Enter Microblog Title" value={this.state.title} required onChange={this.handleChange} cols={30} rows={1} /> id="title"
name="title"
label="Title"
className={classes.textField}
value={this.state.title}
variant="outlined"
onChange={this.handleChange}
fullWidth
autoComplete='off'
/>
<TextField
id="topics"
name="topics"
label="Topics"
className={classes.textField}
value={this.state.topics}
variant="outlined"
onChange={this.handleChangeforTopics}
color="primary"
fullWidth
autoComplete='off'
/>
<TextField
id="content"
name="content"
label="Content"
color="primary"
className={classes.textField}
value={this.state.value}
helperText={`${this.state.characterCount} characters left`}
multiline
rows="9"
variant="outlined"
inputProps={{
maxLength: 250
}}
onChange={(e) => {
this.handleChangeforPost(e);
this.handleChangeforCharacterCount(e);
}}
fullWidth
autoComplete='off'
/>
<Button
className={classes.button}
onClick={this.handleSubmit}
disabled={this.state.loading}
variant="outlined"
color="primary"
>
Share Post
{this.state.loading && <CircularProgress size={30} className={classes.progress} />}
</Button>
</form> </form>
</div> </div>
<div style={{ width: "200px", height: "50px", marginLeft: "50px"}} >
<form>
<textarea placeholder="Enter topics seperated by a comma" value={this.state.topics} required onChange={this.handleChangeforTopics} cols={40} rows={1} />
</form>
</div>
<div style={{ width: "200px", marginLeft: "50px"}}>
<form onSubmit={this.handleSubmit}>
<textarea value={this.state.value} required maxLength="250" placeholder= "Write Microblog here..."
onChange = { (e) => { this.handleChangeforPost(e); this.handleChangeforCharacterCount(e) } } cols={40} rows={20} />
<div style={{ fontSize: "14px", marginRight: "-100px"}} >
<p2>Characters Left: {this.state.characterCount}</p2>
</div>
<div style={{ marginRight: "-100px" }}>
<button onClick>Share Post</button>
</div>
</form>
</div>
</div>
); );
} }
} }
export default Writing_Microblogs; export default withStyles(styles)(Writing_Microblogs);

View File

@@ -1,76 +1,89 @@
/* eslint-disable */ /* eslint-disable */
import React, { Component } from 'react'; import React, { Component } from "react";
import { Link } from 'react-router-dom'; import { Link } from "react-router-dom";
// import PropTypes from 'prop-types'; import PropTypes from "prop-types";
// Material UI stuff // Material UI stuff
import AppBar from '@material-ui/core/AppBar'; import AppBar from "@material-ui/core/AppBar";
import ToolBar from '@material-ui/core/Toolbar'; import ToolBar from "@material-ui/core/Toolbar";
import Button from '@material-ui/core/Button'; import Button from "@material-ui/core/Button";
import withStyles from "@material-ui/core/styles/withStyles"; import withStyles from "@material-ui/core/styles/withStyles";
// Redux stuff // Redux stuff
// import { logoutUser } from '../../redux/actions/userActions'; import { logoutUser } from "../../redux/actions/userActions";
// import { connect } from 'react-redux'; import { connect } from "react-redux";
// const styles = {
// form: {
// textAlign: "center"
// },
// textField: {
// marginBottom: 30
// },
// pageTitle: {
// marginBottom: 40
// },
// button: {
// positon: "relative",
// marginBottom: 30
// },
// progress: {
// position: "absolute"
// }
// };
const styles = {
form: {
textAlign: "center"
},
textField: {
marginBottom: 30
},
pageTitle: {
marginBottom: 40
},
button: {
positon: "relative",
marginBottom: 30
},
progress: {
position: "absolute"
}
};
export class Navbar extends Component { export class Navbar extends Component {
render() { render() {
const authenticated = this.props.user.authenticated;
return ( return (
<AppBar> <AppBar>
<ToolBar> <ToolBar>
<Button component={ Link } to='/'> <Button component={Link} to="/">
Home Home
</Button> </Button>
<Button component={ Link } to='/login'> {authenticated && (
<Button component={Link} to="/user">
Profile
</Button>
)}
{authenticated && (
<Button component={Link} to="/dm">
DMs
</Button>
)}
{!authenticated && (
<Button component={Link} to="/login">
Login Login
</Button> </Button>
<Button component={ Link } to='/signup'> )}
{!authenticated && (
<Button component={Link} to="/signup">
Sign Up Sign Up
</Button> </Button>
<Button component={ Link } to='/logout'> )}
{authenticated && (
<Button component={Link} to="/search">
Search
</Button>
)}
{authenticated && (
<Button style={{position: "absolute", right: 30}} component={Link} to="/logout">
Logout Logout
</Button> </Button>
)}
</ToolBar> </ToolBar>
</AppBar> </AppBar>
) );
} }
} }
// const mapStateToProps = (state) => ({ const mapStateToProps = state => ({
// user: state.user user: state.user
// }) });
// const mapActionsToProps = { logoutUser }; Navbar.propTypes = {
user: PropTypes.object.isRequired,
classes: PropTypes.object.isRequired
};
// Navbar.propTypes = { export default connect(mapStateToProps)(withStyles(styles)(Navbar));
// logoutUser: PropTypes.func.isRequired,
// user: PropTypes.object.isRequired,
// classes: PropTypes.object.isRequired
// }
// export default connect(mapStateToProps, mapActionsToProps)(withStyles(styles)(Navbar));
export default Navbar;

View File

@@ -0,0 +1,48 @@
import React, { Component, Fragment } from "react";
import PropTypes from "prop-types";
import axios from "axios";
import { connect } from 'react-redux';
//MUI
import withStyles from "@material-ui/core/styles/withStyles";
import Card from "@material-ui/core/CardMedia";
import Typography from "@material-ui/core/Typography";
import Button from "@material-ui/core/Button";
import { Paper } from "@material-ui/core";
const styles = theme => ({
...theme
});
class Profile extends Component {
state = {
profile: null
};
componentDidMount() {
axios
.get("/user")
.then(res => {
console.log(res.data.userData.credentials.handle);
this.setState({
profile: res.data.userData.credentials.handle
});
})
.catch(err => console.log(err));
}
render() {
let profileMarkup = this.state.profile ? (
<p>
<Typography variant='h5'>{this.state.profile}</Typography>
</p>) : <p>loading profile...</p>
return profileMarkup;
}
}
const mapStateToProps = state => ({
user: state.user,
classes: PropTypes.object.isRequired
});
export default connect(mapStateToProps)(withStyles(styles)(Profile));

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

@@ -0,0 +1,60 @@
/* eslint-disable */
import React, { Component } from "react";
import PropTypes from "prop-types";
// Material UI stuff
import Button from "@material-ui/core/Button";
import withStyles from "@material-ui/core/styles/withStyles";
// Redux stuff
//import { logoutUser } from "../redux/actions/userActions";
import { deleteUser } from "../redux/actions/userActions";
import { connect } from "react-redux";
const styles = {
form: {
textAlign: "center"
},
textField: {
marginBottom: 30
},
pageTitle: {
marginBottom: 40
},
button: {
positon: "relative",
marginBottom: 30
},
progress: {
position: "absolute"
}
};
export class Delete extends Component {
componentDidMount() {
//this.props.logoutUser();
this.props.deleteUser();
this.props.history.push('/');
}
render() {
return null;
}
}
const mapStateToProps = (state) => ({
user: state.user
});
//const mapActionsToProps = { logoutUser };
const mapActionsToProps = { deleteUser };
Delete.propTypes = {
//logoutUser: PropTypes.func.isRequired,
deleteUser: PropTypes.func.isRequired,
user: PropTypes.object.isRequired,
classes: PropTypes.object.isRequired
};
export default connect(mapStateToProps, mapActionsToProps)(withStyles(styles)(Delete));

View File

@@ -1,26 +1,263 @@
import React, { Component } from 'react'; /* eslint-disable */
import '../App.css'; import React, { Component } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
import axios from "axios";
import logo from '../images/twistter-logo.png'; // Material UI and React Router
import CircularProgress from "@material-ui/core/CircularProgress";
import Button from "@material-ui/core/Button";
import Grid from "@material-ui/core/Grid";
import Card from "@material-ui/core/Card";
import CardContent from "@material-ui/core/CardContent";
import TextField from "@material-ui/core/TextField";
import Typography from "@material-ui/core/Typography";
import withStyles from "@material-ui/styles/withStyles";
// component
import "../App.css";
import logo from "../images/twistter-logo.png";
import noImage from "../images/no-img.png";
import Writing_Microblogs from "../Writing_Microblogs";
import ReactModal from "react-modal";
// Redux
import { likePost, unlikePost, getLikes } from "../redux/actions/userActions";
const styles = {
card: {
marginBottom: 5
}
};
class Home extends Component { class Home extends Component {
state = {
likes: [],
loading: false,
following: null,
topics: null
};
componentDidMount() {
this.setState({ loading: true });
let userPromise = axios
.get("/user")
.then(res => {
console.log(res.data.credentials.following);
let list = [];
res.data.credentials.following.forEach(element => {
list.push(element.handle);
});
this.setState({
following: list,
topics: res.data.credentials.followedTopics
});
})
.catch(err => console.log(err));
let allPosts;
let postPromise = axios
.get("/getallPosts")
.then(res => {
// console.log(res.data);
// this.setState({
// posts: res.data
// });
allPosts = res.data;
// console.log(allPosts)
return axios.get("/getAlert")
})
.then((res) => {
// console.log(res.data)
// res.data.forEach((adminAlert) => {
// allPosts.push(adminAlert);
// })
this.setState({
posts: allPosts
});
})
.catch(err => console.log(err));
Promise.all([userPromise, postPromise])
.then(() => {
this.setState({
loading: false
});
})
.catch(error => {
console.log(error);
});
this.props.getLikes();
}
componentWillReceiveProps(nextProps) {
this.setState({
likes: nextProps.user.likes
});
}
flagPost = (event) => {
// Flags a post
let postId = event.target.dataset.key ? event.target.dataset.key : event.target.parentNode.dataset.key;
console.log(postId);
axios.post(`/hidePost`, {postId})
.then((res) => {
console.log(res.data);
})
.catch(err => {
console.error(err);
});
// event.preventDefault();
}
handleClickLikeButton = (event) => {
// Need the ternary if statement because the user can click on the text or body of the
// Button and they are two different html elements
let postId = event.target.dataset.key
? event.target.dataset.key
: event.target.parentNode.dataset.key;
console.log(postId);
let doc = document.getElementById(postId);
// console.log(postId);
if (this.state.likes.includes(postId)) {
this.props.unlikePost(postId, this.state.likes);
doc.dataset.likes--;
} else {
this.props.likePost(postId, this.state.likes);
doc.dataset.likes++;
}
doc.innerHTML = "Likes " + doc.dataset.likes;
};
formatDate(dateString) {
let newDate = new Date(Date.parse(dateString));
return newDate.toDateString();
}
render() { render() {
return ( const {
UI: { loading }
} = this.props;
let authenticated = this.props.user.authenticated;
let { classes } = this.props;
let username = this.props.user.credentials.handle;
console.log(username);
var hiddenBool = true;
if (username === "Admin") {
hiddenBool = false;
}
console.log(hiddenBool);
let postMarkup = this.state.posts ? ( this.state.following === undefined || this.state.following === null ? <Typography>You aren't following anybody right now</Typography> :
this.state.posts.map(post => !post.hidden && this.state.following && (this.state.following.includes(post.userHandle) || post.userHandle === "Admin") ? (
<Card className={classes.card} key={post.postId}>
<CardContent>
<Typography>
{/* {
this.state.imageUrl ? (<img src={this.state.imageUrl} height="50" width="50" />) :
(<img src={noImage} height="50" width="50"/>)
} */}
{
post.profileImage ? (<img src={post.profileImage} height="50" width="50" />) :
(<img src={noImage} height="50" width="50"/>)
}
</Typography>
<Typography variant="h5"><b>{post.userHandle}</b></Typography>
<Typography variant="body2" color={"textSecondary"}>{this.formatDate(post.createdAt)}</Typography>
<br />
<Typography variant="body1"><b>{post.microBlogTitle}</b></Typography>
<Typography variant="body2">{post.quoteBody}</Typography>
<br />
<Typography variant="body2">{post.body}</Typography>
<br />
<Typography variant="body2"><b>Topics:</b> {post.microBlogTopics.join(", ")}</Typography>
<br />
{!hiddenBool &&
<Button
onClick={this.flagPost}
data-key={post.postId}
variant = "contained"
color = "primary"
>
Hide Post
</Button>
}
<Typography id={post.postId} data-likes={post.likeCount} variant="body2" color={"textSecondary"}>Likes {post.likeCount}</Typography>
{/* <Like microBlog = {post.postId} count = {post.likeCount} name = {username}></Like> */}
<Button
onClick={this.handleClickLikeButton}
data-key={post.postId}
disabled={loading}
variant="outlined"
color="primary"
>{
this.state.likes && this.state.likes.includes(post.postId) ? 'Unlike' : 'Like'
}</Button>
<Quote microblog = {post.postId}></Quote>
{/* <button>Quote</button> */}
{/* <Typography variant="body2" color={"textSecondary"}>Likes {post.likeCount} Comments {post.commentCount}</Typography> */}
</CardContent>
</Card>
) : (
<p></p>
)
)
) : (
<p>Loading post...</p>
);
return authenticated ? (
this.state.loading ? (
<CircularProgress
size={60}
style={{ marginTop: "300px" }}
></CircularProgress>
) : (
<Grid container>
<Grid item sm={4} xs={8}>
<Writing_Microblogs />
</Grid>
<Grid item sm={4} xs={8}>
{postMarkup}
</Grid>
</Grid>
)
) : loading ? (
<CircularProgress
size={60}
style={{ marginTop: "300px" }}
></CircularProgress>
) : (
<div> <div>
<div> <div>
<img src={logo} className="app-logo" alt="logo" /> <img src={logo} className="app-logo" alt="logo" />
<br/><br/> <br />
<br />
<b>Welcome to Twistter!</b> <b>Welcome to Twistter!</b>
<br/><br/> <br />
<br />
<b>See the most interesting topics people are following right now.</b> <b>See the most interesting topics people are following right now.</b>
</div> </div>
<br/><br/><br/><br/> <br />
<br />
<br />
<br />
<div> <div>
<b>Join today or sign in if you already have an account.</b> <b>Join today or sign in if you already have an account.</b>
<br/><br/> <br />
<br />
<form action="./signup"> <form action="./signup">
<button className="authButtons signup">Sign up</button> <button className="authButtons signup">Sign up</button>
</form> </form>
@@ -34,4 +271,281 @@ class Home extends Component {
} }
} }
export default Home; class Quote extends Component {
constructor(props) {
super(props);
this.state = {
characterCount: 250,
showModal: false,
value: ""
};
this.handleSubmitWithoutPost = this.handleSubmitWithoutPost.bind(this);
this.handleOpenModal = this.handleOpenModal.bind(this);
this.handleCloseModal = this.handleCloseModal.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
handleSubmitWithoutPost(event) {
const post = {
userImage: "bing-url"
};
const headers = {
headers: { "Content-Type": "application/json" }
};
axios
.post(`/quoteWithoutPost/${this.props.microblog}`, post, headers)
.then(res => {
console.log(res.data);
})
.catch(err => {
console.error(err);
});
event.preventDefault();
}
handleOpenModal() {
this.setState({ showModal: true });
}
handleCloseModal() {
this.setState({ showModal: false, characterCount: 250, value: "" });
}
handleChangeforPost(event) {
this.setState({ value: event.target.value });
}
handleChangeforCharacterCount(event) {
const charCount = event.target.value.length;
const charRemaining = 250 - charCount;
this.setState({ characterCount: charRemaining });
}
handleSubmit(event) {
const quotedPost = {
quoteBody: this.state.value,
userImage: "bing-url"
};
const headers = {
headers: { "Content-Type": "application/json" }
};
axios
.post(`/quoteWithPost/${this.props.microblog}`, quotedPost, headers)
.then(res => {
console.log(res.data);
})
.catch(err => {
console.error(err);
});
event.preventDefault();
this.setState({ showModal: false, characterCount: 250, value: "" });
}
render() {
return (
<div>
<Button
variant="outlined"
color="primary"
onClick={this.handleOpenModal}
>
Quote with Post
</Button>
<ReactModal
isOpen={this.state.showModal}
style={{
content: {
height: "50%",
width: "25%",
marginTop: "auto",
marginLeft: "auto",
marginRight: "auto",
marginBottom: "auto"
}
}}
>
<div style={{ width: "200px", marginLeft: "50px" }}>
<form style={{ width: "350px" }}>
{/* <textarea
value={this.state.value}
required
maxLength="250"
placeholder="Write Quoted Post here..."
onChange={e => {
this.handleChangeforPost(e);
this.handleChangeforCharacterCount(e);
}}
cols={40}
rows={20}
/> */}
<TextField
style={{ width: 300 }}
value={this.state.value}
label="Write Quoted Post here..."
required
multiline
color="primary"
rows="14"
variant="outlined"
inputProps={{
maxLength: 250
}}
onChange={e => {
this.handleChangeforPost(e);
this.handleChangeforCharacterCount(e);
}}
autoComplete="off"
></TextField>
<div style={{ fontSize: "14px", marginRight: "-100px" }}>
<p2>Characters Left: {this.state.characterCount}</p2>
</div>
<Button
variant="outlined"
color="primary"
onClick={this.handleSubmit}
>
Share Quoted Post
</Button>
<Button
variant="outlined"
color="primary"
onClick={this.handleCloseModal}
>
Cancel
</Button>
</form>
</div>
</ReactModal>
<Button
variant="outlined"
color="primary"
onClick={this.handleSubmitWithoutPost}
>
Quote without Post
</Button>
</div>
);
}
}
class Like extends Component {
constructor(props) {
super(props);
this.state = {
num: this.props.count
};
this.handleClick = this.handleClick.bind(this);
}
componentDidMount() {
this.setState({
like:
localStorage.getItem(this.props.microBlog + this.props.name) === "false"
});
}
handleClick(){
this.setState({
like: !this.state.like
});
localStorage.setItem(
this.props.microBlog + this.props.name,
this.state.like.toString()
);
if (this.state.like == false) {
this.setState(() => {
return { num: this.state.num + 1 };
});
axios
.get(`/like/${this.props.microBlog}`)
.then(res => {
console.log(res.data);
})
.catch(err => {
console.log(err);
});
} else {
this.setState(() => {
return { num: this.state.num - 1 };
});
axios
.get(`/unlike/${this.props.microBlog}`)
.then(res => {
console.log(res.data);
})
.catch(err => {
console.log(err);
});
}
}
/* componentDidMount() {
axios.get(`/checkforLikePost/${this.props.microBlog}`)
.then((res) => {
this.setState({
like2: res.data
})
console.log(res.data);
})
.catch((err) => {
console.log(err)
})
if (this.state.like2 === this.state.like)
{
this.setState({
like: false
})
}
} */
render() {
const label = this.state.like ? "Unlike" : "Like";
return (
<div>
<Typography variant="body2" color={"textSecondary"}>
Likes {this.state.num}
</Typography>
<button onClick={this.handleClick}>{label}</button>
</div>
);
}
}
const mapStateToProps = state => ({
user: state.user,
UI: state.UI
});
const mapActionsToProps = {
likePost,
unlikePost,
getLikes
};
Home.propTypes = {
user: PropTypes.object.isRequired,
likePost: PropTypes.func.isRequired,
unlikePost: PropTypes.func.isRequired,
getLikes: PropTypes.func.isRequired,
classes: PropTypes.object.isRequired,
UI: PropTypes.object.isRequired
};
Like.propTypes = {
user: PropTypes.object.isRequired
};
Quote.propTypes = {
user: PropTypes.object.isRequired
};
export default connect(
mapStateToProps,
mapActionsToProps
)(withStyles(styles)(Home, Like, Quote));

View File

@@ -16,13 +16,15 @@ import withStyles from "@material-ui/core/styles/withStyles";
// Redux stuff // Redux stuff
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { loginUser } from '../redux/actions/userActions'; import { loginUser } from '../redux/actions/userActions';
import { fontFamily } from '@material-ui/system';
//Theme
const styles = { const styles = {
form: { form: {
textAlign: "center" textAlign: "center"
}, },
textField: { textField: {
marginBottom: 30 marginBottom: 20
}, },
pageTitle: { pageTitle: {
// marginTop: 20, // marginTop: 20,
@@ -34,6 +36,9 @@ const styles = {
}, },
progress: { progress: {
position: "absolute" position: "absolute"
},
p: {
fontFamily: "cursive",
} }
}; };
@@ -104,14 +109,17 @@ export class Login extends Component {
<Grid item sm /> <Grid item sm />
<Grid item sm> <Grid item sm>
<img src={logo} className="app-logo" alt="logo" /> <img src={logo} className="app-logo" alt="logo" />
<Typography variant="h2" className={classes.pageTitle}> <br></br>
Log in to Twistter <Typography variant="h6" className={classes.pageTitle} fontFamily = "Georgia, serif">
<b>Log in to Twistter</b>
<br></br>
</Typography> </Typography>
<br></br>
<form noValidate onSubmit={this.handleSubmit}> <form noValidate onSubmit={this.handleSubmit}>
<TextField <TextField
id="email" id="email"
name="email" name="email"
label="Email*" label="Email or Username*"
className={classes.textField} className={classes.textField}
value={this.state.email} value={this.state.email}
helperText={errors.email} helperText={errors.email}
@@ -119,6 +127,7 @@ export class Login extends Component {
variant="outlined" variant="outlined"
onChange={this.handleChange} onChange={this.handleChange}
fullWidth fullWidth
autoComplete='off'
/> />
<TextField <TextField
id="password" id="password"
@@ -132,6 +141,7 @@ export class Login extends Component {
variant="outlined" variant="outlined"
onChange={this.handleChange} onChange={this.handleChange}
fullWidth fullWidth
autoComplete='off'
/> />
<Button <Button
type="submit" type="submit"
@@ -146,7 +156,7 @@ export class Login extends Component {
)} )}
</Button> </Button>
{errors.general && ( {errors.general && (
<Typography color="error">Wrong Email or Password</Typography> <Typography color="error">Invalid username/email or password</Typography>
)} )}
</form> </form>
</Grid> </Grid>

View File

@@ -0,0 +1,130 @@
import React, { Component } from "react";
// import props
// import { TextField, Button } from "@material-ui/core";
import TextField from "@material-ui/core/TextField"
import Grid from "@material-ui/core/Grid";
import axios from "axios";
import Fuse from "fuse.js";
import { BrowserRouter as Router } from "react-router-dom";
import CircularProgress from "@material-ui/core/CircularProgress";
const fuseOptions = {
shouldSort: true,
threshold: 0.6,
location: 0,
distance: 100,
maxPatternLength: 32,
minMatchCharLength: 1,
keys: []
};
let fuse;
export class Search extends Component {
state = {
handles: [],
// searchPhrase: null,
searchResult: null,
loading: false
};
componentDidMount() {
this.setState({loading: true});
axios.get("/getAllHandles")
.then((res) => {
this.setState({
handles: res.data,
loading: false
}, () => {
// console.log(res.data);
fuse = new Fuse(this.state.handles, fuseOptions); // "list" is the item array
})
})
}
// handleSearch = () => {
// console.log(this.state.searchPhase);
// axios.post("/getUserHandles", {
// userHandle: this.state.searchPhase
// })
// .then(res => {
// console.log(res);
// this.setState({
// searchResult: res.data
// });
// })
// .catch(err => {
// console.log(err);
// });
// };
handleChange = (event) => {
let result = fuse.search(event.target.value);
let parsed = [];
result.forEach((res) => {
// console.log(res)
parsed.push(this.state.handles[res])
})
this.setState({
searchResult: parsed.length !== 0 ? parsed : "No Results"
})
}
handleRedirect() {
location.reload();
}
render() {
let resultMarkup = this.state.searchResult && this.state.searchResult !== "No Results" ? (
this.state.searchResult.map(res =>
<Router key={res}>
<div>
<a href={`/user/${res}`}>
{res}
</a>
</div>
</Router>
)
)
:
this.state.searchResult === "No Results" ?
(
<p> No results </p>
)
:
(
null
)
return (
this.state.loading
?
<CircularProgress size={60} style={{marginTop: "300px"}}></CircularProgress>
:
<Grid>
<Grid>
<TextField
id="standard-required"
label="Username"
margin="normal"
// value={this.state.searchPhrase}
onChange={this.handleChange}
/>
</Grid>
<Grid>
{/* <Button color="primary" onClick={this.handleSearch}>
Search
</Button> */}
</Grid>
<Grid>{resultMarkup}</Grid>
</Grid>
);
}
}
export default Search;

View File

@@ -16,13 +16,17 @@ import withStyles from "@material-ui/core/styles/withStyles";
// Redux stuff // Redux stuff
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { signupUser } from '../redux/actions/userActions'; import { signupUser } from '../redux/actions/userActions';
import { border } from '@material-ui/system';
const styles = { const styles = {
form: { form: {
textAlign: "center" textAlign: "center"
}, },
textField: { textField: {
marginBottom: 30 marginBottom: 20,
//border: "1px solid #234",
display: "inline-block",
boxSizing: "border-box",
}, },
pageTitle: { pageTitle: {
marginBottom: 40 marginBottom: 40
@@ -33,6 +37,14 @@ const styles = {
}, },
progress: { progress: {
position: "absolute" position: "absolute"
},
div: {
borderRadius: "5px",
backgroundColor: "grey",
padding: "20px",
},
p: {
fontFamily: "Segoe UI",
} }
}; };
@@ -92,9 +104,12 @@ export class Signup extends Component {
<Grid item sm /> <Grid item sm />
<Grid item sm> <Grid item sm>
<img src={logo} className="app-logo" alt="logo" /> <img src={logo} className="app-logo" alt="logo" />
<Typography variant="h2" className={classes.pageTitle}> <br></br>
Create a new account <Typography variant="p" className={classes.pageTitle}>
<b>Create a new account</b>
<br></br>
</Typography> </Typography>
<br></br>
<form noValidate onSubmit={this.handleSubmit}> <form noValidate onSubmit={this.handleSubmit}>
<TextField <TextField
id="handle" id="handle"
@@ -107,6 +122,7 @@ export class Signup extends Component {
variant="outlined" variant="outlined"
onChange={this.handleChange} onChange={this.handleChange}
fullWidth fullWidth
autoComplete='off'
/> />
<TextField <TextField
id="email" id="email"
@@ -119,6 +135,7 @@ export class Signup extends Component {
variant="outlined" variant="outlined"
onChange={this.handleChange} onChange={this.handleChange}
fullWidth fullWidth
autoComplete='off'
/> />
<TextField <TextField
id="password" id="password"
@@ -132,6 +149,7 @@ export class Signup extends Component {
variant="outlined" variant="outlined"
onChange={this.handleChange} onChange={this.handleChange}
fullWidth fullWidth
autoComplete='off'
/> />
<TextField <TextField
id="confirmPassword" id="confirmPassword"
@@ -145,7 +163,10 @@ export class Signup extends Component {
variant="outlined" variant="outlined"
onChange={this.handleChange} onChange={this.handleChange}
fullWidth fullWidth
autoComplete='off'
/> />
<br></br>
<br></br>
<Button <Button
type="submit" type="submit"
variant="contained" variant="contained"
@@ -159,7 +180,7 @@ export class Signup extends Component {
)} )}
</Button> </Button>
{errors.general && ( {errors.general && (
<Typography color="error">Wrong Email or Password</Typography> <Typography color="error">Invalid username/email or password</Typography>
)} )}
</form> </form>
</Grid> </Grid>

View File

@@ -0,0 +1,677 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import _ from "underscore";
// Material UI
import Box from '@material-ui/core/Box';
import Button from '@material-ui/core/Button';
import Card from '@material-ui/core/Card';
import CircularProgress from '@material-ui/core/CircularProgress';
import Fab from '@material-ui/core/Fab';
import Grid from '@material-ui/core/Grid';
import Popover from '@material-ui/core/Popover';
import TextField from '@material-ui/core/TextField';
import Typography from '@material-ui/core/Typography';
import withStyles from '@material-ui/core/styles/withStyles';
// Material UI Icons
import AddCircleIcon from '@material-ui/icons/AddBox';
import CheckMarkIcon from '@material-ui/icons/Check';
import ErrorIcon from '@material-ui/icons/ErrorOutline';
import SendIcon from '@material-ui/icons/Send';
// Redux
import { connect } from 'react-redux';
import {
getDirectMessages,
createNewDirectMessage,
getNewDirectMessages,
reloadDirectMessageChannels,
sendDirectMessage
} from '../redux/actions/dataActions';
const styles = {
pageContainer: {
minHeight: 'calc(100vh - 50px - 60px)'
},
sidePadding: {
maxWidth: 350
},
dmList: {
width: 300,
marginLeft: 15
},
dmItemsUpper: {
marginBottom: 1,
// height: 'calc(100vh - 50px - 142px)',
minHeight: 100,
maxHeight: 'calc(100vh - 50px - 142px)',
overflow: "auto"
},
dmItemsLower: {
},
dmItemUsernameSelected: {
fontSize: 20,
color: 'white'
},
dmItemUsernameUnselected: {
fontSize: 20,
color: '#1da1f2'
},
dmItemTimeSelected: {
color: '#D6D6D6',
fontSize: 12,
float: 'right',
marginRight: 5,
marginTop: 5
},
dmItemTimeUnselected: {
color: 'black',
fontSize: 12,
float: 'right',
marginRight: 5,
marginTop: 5
},
dmRecentMessageSelected: {
wordBreak: "break-all",
color: '#D6D6D6'
},
dmRecentMessageUnselected: {
wordBreak: "break-all",
color: 'black'
},
dmRecentMessageDisabled: {
wordBreak: "break-all",
color: 'red'
},
dmListItemContainer: {
height: 100
},
dmListLayoutContainer: {
height: "100%"
},
dmListRecentMessage: {
marginLeft: 10,
marginRight: 10
},
dmListTextLayout: {
height: 30
},
dmCardUnselected: {
fontSize: 20,
backgroundColor: '#FFFFFF',
width: 300
},
dmCardSelected: {
fontSize: 20,
backgroundColor: '#1da1f2',
width: 300
},
messagesGrid: {
// // margin: "auto"
// height: "auto",
// width: "auto"
},
messagesBox: {
width: 450
},
messagesContainer: {
height: 'calc(100vh - 50px - 110px)',
overflow: 'auto',
width: 450,
marginLeft: 2,
marginRight: 17
},
fromMessage: {
minWidth: 150,
maxWidth: 350,
minHeight: 40,
marginRight: 2,
marginTop: 2,
marginBottom: 10,
backgroundColor: '#008394',
color: '#FFFFFF',
float: 'right'
},
toMessage: {
minWidth: 150,
maxWidth: 350,
minHeight: 40,
marginLeft: 15,
marginTop: 2,
marginBottom: 10,
backgroundColor: '#008394',
color: '#FFFFFF',
float: 'left'
},
messageContent: {
// maxWidth: 330,
// width: 330,
wordBreak: "break-all",
textAlign: 'left',
marginLeft: 5,
marginRight: 5
},
messageTime: {
color: '#D6D6D6',
textAlign: 'left',
marginLeft: 5,
fontSize: 12
},
writeMessage: {
backgroundColor: '#FFFFFF',
boxShadow: '0px 0px 5px 0px grey',
width: 450
},
messageTextField: {
width: 388
},
messageButton: {
backgroundColor: '#1da1f2',
marginTop: 8,
marginLeft: 2
},
loadingUsernameChecks: {
height: 55,
width: 55,
marginLeft: 5
},
errorIcon: {
height: 55,
width: 55,
marginLeft: 5,
color: '#ff3d00'
},
checkMarkIcon: {
height: 55,
width: 55,
marginLeft: 5,
color: '#1da1f2'
},
createButton: {
// textAlign: "center",
// display: "block",
marginLeft: 96,
marginRight: 96,
position: "relative"
}
};
export class directMessages extends Component {
constructor() {
super();
this.state = {
hasChannelSelected: false,
selectedChannel: null,
dmData: null,
anchorEl: null,
createDMUsername: '',
usernameValid: false,
// message: '',
drafts: {},
errors: null
};
}
componentDidUpdate() {
if (this.state.hasChannelSelected) {
document.getElementById('messagesContainer').scrollTop = document.getElementById(
'messagesContainer'
).scrollHeight;
}
}
componentDidMount() {
this.props.getDirectMessages();
// this.updatePage();
}
// Updates the state whenever redux is updated
componentWillReceiveProps(nextProps) {
if (nextProps.directMessages && !_.isEqual(nextProps.directMessages, this.state.dmData)) {
this.setState({ dmData: nextProps.directMessages}, () => {
if (this.state.selectedChannel) {
this.state.dmData.forEach((channel) => {
if (channel.dmId === this.state.selectedChannel.dmId) {
this.setState({
selectedChannel: channel
});
}
});
}
});
}
}
updatePage = async() => {
while (true) {
await this.sleep(15000);
// console.log("getting new DMs");
this.props.getNewDirectMessages();
}
}
sleep = (ms) => {
return new Promise(resolve => setTimeout(resolve, ms));
}
// Handles selecting different DM channels
handleClickChannel = (event) => {
this.setState({
hasChannelSelected: true
});
const dmItemsUpper = document.getElementById("dmItemsUpper");
let target = event.target;
let dmChannelKey;
// Determine which DM channel was clicked by finding the data-key.
// A while loop is necessary, because the user can click on any part of the
// DM list item. dmItemsUpper is the list container of the dmItems
while (target !== dmItemsUpper) {
dmChannelKey = target.dataset.key;
if (dmChannelKey) {
break;
} else {
target = target.parentNode;
}
}
// Save the entire DM channel in the state so that it is easier to load the messages
this.state.dmData.forEach((channel) => {
if (channel.dmId === dmChannelKey) {
this.setState({
selectedChannel: channel
});
}
});
};
formatDateToString(dateString) {
let newDate = new Date(Date.parse(dateString));
return newDate.toDateString();
}
formatDateToTimeDiff(dateString) {
return dayjs(dateString).fromNow();
}
shortenText = (text, length) => {
// Shorten the text
let shortened = text.slice(0, length + 1);
// Trim whitespace from the end of the text
if (shortened[shortened.length - 1] === ' ') {
shortened = shortened.trimRight();
}
// Add ... to the end
shortened = `${shortened}...`;
return shortened;
}
handleOpenAddDMPopover = (event) => {
this.setState({
anchorEl: event.currentTarget
});
};
handleCloseAddDMPopover = () => {
this.setState({
anchorEl: null,
createDMUsername: '',
usernameValid: false
});
};
handleChangeAddDMUsername = (event) => {
this.setState({
createDMUsername: event.target.value
});
};
handleClickCreate = () => {
this.props.createNewDirectMessage(this.state.createDMUsername)
.then(() => {
return this.props.reloadDirectMessageChannels();
})
.then(() => {
this.handleCloseAddDMPopover();
return;
})
.catch(() => {
return;
})
}
handleChangeMessage = (event) => {
let drafts = this.state.drafts;
drafts[this.state.selectedChannel.dmId] = event.target.value;
this.setState({
drafts
});
}
handleClickSend = () => {
// console.log(this.state.drafts[this.state.selectedChannel.dmId]);
let drafts = this.state.drafts;
if (this.state.hasChannelSelected && drafts[this.state.selectedChannel.dmId]) {
this.props.sendDirectMessage(this.state.selectedChannel.recipient, drafts[this.state.selectedChannel.dmId]);
drafts[this.state.selectedChannel.dmId] = null;
this.setState({
drafts
});
}
}
render() {
const { classes, user: { credentials: { dmEnabled } } } = this.props;
const loadingDirectMessages = this.props.UI.loading2;
const creatingDirectMessage = this.props.UI.loading3;
const sendingDirectMessage = this.props.UI.loading4;
let errors = this.props.UI.errors ? this.props.UI.errors : {};
dayjs.extend(relativeTime);
// Used for the add button on the dmList
const open = Boolean(this.state.anchorEl);
const id = open ? 'simple-popover' : undefined;
let dmListMarkup = this.state.dmData ? (
this.state.dmData.map((channel) => (
<Card
onClick={this.handleClickChannel}
key={channel.dmId}
data-key={channel.dmId}
className={
this.state.selectedChannel && this.state.selectedChannel.dmId === channel.dmId ? classes.dmCardSelected : classes.dmCardUnselected
}
>
<Box className={classes.dmListItemContainer}>
<Grid container direction="column" className={classes.dmListLayoutContainer} spacing={1}>
<Grid item>
<Grid container className={classes.dmListTextLayout}>
<Grid item sm />
<Grid item sm>
<Typography
className={
this.state.selectedChannel && this.state.selectedChannel.dmId === channel.dmId ? (
classes.dmItemUsernameSelected
) : (
classes.dmItemUsernameUnselected
)
}
>
{channel.recipient}
</Typography>
</Grid>
<Grid item sm>
<Typography
className={
this.state.selectedChannel && this.state.selectedChannel.dmId === channel.dmId ? (
classes.dmItemTimeSelected
) : (
classes.dmItemTimeUnselected
)
}
>
{channel.recentMessageTimestamp ? (
this.formatDateToTimeDiff(channel.recentMessageTimestamp)
) : null}
</Typography>
</Grid>
</Grid>
</Grid>
<Grid item className={classes.dmListRecentMessage}>
<Typography
className={
this.state.selectedChannel && this.state.selectedChannel.dmId === channel.dmId ? (
channel.hasDirectMessagesEnabled ?
classes.dmRecentMessageSelected
:
classes.dmRecentMessageDisabled
) : (
channel.hasDirectMessagesEnabled ?
classes.dmRecentMessageUnselected
:
classes.dmRecentMessageDisabled
)
}
>
{!channel.hasDirectMessagesEnabled ? "This user has DMs disabled" :
!channel.recentMessage ?
'No messages'
:
channel.recentMessage.length > 65 ?
this.shortenText(channel.recentMessage, 65)
:
channel.recentMessage
}
</Typography>
</Grid>
</Grid>
</Box>
</Card>
))
) : (
<p>You don't have any DMs yet</p>
)
let messagesMarkup =
this.state.selectedChannel !== null ? this.state.selectedChannel.messages.length > 0 ? (
this.state.selectedChannel.messages.map((messageObj) => (
<Grid item key={messageObj.messageId}>
<Card
className={
messageObj.author === this.state.selectedChannel.recipient ? (
classes.toMessage
) : (
classes.fromMessage
)
}
>
<Typography className={classes.messageContent}>{messageObj.message}</Typography>
<Typography className={classes.messageTime}>
{this.formatDateToString(messageObj.createdAt)}
</Typography>
</Card>
</Grid>
))
) : (
<p>No DMs here</p>
) : (
<p>Select a DM channel</p>
);
let addDMMarkup = (
<div>
<AddCircleIcon
style={{
color: '#1da1f2',
height: 82,
width: 82,
marginTop: 9,
cursor: 'pointer'
}}
aria-describedby={id}
onClick={this.handleOpenAddDMPopover}
/>
<Popover
id={id}
open={open}
anchorEl={this.state.anchorEl}
onClose={this.handleCloseAddDMPopover}
anchorOrigin={{
vertical: 'center',
horizontal: 'center'
}}
transformOrigin={{
vertical: 'top',
horizontal: 'center'
}}
>
<Box
style={{
height: 200,
width: 400
}}
>
<Grid container>
<Grid item sm />
<Grid item style={{ height: 200, width: 285 }}>
<Grid container direction="column" spacing={2}>
<Grid item>
<Typography style={{ marginTop: 15 }}>
Who would you like to start a DM with?
</Typography>
</Grid>
<Grid item>
<TextField
onChange={this.handleChangeAddDMUsername}
value={this.state.createDMUsername}
label="Username"
variant="outlined"
helperText={errors.createDirectMessage}
error={errors.createDirectMessage ? true : false}
style={{
width: 265,
marginRight: 10,
marginLeft: 10,
textAlign: 'center',
}}
/>
</Grid>
<Grid item>
<Button
className={classes.createButton}
variant="outlined"
color="primary"
onClick={this.handleClickCreate}
disabled={
creatingDirectMessage ||
this.state.createDMUsername === ""
}
>
Create
{creatingDirectMessage &&
// Won't accept classes style for some reason
<CircularProgress size={30} style={{position: "absolute"}}/>
}
</Button>
</Grid>
</Grid>
</Grid>
<Grid item sm />
</Grid>
</Box>
</Popover>
</div>
);
return (
loadingDirectMessages ? <CircularProgress size={60} style={{marginTop: "300px"}}></CircularProgress> :
(dmEnabled !== undefined && dmEnabled !== null && !dmEnabled ? <Typography>Oops! It looks like you have DMs disabled. You can enable them on the Edit Profile page.</Typography> :
<Grid container className={classes.pageContainer}>
<Grid item className={classes.sidePadding} sm />
<Grid item className={classes.dmList}>
<Grid container direction="column">
<Grid item className={classes.dmItemsUpper} id="dmItemsUpper">
{dmListMarkup}
</Grid>
<Grid item className={classes.dmItemsLower}>
<Card key="5555" data-key="5555" className={classes.dmCardUnselected}>
<Box className={classes.dmListItemContainer}>
{addDMMarkup}
</Box>
</Card>
</Grid>
</Grid>
</Grid>
<Grid item className={classes.messagesGrid} sm>
<Box>
{this.state.hasChannelSelected && (
<Card className={classes.messagesBox}>
<Box className={classes.messagesContainer} id="messagesContainer">
<Grid container direction="column">
{messagesMarkup}
</Grid>
</Box>
<Box className={classes.writeMessage}>
<TextField
className={classes.messageTextField}
variant="outlined"
multiline
rows={2}
margin="dense"
disabled={!this.state.selectedChannel.hasDirectMessagesEnabled}
value={
!this.state.selectedChannel.hasDirectMessagesEnabled ?
"This user has DMs disabled"
:
this.state.drafts[this.state.selectedChannel.dmId] ?
this.state.drafts[this.state.selectedChannel.dmId]
:
""
}
onChange={this.handleChangeMessage}
/>
<Fab
className={classes.messageButton}
onClick={this.handleClickSend}
disabled={
sendingDirectMessage ||
!this.state.drafts[this.state.selectedChannel.dmId] ||
this.state.drafts[this.state.selectedChannel.dmId] === ""
}
>
<SendIcon style={{ color: '#FFFFFF' }} />
{
sendingDirectMessage &&
<CircularProgress size={30} style={{position: "absolute"}}/>
// Won't accept classes style for some reason
}
</Fab>
</Box>
</Card>
)}
{!this.state.hasChannelSelected &&
this.state.dmData && <Typography>Select a DM on the left</Typography>}
</Box>
</Grid>
<Grid item className={classes.sidePadding} sm />
</Grid>
)
);
}
}
directMessages.propTypes = {
classes: PropTypes.object.isRequired,
getDirectMessages: PropTypes.func.isRequired,
createNewDirectMessage: PropTypes.func.isRequired,
getNewDirectMessages: PropTypes.func.isRequired,
reloadDirectMessageChannels: PropTypes.func.isRequired,
sendDirectMessage: PropTypes.func.isRequired,
user: PropTypes.object.isRequired,
UI: PropTypes.object.isRequired
};
const mapStateToProps = (state) => ({
user: state.user,
UI: state.UI,
directMessages: state.data.directMessages
});
const mapActionsToProps = {
getDirectMessages,
createNewDirectMessage,
getNewDirectMessages,
reloadDirectMessageChannels,
sendDirectMessage
};
export default connect(mapStateToProps, mapActionsToProps)(withStyles(styles)(directMessages));

View File

@@ -1,16 +1,28 @@
import React, { Component } from "react"; import React, { Component } from "react";
import { Link } from 'react-router-dom';
import axios from "axios"; import axios from "axios";
import PropTypes from "prop-types"; import PropTypes from "prop-types";
// TODO: Add a read-only '@' in the left side of the handle input
// TODO: Add a cancel button, that takes the user back to their profile page import noImage from '../images/no-img.png';
// Material-UI stuff // Material-UI stuff
import Box from "@material-ui/core/Box"
import Button from "@material-ui/core/Button"; import Button from "@material-ui/core/Button";
import CircularProgress from "@material-ui/core/CircularProgress"; import CircularProgress from "@material-ui/core/CircularProgress";
import Grid from "@material-ui/core/Grid"; import Grid from "@material-ui/core/Grid";
import Popover from "@material-ui/core/Popover";
import TextField from "@material-ui/core/TextField"; import TextField from "@material-ui/core/TextField";
import Typography from "@material-ui/core/Typography"; import Typography from "@material-ui/core/Typography";
import withStyles from "@material-ui/core/styles/withStyles"; import withStyles from "@material-ui/core/styles/withStyles";
import FormControlLabel from "@material-ui/core/FormControlLabel";
import Switch from "@material-ui/core/Switch";
import IconButton from "@material-ui/core/IconButton";
import EditIcon from "@material-ui/icons/Edit";
import Tooltip from "@material-ui/core/Tooltip";
// Redux stuff
import { connect } from "react-redux";
import { uploadImage } from "../redux/actions/userActions";
const styles = { const styles = {
form: { form: {
@@ -27,34 +39,77 @@ const styles = {
positon: "relative", positon: "relative",
marginBottom: 30 marginBottom: 30
}, },
box: {
position: "relative"
},
back: {
float: "left",
marginLeft: 15
},
delete: {
float: "right",
marginRight: 15
},
progress: { progress: {
position: "absolute" position: "absolute"
},
uploadProgress: {
position: "absolute",
marginLeft: -155,
marginTop: 95
},
popoverBackground: {
marginTop: "-100px",
width: "calc(100vw)",
height: 'calc(100vh + 100px)',
backgroundColor: "gray",
position: "absolute",
opacity: "70%"
} }
}; };
export class edit extends Component { export class editProfile extends Component {
// mapReduxToState = (credentials) => {
// this.setState({
// imageUrl: credentials.imageUrl ? credentials.imageUrl : noImage,
// firstName: credentials.firstName ? credentials.firstName : '',
// lastName: credentials.lastName ? credentials.lastName : '',
// email: credentials.email ? credentials.email : 'error, email doesn\'t exist',
// handle: credentials.handle ? credentials.handle : 'error, handle doesn\'t exist',
// bio: credentials.bio ? credentials.bio : ''
// });
// };
// Runs as soon as the page loads. // Runs as soon as the page loads.
// Sets the default values of all the textboxes to the data // Sets the default values of all the textboxes to the data
// that is stored in the database for the user. // that is stored in the database for the user.
componentDidMount() { componentDidMount() {
// const { credentials } = this.props;
// console.log(this.props.user);
// this.mapReduxToState(credentials);
this.setState({pageLoading: true})
axios axios
.get("/getProfileInfo") .get("/getProfileInfo")
.then((res) => { .then((res) => {
// Need to have the ternary if statements, because react throws an error if
// any of the res.data keys are undefined
this.setState({ this.setState({
firstName: res.data.firstName, imageUrl: res.data.imageUrl,
lastName: res.data.lastName, firstName: res.data.firstName ? res.data.firstName : "",
lastName: res.data.lastName ? res.data.lastName : "",
email: res.data.email, email: res.data.email,
handle: res.data.handle, handle: res.data.handle,
bio: res.data.bio bio: res.data.bio ? res.data.bio : "",
dmEnabled: res.data.dmEnabled === false ? false : true,
pageLoading: false
}); });
}) })
.catch((err) => { .catch((err) => {
console.error(err); console.error(err);
if (err.response.status === 403) { if (err.response.status === 403) {
alert("You are not logged in"); // This user is not logged in
// TODO: Redirect them, to the profile they are trying to edit this.props.history.push('/');
// If they are on /itsjimmy/edit, they will be redirected to /itsjimmy
this.props.history.push('../');
} }
}); });
} }
@@ -63,12 +118,17 @@ export class edit extends Component {
constructor() { constructor() {
super(); super();
this.state = { this.state = {
imageUrl: "",
firstName: "", firstName: "",
lastName: "", lastName: "",
email: "", email: "",
handle: "", handle: "",
bio: "", bio: "",
dmEnabled: false,
togglingDirectMessages: false,
anchorEl: null,
loading: false, loading: false,
pageLoading: false,
errors: {} errors: {}
}; };
} }
@@ -88,6 +148,14 @@ export class edit extends Component {
handle: this.state.handle, handle: this.state.handle,
bio: this.state.bio bio: this.state.bio
}; };
// Removes all keys from newProfileData that are empty, undefined, or null
Object.keys(newProfileData).forEach(key => {
if (newProfileData[key] === "" || newProfileData[key] === undefined || newProfileData[key] === null) {
delete newProfileData[key];
}
})
axios axios
.post("/updateProfileInfo", newProfileData) .post("/updateProfileInfo", newProfileData)
.then((res) => { .then((res) => {
@@ -95,11 +163,11 @@ export class edit extends Component {
this.setState({ this.setState({
loading: false loading: false
}); });
// this.props.history.push('/'); this.props.history.push('/user');
// TODO: Need to redirect user to their profile page
}) })
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
// TODO: Should redirect to login page if they get a 403
this.setState({ this.setState({
errors: err.response.data, errors: err.response.data,
loading: false loading: false
@@ -120,18 +188,129 @@ export class edit extends Component {
}); });
}; };
handleDMSwitch = () => {
let enable;
if (this.state.dmEnabled) {
enable = {enable: false};
} else {
enable = {enable: true};
}
this.setState({
dmEnabled: enable.enable,
togglingDirectMessages: true
});
axios.post("/dms/toggle", enable)
.then(() => {
this.setState({
togglingDirectMessages: false
});
})
}
handleImageChange = (event) => {
if (event.target.files[0]) {
const image = event.target.files[0];
const formData = new FormData();
formData.append('image', image, image.name);
this.props.uploadImage(formData);
}
}
handleEditPicture = () => {
const fileInput = document.getElementById('imageUpload');
fileInput.click();
}
// logging = () => {
// console.log(this.state);
// console.log(this.props);
// this.mapReduxToState(this.props.credentials);
// }
handleOpenConfirmDelete = (event) => {
this.setState({
// anchorEl: event.currentTarget
anchorEl: document.getElementById("container-grid")
});
};
handleCloseConfirmDelete = () => {
this.setState({
anchorEl: null,
createDMUsername: ''
});
};
render() { render() {
const { classes } = this.props; const { classes } = this.props;
const uploading = this.props.UI.loading;
const { errors, loading } = this.state; const { errors, loading } = this.state;
let imageMarkup = this.props.user.credentials.imageUrl ? (
<Box
// className={classes.box}
>
<img
src={this.props.user.credentials.imageUrl}
height="250"
width="250"
className={classes.box}/>
{uploading && (
<CircularProgress size={60} className={classes.uploadProgress} />
)}
</Box>
) : (
<Box
// className={classes.box}
>
<img
src={noImage}
height="250"
width="250"
className={classes.box}/>
{uploading && (
<CircularProgress size={60} className={classes.uploadProgress} />
)}
</Box>
)
// Used for the delete button
const open = Boolean(this.state.anchorEl);
const id = open ? 'simple-popover' : undefined;
return ( return (
<Grid container className={classes.form}> this.state.pageLoading ?
<Grid item sm /> <CircularProgress size={60} style={{marginTop: "300px"}}></CircularProgress>
:
<Grid container className={classes.form} id="container-grid">
<Grid item sm >
<Button
variant="outlined"
color="primary"
// className={classes.button}
disabled={loading || uploading}
className={classes.back}
component={ Link }
to='/user'
>
Back to Profile
</Button>
</Grid>
<Grid item sm> <Grid item sm>
<Typography variant="h2" className={classes.pageTitle}> <Typography variant="h2" className={classes.pageTitle}>
Edit Profile Edit Profile
</Typography> </Typography>
<form noValidate onSubmit={this.handleSubmit}> <form noValidate onSubmit={this.handleSubmit}>
{imageMarkup}
<input type="file" id="imageUpload" onChange={this.handleImageChange} hidden = "hidden"/>
<Tooltip title="Edit profile picture" placement="top">
<IconButton onClick={this.handleEditPicture} className="button">
<EditIcon color="primary"/>
</IconButton></Tooltip>
<Grid container className={classes.form} spacing={4}> <Grid container className={classes.form} spacing={4}>
<Grid item sm> <Grid item sm>
<TextField <TextField
@@ -145,6 +324,7 @@ export class edit extends Component {
variant="outlined" variant="outlined"
onChange={this.handleChange} onChange={this.handleChange}
fullWidth fullWidth
autoComplete='off'
/> />
</Grid> </Grid>
<Grid item sm> <Grid item sm>
@@ -159,6 +339,7 @@ export class edit extends Component {
variant="outlined" variant="outlined"
onChange={this.handleChange} onChange={this.handleChange}
fullWidth fullWidth
autoComplete='off'
/> />
</Grid> </Grid>
</Grid> </Grid>
@@ -176,13 +357,14 @@ export class edit extends Component {
variant="outlined" variant="outlined"
onChange={this.handleChange} onChange={this.handleChange}
fullWidth fullWidth
autoComplete='off'
/> />
<TextField <TextField
id="handle" id="handle"
name="handle" name="handle"
label="Handle*" label="Handle*"
className={classes.textField} className={classes.textField}
value={this.state.handle} value={"@" + this.state.handle}
disabled disabled
helperText="(disabled)" helperText="(disabled)"
// INFO: These will be uncommented if changing usernames is allowed // INFO: These will be uncommented if changing usernames is allowed
@@ -191,6 +373,7 @@ export class edit extends Component {
variant="outlined" variant="outlined"
onChange={this.handleChange} onChange={this.handleChange}
fullWidth fullWidth
autoComplete='off'
/> />
<TextField <TextField
id="bio" id="bio"
@@ -205,29 +388,124 @@ export class edit extends Component {
variant="outlined" variant="outlined"
onChange={this.handleChange} onChange={this.handleChange}
fullWidth fullWidth
autoComplete='off'
/> />
<FormControlLabel
control={
<Switch
color="primary"
disabled={this.state.togglingDirectMessages}
checked={this.state.dmEnabled}
onChange={this.handleDMSwitch}
/>
}
label="Enable Direct Messages"
/>
<br></br>
<Button <Button
type="submit" type="submit"
variant="contained" variant="contained"
color="primary" color="primary"
className={classes.button} className={classes.button}
disabled={loading} disabled={loading}
//component={ Link }
//to='/user'
> >
Submit Submit
{loading && ( {loading && (
<CircularProgress size={30} className={classes.progress} /> <CircularProgress size={30} className={classes.progress} />
)} )}
</Button> </Button>
</form> </form>
</Grid> </Grid>
<Grid item sm /> <Grid item sm>
<Button
variant="outlined"
color="secondary"
className={classes.delete}
onClick={this.handleOpenConfirmDelete}
>
Delete Account
</Button>
</Grid>
<Box hidden={!Boolean(this.state.anchorEl)} className={classes.popoverBackground}></Box>
<Popover
id={id}
open={open}
anchorEl={this.state.anchorEl}
onClose={this.handleCloseConfirmDelete}
anchorOrigin={{
vertical: 'center',
horizontal: 'center'
}}
transformOrigin={{
vertical: 'top',
horizontal: 'center'
}}
style={{
marginTop: "-200px"
}}
>
<Box
style={{
height: 200,
width: 400
}}
>
<Grid container direction="column" spacing={3}>
<Grid item>
<Typography style={{marginTop: 30, marginLeft: 50, marginRight: 50, textAlign: "center", fontSize: 24}}>Are you sure you want to delete your account?</Typography>
</Grid>
<Grid item>
<Button
color="secondary"
variant="contained"
component={ Link }
to='/delete'
style={{
marginBottom: "-40px",
marginLeft: 10,
width: 90
}}
>
Yes
</Button>
<Button
color="primary"
variant="outlined"
onClick={this.handleCloseConfirmDelete}
style={{
marginBottom: "-40px",
marginLeft: 195
}}
>
Cancel
</Button>
</Grid>
</Grid>
</Box>
</Popover>
</Grid> </Grid>
); );
} }
} }
edit.propTypes = {
classes: PropTypes.object.isRequired const mapStateToProps = (state) => ({
user: state.user,
UI: state.UI,
// credentials: state.user.credentials
});
const mapActionsToProps = { uploadImage }
editProfile.propTypes = {
uploadImage: PropTypes.func.isRequired,
classes: PropTypes.object.isRequired,
user: PropTypes.object.isRequired,
UI: PropTypes.object.isRequired
}; };
export default withStyles(styles)(edit); // export default withStyles(styles)(edit);
export default connect(mapStateToProps, mapActionsToProps)(withStyles(styles)(editProfile));

View File

@@ -0,0 +1,360 @@
/* eslint-disable */
import React, { Component } from "react";
import PropTypes from "prop-types";
import { connect } from "react-redux";
import axios from "axios";
//import '../App.css';
// Material UI and React Router
import { makeStyles, styled } from "@material-ui/core/styles";
import withStyles from "@material-ui/core/styles/withStyles";
import { Link } from "react-router-dom";
import Card from "@material-ui/core/Card";
import CardMedia from "@material-ui/core/CardMedia";
import CardContent from "@material-ui/core/CardContent";
import Button from "@material-ui/core/Button";
import Grid from "@material-ui/core/Grid";
import Chip from "@material-ui/core/Chip";
import Typography from "@material-ui/core/Typography";
import AddCircle from "@material-ui/icons/AddCircle";
import TextField from "@material-ui/core/TextField";
import VerifiedIcon from "@material-ui/icons/CheckSharp";
import DoneIcon from "@material-ui/icons/Done";
import CircularProgress from "@material-ui/core/CircularProgress";
// component
import "../App.css";
import noImage from "../images/no-img.png";
import Writing_Microblogs from "../Writing_Microblogs";
const MyChip = styled(Chip)({
margin: 2,
color: "primary"
});
const styles = {
button: {
positon: "relative",
float: "left",
marginLeft: 30,
marginTop: 20
},
paper: {
// marginLeft: "10%",
// marginRight: "10%"
},
card: {
marginBottom: 5
},
profileImage: {
marginTop: 20
},
topicsContainer: {
border: "lightgray solid 1px",
marginTop: 20,
paddingTop: 10,
paddingBottom: 10,
height: 300
},
addCircle: {
width: 65,
height: 65,
marginTop: 10
},
username: {
marginBottom: 100
}
};
class user extends Component {
constructor() {
super();
this.state = {
profile: window.location.pathname.split("/").pop(),
imageUrl: null,
topics: null,
user: null,
following: null,
posts: null,
myTopics: null,
followingList: null,
loading: false
};
}
handleSub = () => {
if (this.state.following === true) {
axios
.post("/removeSub", {
unfollow: this.state.profile
})
.then(res => {
console.log("removed sub");
this.setState({
following: false,
myTopics: []
});
})
.catch(function(err) {
console.log(err);
});
} else {
axios
.post("/addSubscription", {
following: this.state.profile
})
.then(res => {
console.log("adding sub");
this.setState({
following: true
});
})
.catch(function(err) {
console.log(err);
});
}
};
handleAdd = newTopic => {
axios
.post("/putNewTopic", {
handle: this.state.profile,
topic: newTopic
})
.then(() => {
let temp = this.state.myTopics;
temp.push(newTopic);
this.setState({
myTopics: temp
});
})
.catch(err => {
console.err(err);
});
};
componentDidMount() {
this.setState({ loading: true });
let otherUserPromise = axios
.post("/getUserDetails", {
handle: this.state.profile
})
.then(res => {
this.setState({
imageUrl: res.data.userData.imageUrl,
topics: res.data.userData.followedTopics
});
})
.catch(err => console.log(err));
let userPromise = axios
.get("/user")
.then(res => {
let list = [];
let fol = false;
res.data.credentials.following.forEach(follow => {
// console.log(follow);
if (this.state.profile === follow.handle) {
fol = true;
list = follow.topics;
}
});
this.setState({
following: fol,
myTopics: list
});
})
.catch(err => console.log(err));
let posts = axios
.post("/getOtherUsersPosts", {
handle: this.state.profile
})
.then(res => {
// console.log(res.data);
this.setState({
posts: res.data
});
})
.catch(err => console.log(err));
// Only add Admin posts if this is not the Admin account
let alertPromise;
if (this.state.profile !== "Admin") {
alertPromise = axios
.get("/getAlert")
.then(res => {
let temp = this.state.posts;
// console.log(res.data);
res.data.forEach(element => {
element ? temp.push(element) : console.err;
});
// temp.push(res.data[0]);
this.setState({
posts: temp
});
})
.catch(function(err) {
console.log(err);
});
} else {
alertPromise = new Promise((resolve, reject) => {
resolve();
});
}
Promise.all([otherUserPromise, userPromise, posts, alertPromise])
.then(() => {
this.setState({ loading: false });
})
.catch(error => {
console.log(error);
});
}
formatDate(dateString) {
let newDate = new Date(Date.parse(dateString));
return newDate.toDateString();
}
render() {
const { classes } = this.props;
let followMarkup = this.state.following ? (
<Button variant="contained" color="primary" onClick={this.handleSub}>
unfollow
</Button>
) : (
<Button variant="contained" color="primary" onClick={this.handleSub}>
follow
</Button>
);
let profileMarkup = this.state.profile ? (
<div>
<Typography variant="h5">
@{this.state.profile}{" "}
{this.state.verified ? (
<VerifiedIcon style={{ fill: "#1397D5" }} />
) : null}
</Typography>
{followMarkup}
</div>
) : (
<p>loading username...</p>
);
// console.log(this.state.topics);
// console.log(this.state.myTopics);
let topicsMarkup = this.state.topics ? (
this.state.topics.map(
topic =>
this.state.myTopics ? (
this.state.myTopics.includes(topic) ? (
<MyChip
label={topic}
key={{ topic }.id}
onDelete
deleteIcon={<DoneIcon />}
/>
) : this.state.following ? (
<MyChip
label={topic}
key={{ topic }.id}
color="secondary"
clickable
onClick={key => this.handleAdd(topic)}
/>
) : (
<MyChip label={topic} key={{ topic }.id} color="secondary" />
)
) : (
<p></p>
)
// topic => <MyChip label={topic} key={{ topic }.topic.id} /> // console.log({ topic }.topic.id)
)
) : (
<p> no topic yet</p>
);
let imageMarkup = this.state.imageUrl ? (
<img src={this.state.imageUrl} height="150" width="150" />
) : (
<img src={noImage} height="150" width="150" />
);
//(this.state.posts);
let postMarkup = this.state.posts ? (
this.state.posts.map(post => (
<Card className={classes.card} key={post.postId} data-key={post.postId}>
<CardContent>
<Typography>
{this.state.imageUrl ? (
<img src={this.state.imageUrl} height="50" width="50" />
) : (
<img src={noImage} height="50" width="50" />
)}
</Typography>
<Typography variant="h4">
<b>{post.userHandle}</b>
</Typography>
<Typography variant="body2" color={"textSecondary"}>
{this.formatDate(post.createdAt)}
</Typography>
<br />
<Typography variant="body1">
<b>{post.microBlogTitle}</b>
</Typography>
<Typography variant="body2">{post.quoteBody}</Typography>
<br />
<Typography variant="body2">{post.body}</Typography>
<br />
<Typography variant="body2">
<b>Topics:</b> {post.microBlogTopics.join(", ")}
</Typography>
<br />
<Typography variant="body2" color={"textSecondary"}>
Likes {post.likeCount}
</Typography>
</CardContent>
</Card>
))
) : (
<p>Posts</p>
);
return this.state.loading ? (
<CircularProgress
size={60}
style={{ marginTop: "300px" }}
></CircularProgress>
) : (
<Grid container spacing={10}>
<Grid item sm={4} xs={8}>
{imageMarkup}
{profileMarkup}
{/* {followMarkup} */}
{topicsMarkup}
<br />
</Grid>
<Grid item sm={4} xs={8}>
{postMarkup}
<br />
</Grid>
</Grid>
);
}
}
const mapStateToProps = state => ({
user: state.user
});
user.propTypes = {
user: PropTypes.object.isRequired,
classes: PropTypes.object.isRequired
};
export default connect(mapStateToProps)(withStyles(styles)(user));

View File

@@ -1,49 +1,349 @@
/* eslint-disable */ /* eslint-disable */
import React, { Component } from 'react'; import React, { Component } from "react";
import axios from 'axios'; import PropTypes from "prop-types";
import { connect } from "react-redux";
import axios from "axios";
//import '../App.css'; //import '../App.css';
import { makeStyles, styled } from '@material-ui/core/styles'; // Material-UI
import Grid from '@material-ui/core/Grid'; import withStyles from "@material-ui/core/styles/withStyles";
import Card from '@material-ui/core/Card'; import { makeStyles, styled } from "@material-ui/core/styles";
import CardMedia from '@material-ui/core/CardMedia'; import { Link } from "react-router-dom";
import CardContent from '@material-ui/core/CardContent'; import Card from "@material-ui/core/Card";
import Chip from '@material-ui/core/Chip'; import CardMedia from "@material-ui/core/CardMedia";
import Paper from '@material-ui/core/Paper'; import CardContent from "@material-ui/core/CardContent";
import Button from "@material-ui/core/Button";
import Grid from "@material-ui/core/Grid";
import CircularProgress from "@material-ui/core/CircularProgress";
import Chip from "@material-ui/core/Chip";
import Typography from "@material-ui/core/Typography";
import AddCircle from "@material-ui/icons/AddCircle";
import TextField from "@material-ui/core/TextField";
import VerifiedIcon from "@material-ui/icons/CheckSharp";
import Paper from "@material-ui/core/Paper";
import GridList from "@material-ui/core/GridList";
import GridListTile from "@material-ui/core/GridListTile";
import GridListTileBar from "@material-ui/core/GridListTileBar";
import Container from "@material-ui/core/Container";
const PostCard = styled(Card)({ // component
background: 'linear-gradient(45deg, #1da1f2 90%)', import "../App.css";
border: 3, import noImage from "../images/no-img.png";
borderRadius: 3, import Writing_Microblogs from "../Writing_Microblogs";
height:325,
width: 345, const MyChip = styled(Chip)({
padding: '0 30px', margin: 2,
color: "primary"
}); });
const styles = {
button: {
positon: "relative",
float: "left",
marginLeft: 30,
marginTop: 20
},
paper: {
// marginLeft: "10%",
// marginRight: "10%"
},
card: {
marginBottom: 5
},
profileImage: {
marginTop: 20
},
topicsContainer: {
border: "lightgray solid 1px",
marginTop: 20,
paddingTop: 10,
paddingBottom: 10,
height: 300
},
addCircle: {
width: 65,
height: 65,
marginTop: 10
},
username: {
marginBottom: 100
}
};
class user extends Component { class user extends Component {
constructor() {
super();
this.state = {
profile: null,
imageUrl: null,
topics: null,
newTopic: "",
loading: false
};
}
handleDelete = topic => {
console.log(topic);
axios
.post(`/deleteTopic`, {
unfollow: topic
})
.then(() => {
let tempTopics = this.state.topics;
tempTopics.forEach((oldTopic, index) => {
if (oldTopic === topic) {
tempTopics.splice(index, 1);
}
});
this.setState({
topics: tempTopics
});
})
.catch(function(err) {
console.log(err);
});
};
handleAddCircle = () => {
axios
.post("/putTopic", {
following: this.state.newTopic
})
.then(() => {
let tempTopics = this.state.topics;
tempTopics.push(this.state.newTopic);
this.setState({
topics: tempTopics,
newTopic: ""
});
})
.catch(function(err) {
console.log(err);
});
};
handleChange(event) {
this.setState({
newTopic: event.target.value
});
}
componentDidMount() { componentDidMount() {
//TODO: get user details this.setState({loading: true})
//TODO: get posts let userPromise = axios
.get("/user")
.then(res => {
this.setState({
profile: res.data.credentials.handle,
imageUrl: res.data.credentials.imageUrl,
verified: res.data.credentials.verified
? res.data.credentials.verified
: false,
topics: res.data.credentials.followedTopics
});
})
.catch(err => console.log(err));
let postsPromise = axios
.get("/getallPostsforUser")
.then(res => {
// console.log(res.data);
this.setState({
posts: res.data
});
})
.catch(err => console.log(err));
Promise.all([userPromise, postsPromise])
.then(() => {
this.setState({loading: false});
})
.catch((error) => {
console.log(error)
})
}
formatDate(dateString) {
let newDate = new Date(Date.parse(dateString));
return newDate.toDateString();
} }
render() { render() {
const { classes } = this.props;
let authenticated = this.props.user.authenticated;
let profileMarkup = this.state.profile ? (
<div>
<Typography variant="h5" className={classes.username}>
@{this.state.profile}{" "}
{this.state.verified ? (
<VerifiedIcon style={{ fill: "#1397D5" }} />
) : null}
</Typography>
</div>
) : (
<p className={classes.username}>loading username...</p>
);
let topicsMarkup = this.state.topics ? (
this.state.topics.map(
topic => (
<MyChip
label={topic}
key={topic}
onDelete={key => this.handleDelete(topic)}
/>
) // console.log({ topic }.topic.id)
)
) : (
<p> loading topics...</p>
);
let imageMarkup = this.state.imageUrl ? (
<img
className={classes.profileImage}
src={this.state.imageUrl}
height="250"
width="250"
/>
) : (
<img
className={classes.profileImage}
src={noImage}
height="250"
width="250"
/>
);
let postMarkup = this.state.posts ? (
this.state.posts.map(post => (
<Card className={classes.card} key={post.postId}>
<CardContent>
<Typography>
{this.state.imageUrl ? (
<img src={this.state.imageUrl} height="50" width="50" />
) : (
<img src={noImage} height="50" width="50" />
)}
</Typography>
<Typography variant="h6">
<b>{post.userHandle}</b>
</Typography>
<Typography variant="body2" color={"textSecondary"}>
{this.formatDate(post.createdAt) }
</Typography>
<br />
<Typography variant="body1">
<b>{post.microBlogTitle}</b>
</Typography>
<Typography variant="body2">{post.quoteBody}</Typography>
<br />
<Typography variant="body2">{post.body}</Typography>
<br />
<Typography variant="body2">
<b>Topics:</b> {post.microBlogTopics.join(", ")}
</Typography>
<br />
<Typography variant="body2" color={"textSecondary"}>
Likes {post.likeCount}
</Typography>
</CardContent>
</Card>
))
) : (
<p>My Posts</p>
);
// FIX: This needs to check if user's profile page being displayed
// is the same as the user who is logged in
// Can't check for that right now, because this page is always
// showing the logged in users profile, instead of retreiving the
// profile based on the URL entered
let editButtonMarkup = true ? (
<Link to="/user/edit">
<Button className={classes.button} variant="outlined" color="primary">
Edit Profile
</Button>
</Link>
) : null;
let verifyButtonMarkup = this.state.profile === "Admin" ?
<Link to="/verify">
<Button className={classes.button} variant="outlined" color="primary">
Verify Users
</Button>
</Link>
:
null
return ( return (
<Grid container spacing={16}> this.state.loading ? <CircularProgress size={60} style={{marginTop: "300px"}}></CircularProgress> :
<Grid item sm={8} xs={12}> <div>
<p>Post</p> {/* <Paper className={classes.paper}> */}
<Grid container direction="column">
<Grid item>
<Grid container>
<Grid item sm>
{editButtonMarkup}
{verifyButtonMarkup}
</Grid> </Grid>
<Grid item sm={4} xs={12}> <Grid item sm>
<PostCard> {/* <Grid container direction="column"> */}
<CardMedia image="./no-img-png" /> {/* <Grid item sm> */}
<CardContent>Username</CardContent> {imageMarkup}
</PostCard> {profileMarkup}
{/* </Grid> */}
{/* <Grid item sm> */}
{/* {postMarkup} */}
{/* </Grid> */}
{/* </Grid> */}
</Grid>
<Grid item sm>
<Container className={classes.topicsContainer} maxWidth="xs">
{topicsMarkup}
</Container>
<TextField
id="newTopic"
label="new topic"
// defaultValue=""
margin="normal"
variant="outlined"
value={this.state.newTopic}
onChange={event => this.handleChange(event)}
/>
<AddCircle
className={classes.addCircle}
color="primary"
// iconStyle={classes.addCircle}
clickable="true"
onClick={this.handleAddCircle}
cursor="pointer"
/>
</Grid> </Grid>
</Grid> </Grid>
</Grid>
<Grid item>
<Grid container>
<Grid item sm />
<Grid item>{postMarkup}</Grid>
<Grid item sm />
</Grid>
</Grid>
</Grid>
</div>
); );
} }
} }
const mapStateToProps = state => ({
user: state.user
});
user.propTypes = {
user: PropTypes.object.isRequired,
classes: PropTypes.object.isRequired
};
export default user; export default connect(mapStateToProps)(withStyles(styles)(user));

View File

@@ -0,0 +1,153 @@
import React, { Component } from "react";
import axios from "axios";
import PropTypes from "prop-types";
// TODO: Add a read-only '@' in the left side of the handle input
// TODO: Add a cancel button, that takes the user back to their profile page
// Material-UI stuff
import Button from "@material-ui/core/Button";
import { Link } from 'react-router-dom';
import CircularProgress from "@material-ui/core/CircularProgress";
import Grid from "@material-ui/core/Grid";
import TextField from "@material-ui/core/TextField";
import Typography from "@material-ui/core/Typography";
import withStyles from "@material-ui/core/styles/withStyles";
const styles = {
form: {
textAlign: "center"
},
textField: {
marginBottom: 30
},
pageTitle: {
// marginTop: 20,
marginBottom: 40
},
button: {
positon: "relative",
marginBottom: 10
},
progress: {
position: "absolute"
}
};
export class verify extends Component {
// Constructor for the state
constructor() {
super();
this.state = {
handle: "",
loading: false,
errors: {}
};
}
// // Runs whenever the submit button is clicked.
handleSubmit = (event) => {
event.preventDefault();
this.setState({
loading: true
});
const verifyHandle = {
user: this.state.handle
};
axios
.post("/verifyUser", verifyHandle)
.then((res) => {
console.log(res);
this.setState({
loading: false
});
// this.props.history.push('/');
// TODO: Need to redirect user to their profile page
})
.catch((err) => {
console.log(err);
this.setState({
errors: err.response.data,
loading: false
});
});
};
// Updates the state whenever one of the textboxes changes.
// The key is the name of the textbox and the value is the
// value in the text box.
// Also sets errors to null of textboxes that have been edited
handleChange = (event) => {
this.setState({
[event.target.name]: event.target.value,
errors: {
[event.target.name]: null
}
});
};
render() {
const { classes } = this.props;
const { loading } = this.state;
return (
<Grid container className={classes.form}>
<Grid item sm />
<Grid item sm>
<Typography variant="h4" className={classes.pageTitle}>
Verify Users
</Typography>
<form noValidate onSubmit={this.handleSubmit}>
<TextField
id="handle"
name="handle"
label="Username"
className={classes.textField}
value={this.state.handle}
// helperText={errors.handle}
// error={errors.handle ? true : false}
variant="outlined"
onChange={this.handleChange}
fullWidth
/>
<Grid container direction="column">
<Grid item>
<Button
type="submit"
variant="contained"
color="primary"
className={classes.button}
disabled={loading}
>
Submit
{loading && (
<CircularProgress size={30} className={classes.progress} />
)}
</Button>
</Grid>
<Grid item>
<Button
variant="oulined"
color="primary"
// className={classes.button}
component={ Link }
to='/user'
>
Back to Profile
</Button>
</Grid>
</Grid>
</form>
</Grid>
<Grid item sm />
</Grid>
);
}
}
verify.propTypes = {
classes: PropTypes.object.isRequired
};
export default withStyles(styles)(verify);

View File

@@ -0,0 +1,147 @@
import {
SET_DIRECT_MESSAGES,
LOADING_UI,
SET_ERRORS,
CLEAR_ERRORS,
SET_LOADING_UI_2,
SET_LOADING_UI_3,
SET_LOADING_UI_4,
SET_NOT_LOADING_UI_2,
SET_NOT_LOADING_UI_3,
SET_NOT_LOADING_UI_4
} from '../types';
import axios from "axios";
// TODO: Tidy up these functions. They shouldn't have all these promises in them.
export const getDirectMessages = () => (dispatch) => {
dispatch({type: SET_LOADING_UI_2});
axios.get('/dms')
.then((res) => {
dispatch({
type: SET_DIRECT_MESSAGES,
payload: res.data.data
});
dispatch({type: SET_NOT_LOADING_UI_2});
dispatch({type: CLEAR_ERRORS});
})
.catch((err) => {
console.error(err);
dispatch({
type: SET_ERRORS,
payload: {
errors: err.response.data.error
}
});
})
}
export const getNewDirectMessages = () => (dispatch) => {
return new Promise((resolve, reject) => {
axios.get('/dms')
.then((res) => {
dispatch({
type: SET_DIRECT_MESSAGES,
payload: res.data.data
});
dispatch({type: SET_NOT_LOADING_UI_2});
dispatch({type: CLEAR_ERRORS});
resolve();
})
.catch((err) => {
console.log(err)
reject(err);
})
})
}
export const reloadDirectMessageChannels = () => (dispatch) => {
return new Promise((resolve, reject) => {
axios.get('/dms')
.then((res) => {
dispatch({
type: SET_DIRECT_MESSAGES,
payload: res.data.data
});
dispatch({type: SET_NOT_LOADING_UI_3});
dispatch({type: CLEAR_ERRORS});
resolve();
})
.catch((err) => {
console.log(err)
reject(err);
})
})
}
export const createNewDirectMessage = (username) => (dispatch) => {
return new Promise((resolve, reject) => {
dispatch({type: SET_LOADING_UI_3});
const data = {
user: username
}
// console.log(username);
axios.post('/dms/new', data)
.then((res) => {
// console.log(res.data);
if (res.data.err) {
dispatch({
type: SET_ERRORS,
payload: {
createDirectMessage: res.data.err
}
});
dispatch({type: SET_NOT_LOADING_UI_3});
} else {
// dispatch(getNewDirectMessages());
// dispatch({type: SET_NOT_LOADING_UI_3});
}
resolve();
})
.catch((err) => {
dispatch({
type: SET_ERRORS,
payload: {
createDirectMessage: err.response.data.error
}
});
dispatch({type: SET_NOT_LOADING_UI_3});
console.log(err.response.data);
reject(err);
})
});
}
export const sendDirectMessage = (user, message) => (dispatch) => {
dispatch({type: SET_LOADING_UI_4});
const data = {
message,
user
};
axios.post('/dms/send', data)
.then((res) => {
// console.log(res);
return axios.get('/dms')
})
.then((res) => {
dispatch({
type: SET_DIRECT_MESSAGES,
payload: res.data.data
});
dispatch({type: SET_NOT_LOADING_UI_4});
dispatch({type: CLEAR_ERRORS});
})
.catch((err) => {
console.log(err);
dispatch({
type: SET_ERRORS,
payload: {
sendDirectMessage: err.response.data
}
})
dispatch({type: SET_NOT_LOADING_UI_4});
})
}

View File

@@ -1,19 +1,42 @@
import {SET_USER, SET_ERRORS, CLEAR_ERRORS, LOADING_UI, SET_AUTHENTICATED, SET_UNAUTHENTICATED} from '../types';
import {
SET_USER,
SET_ERRORS,
CLEAR_ERRORS,
LOADING_UI,
// SET_AUTHENTICATED,
SET_UNAUTHENTICATED,
LIKE_POST,
UNLIKE_POST,
SET_LIKES,
LOADING_USER
} from '../types';
import axios from 'axios'; import axios from 'axios';
// Saves Authorization in browser local storage and adds it as a header to axios
const setAuthorizationHeader = (token) => {
const FBIdToken = `Bearer ${token}`;
localStorage.setItem('FBIdToken', FBIdToken);
axios.defaults.headers.common['Authorization'] = FBIdToken;
}
// Gets Database info for the logged in user and sets it in Redux
export const getUserData = () => (dispatch) => { export const getUserData = () => (dispatch) => {
dispatch({ type: LOADING_USER });
axios.get('/user') axios.get('/user')
.then((res) => { .then((res) => {
dispatch({ dispatch({
type: SET_USER, type: SET_USER,
payload: res.data, payload: res.data,
}) });
dispatch({type: CLEAR_ERRORS});
}) })
.catch((err) => console.error(err)); .catch((err) => console.error(err));
} }
// Sends login data to firebase and sets the user data in Redux
export const loginUser = (loginData, history) => (dispatch) => { export const loginUser = (loginData, history) => (dispatch) => {
dispatch({type: CLEAR_ERRORS});
dispatch({ type: LOADING_UI }); dispatch({ type: LOADING_UI });
axios axios
.post("/login", loginData) .post("/login", loginData)
@@ -21,7 +44,7 @@ export const loginUser = (loginData, history) => (dispatch) => {
// Save the login token // Save the login token
setAuthorizationHeader(res.data.token); setAuthorizationHeader(res.data.token);
dispatch(getUserData()); dispatch(getUserData());
dispatch({ type: CLEAR_ERRORS }) // dispatch({ type: CLEAR_ERRORS })
// Redirects to home page // Redirects to home page
history.push('/home'); history.push('/home');
}) })
@@ -33,7 +56,9 @@ export const loginUser = (loginData, history) => (dispatch) => {
}); });
}; };
// Sends signup data to firebase and sets the user data in Redux
export const signupUser = (newUserData, history) => (dispatch) => { export const signupUser = (newUserData, history) => (dispatch) => {
dispatch({type: CLEAR_ERRORS});
dispatch({ type: LOADING_UI }); dispatch({ type: LOADING_UI });
axios axios
.post("/signup", newUserData) .post("/signup", newUserData)
@@ -43,7 +68,7 @@ export const signupUser = (newUserData, history) => (dispatch) => {
// Save the signup token // Save the signup token
setAuthorizationHeader(res.data.token); setAuthorizationHeader(res.data.token);
dispatch(getUserData()); dispatch(getUserData());
dispatch({ type: CLEAR_ERRORS }) // dispatch({ type: CLEAR_ERRORS })
// Redirects to home page // Redirects to home page
history.push('/home'); history.push('/home');
}) })
@@ -55,14 +80,93 @@ export const signupUser = (newUserData, history) => (dispatch) => {
}); });
}; };
// Deletes the Authorization header and clears all user data from Redux
export const logoutUser = () => (dispatch) => { export const logoutUser = () => (dispatch) => {
localStorage.removeItem('FBIdToken'); localStorage.removeItem('FBIdToken');
delete axios.defaults.headers.common['Authorization']; delete axios.defaults.headers.common['Authorization'];
dispatch({ type: SET_UNAUTHENTICATED }); dispatch({ type: SET_UNAUTHENTICATED });
} }
const setAuthorizationHeader = (token) => {
const FBIdToken = `Bearer ${token}`; export const deleteUser = () => (dispatch) => {
localStorage.setItem('FBIdToken', FBIdToken); axios
axios.defaults.headers.common['Authorization'] = FBIdToken; .delete("/delete")
.then((res) => {
console.log(res);
console.log("User account successfully deleted.");
} }
)
.catch((err) => {
dispatch ({
type: SET_ERRORS,
payload: err.response.data,
})
});
localStorage.removeItem('FBIdToken');
delete axios.defaults.headers.common['Authorization'];
dispatch({ type: SET_UNAUTHENTICATED });
}
export const getLikes = () => (dispatch) => {
axios.get('/likes')
.then((res) => {
dispatch({
type: SET_LIKES,
payload: res.data
})
})
}
export const likePost = (postId, postArray) => (dispatch) => {
postArray.push(postId);
dispatch({
type: LIKE_POST,
payload: {
likes: postArray
}
})
axios.get(`/like/${postId}`)
.then((res) => {
getLikes();
})
}
export const unlikePost = (postId, postArray) => (dispatch) => {
let i;
for (i = 0; i < postArray.length; i++) {
if (postArray[i] === postId) {
postArray.splice(i, 1);
break;
}
}
dispatch({
type: UNLIKE_POST,
payload: {
likes: postArray
}
})
axios.get(`/unlike/${postId}`)
.then((res) => {
getLikes();
})
}
// Sends an image data form to firebase to be uploaded to the user profile
export const uploadImage = (formData) => (dispatch) => {
dispatch({ type: LOADING_UI });
axios.post('/user/image', formData)
.then(() => {
dispatch(getUserData());
// dispatch({ type: CLEAR_ERRORS });
})
.catch(err => {
console.log(err);
})
}

View File

@@ -0,0 +1,17 @@
import {SET_DIRECT_MESSAGES, SET_USERNAME_VALID, SET_USERNAME_INVALID} from '../types';
const initialState = {
directMessages: null,
};
export default function(state = initialState, action) {
switch(action.type) {
case SET_DIRECT_MESSAGES:
return {
...state,
directMessages: action.payload
};
default:
return state;
}
}

View File

@@ -1,7 +1,20 @@
import { SET_ERRORS, CLEAR_ERRORS, LOADING_UI } from '../types'; import {
SET_ERRORS,
CLEAR_ERRORS,
LOADING_UI,
SET_LOADING_UI_2,
SET_LOADING_UI_3,
SET_LOADING_UI_4,
SET_NOT_LOADING_UI_2,
SET_NOT_LOADING_UI_3,
SET_NOT_LOADING_UI_4
} from '../types';
const initialState = { const initialState = {
loading: false, loading: false,
loading2: false,
loading3: false,
loading4: false,
errors: null errors: null
}; };
@@ -23,7 +36,37 @@ export default function(state = initialState, action) {
return { return {
...state, ...state,
loading: true loading: true
} };
case SET_LOADING_UI_2:
return {
...state,
loading2: true
};
case SET_LOADING_UI_3:
return {
...state,
loading3: true
};
case SET_LOADING_UI_4:
return {
...state,
loading4: true
};
case SET_NOT_LOADING_UI_2:
return {
...state,
loading2: false
};
case SET_NOT_LOADING_UI_3:
return {
...state,
loading3: false
};
case SET_NOT_LOADING_UI_4:
return {
...state,
loading4: false
};
default: default:
return state; return state;
} }

View File

@@ -1,4 +1,17 @@
import {SET_USER, SET_ERRORS, CLEAR_ERRORS, LOADING_UI, SET_AUTHENTICATED, SET_UNAUTHENTICATED} from '../types';
import {
SET_USER,
// SET_ERRORS,
// CLEAR_ERRORS,
// LOADING_UI,
SET_AUTHENTICATED,
SET_UNAUTHENTICATED,
LOADING_USER,
LIKE_POST,
UNLIKE_POST,
SET_LIKES
} from '../types';
const initialState = { const initialState = {
authenticated: false, authenticated: false,
@@ -19,9 +32,31 @@ export default function(state = initialState, action) {
return initialState; return initialState;
case SET_USER: case SET_USER:
return { return {
...state,
authenticated: true, authenticated: true,
loading: false,
...action.payload, ...action.payload,
}; };
case LIKE_POST:
return {
...state,
...action.payload
}
case UNLIKE_POST:
return {
...state,
...action.payload
}
case SET_LIKES:
return {
...state,
...action.payload
}
case LOADING_USER:
return {
...state,
loading: true
}
default: default:
return state; return state;
} }

View File

@@ -3,10 +3,22 @@ export const SET_AUTHENTICATED = 'SET_AUTHENTICATED';
export const SET_UNAUTHENTICATED = 'SET_UNAUTHENTICATED'; export const SET_UNAUTHENTICATED = 'SET_UNAUTHENTICATED';
export const SET_USER = 'SET_USER'; export const SET_USER = 'SET_USER';
export const LOADING_USER = 'LOADING_USER'; export const LOADING_USER = 'LOADING_USER';
export const LIKE_POST = 'LIKE_POST';
export const UNLIKE_POST = 'UNLIKE_POST';
export const SET_LIKES = 'SET_LIKES';
// UI reducer types // UI reducer types
export const SET_ERRORS = 'SET_ERRORS'; export const SET_ERRORS = 'SET_ERRORS';
export const LOADING_UI = 'LOADING_UI'; export const LOADING_UI = 'LOADING_UI';
export const SET_LOADING_UI_2 = 'SET_LOADING_UI_2';
export const SET_LOADING_UI_3 = 'SET_LOADING_UI_3';
export const SET_LOADING_UI_4 = 'SET_LOADING_UI_4';
export const SET_NOT_LOADING_UI_2 = 'SET_NOT_LOADING_UI_2';
export const SET_NOT_LOADING_UI_3 = 'SET_NOT_LOADING_UI_3';
export const SET_NOT_LOADING_UI_4 = 'SET_NOT_LOADING_UI_4';
export const CLEAR_ERRORS = 'CLEAR_ERRORS'; export const CLEAR_ERRORS = 'CLEAR_ERRORS';
// Data reducer types // Data reducer types
export const SET_DIRECT_MESSAGES = 'SET_DIRECT_MESSAGES';
export const SET_USERNAME_VALID = 'SET_USERNAME_VALID';
export const SET_USERNAME_INVALID = 'SET_USERNAME_INVALID';

View File

@@ -50,7 +50,13 @@ export default {
marginBottom: 20 marginBottom: 20
}, },
paper: { paper: {
padding: 20 padding: 10,
display: 'flex',
justifyContent: 'center',
flexWrap: 'wrap'
},
chip: {
margin: 0.5,
}, },
profile: { profile: {
'& .image-wrapper': { '& .image-wrapper': {