Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge last 3 branches #38

Open
wants to merge 57 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
dbb2fd2
just for test
ShyarK Nov 25, 2019
6326a6b
some test
gulyener Nov 25, 2019
d9a6610
delete test file
ShyarK Nov 25, 2019
5df8c03
add newsFeed api
ShyarK Nov 26, 2019
038a1ae
Add loginWithSocial action
gulyener Nov 26, 2019
4489edf
Refactor firebase calls
gulyener Nov 26, 2019
f8a5c16
Remove config
gulyener Nov 26, 2019
adae698
Changes after Q&A
gulyener Nov 28, 2019
ba42b56
user news forntend
ShyarK Nov 28, 2019
cf36e5b
Register user in db with facebook
gulyener Nov 28, 2019
3616fa3
add links to develpoers profiles, and posts page , in the news component
aalhommada Nov 28, 2019
3daf0c0
add refactoring & save user in db
mejustdev Nov 29, 2019
230bebf
add social user model
mejustdev Nov 29, 2019
22408a8
solve db bug
mejustdev Nov 29, 2019
3500833
add loadSocialUser actionCreator
mejustdev Nov 30, 2019
1316db1
add jwt
mejustdev Nov 30, 2019
54c1e68
Add login & fix register issues
mejustdev Nov 30, 2019
a1e7348
Allow login with social after registering
gulyener Nov 30, 2019
e69c0eb
add GoogleAuth
mejustdev Nov 30, 2019
f0663fe
Combine facebook and google login in Login.js
gulyener Nov 30, 2019
7314bfc
did some garbage collection
Laurelinduilwen Nov 30, 2019
b769b28
backend finished
hnnhack Dec 5, 2019
f310946
beginning of front end with its final design
hnnhack Dec 5, 2019
3118076
Finalizing read, unread
hnnhack Dec 7, 2019
02efbb9
Last before final
hnnhack Dec 7, 2019
71e8ac1
Please see the style of notification header
hnnhack Dec 7, 2019
ed62eb5
this is final version from me, good luck!
hnnhack Dec 8, 2019
59b6b1b
Merge from development
musafir928 Dec 11, 2019
8035764
Fix package-lock.json
gulyener Dec 11, 2019
0532cac
clearing up spaces
ShyarK Dec 11, 2019
96ec0b0
change config
musafir928 Dec 11, 2019
450ead9
Fix auth api caching problem
oguzhanturgut Dec 13, 2019
8090d34
Merge branch 'development' into notification
oguzhanturgut Dec 13, 2019
1564b04
Merge branch 'development' into news-feed
oguzhanturgut Dec 13, 2019
697a6ce
Merge branch 'development' into social-media-login
oguzhanturgut Dec 13, 2019
ae1696e
Clean merge identifier
oguzhanturgut Dec 13, 2019
fa91e88
Disable caching for api calls
oguzhanturgut Dec 13, 2019
ecd7710
Change db
oguzhanturgut Dec 13, 2019
eefe2b6
Fix socket errors
oguzhanturgut Dec 14, 2019
427e481
Fix socketClient problem
oguzhanturgut Dec 14, 2019
1e070ec
Disable caching for socket connection
oguzhanturgut Dec 14, 2019
ecfd47c
fixed auth js and disabled public index sw script
salih18 Dec 14, 2019
38bc8a2
added a socket function for social login user
salih18 Dec 14, 2019
5f11a29
Enable sw except for api and scoket
oguzhanturgut Dec 14, 2019
92ba3a0
remove console.logs
mejustdev Dec 14, 2019
de28c4a
Merge branch 'dev' of https://github.com/HackYourFuture/class22-proje…
mejustdev Dec 14, 2019
b9b3a9f
Fix social register api
oguzhanturgut Dec 14, 2019
7002808
Merge branch 'dev' of https://github.com/HackYourFuture/class22-proje…
oguzhanturgut Dec 14, 2019
16cc1f1
added check to backend if the user deleted his account
salih18 Dec 14, 2019
9e2f3e0
changed name of the site
oguzhanturgut Dec 14, 2019
d8e42fe
database functions for friend request added when the user has removed…
salih18 Dec 14, 2019
7455fe7
Change landing photo
oguzhanturgut Dec 14, 2019
8d8e687
Change landing page cache
oguzhanturgut Dec 14, 2019
04ad268
Change corrupt langing image
oguzhanturgut Dec 14, 2019
dec43ab
change cache version
oguzhanturgut Dec 14, 2019
9e304cd
Shrink showcase image size
oguzhanturgut Dec 14, 2019
6432146
disable facebook login
oguzhanturgut Dec 15, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ node_modules/
client/node_modules/
config/production.json
client/debug.log
config/default.json
package-lock.json

client/src/social-config/
client/package-lock.json
client/src/social-config/firebaseConfig.js
config/default.json
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"cSpell.words": [
"pageview"
]
}
1,438 changes: 1,220 additions & 218 deletions client/package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
"private": true,
"dependencies": {
"axios": "^0.18.1",
"firebase": "^7.5.0",
"moment": "^2.24.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-ga": "^2.7.0",
"react-moment": "^0.9.2",
"react-redux": "^7.0.2",
"react-router-dom": "^5.0.0",
"react-scripts": "3.0.0",
"react-social-login-buttons": "^3.0.0",
"redux": "^4.0.1",
"redux-devtools-extension": "^2.13.8",
"redux-thunk": "^2.3.0",
Expand Down
2 changes: 1 addition & 1 deletion client/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- Safari compatilibility -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="Developer Hub" />
<meta name="apple-mobile-web-app-title" content="Hack Your Social" />
<link rel="apple-touch-icon" href="developer-icon-144.png" />
<!-- IE compatilibility -->
<meta name="msapplication-TileImage" content="developer-icon-144.png" />
Expand Down
2 changes: 1 addition & 1 deletion client/public/offline.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<!-- Safari compatilibility -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="Developer Hub" />
<meta name="apple-mobile-web-app-title" content="Hack Your Social" />
<link rel="apple-touch-icon" href="developer-icon-144.png" />
<!-- IE compatilibility -->
<meta name="msapplication-TileImage" content="developer-icon-144.png" />
Expand Down
19 changes: 4 additions & 15 deletions client/public/sw.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable no-restricted-globals */
const CACHE_VERSION = 1;
const CACHE_VERSION = 7;
const CURRENT_CACHES = {
static: `static-v${CACHE_VERSION}`,
dynamic: `dynamic-v${CACHE_VERSION}`,
Expand All @@ -8,8 +8,8 @@ const STATIC_FILES = [
'/',
'/index.html',
'/offline.html',
'/static/media/showcase.4b31330b.jpg',
'/static/js/bundle.js',
'/static/media/showcase.70190ae3.jpg',
'/static/js/0.chunk.js',
'/static/js/main.chunk.js',
'/static/js/main.chunk.js.map',
Expand Down Expand Up @@ -71,21 +71,10 @@ const isStaticAsset = (requestUrl, array) => {
return array.indexOf(cachePath) > -1;
};

const apis = [`${self.location.origin}/api/profile`];

// Cache then network with fallback & dynamic caching
self.addEventListener('fetch', event => {
if (apis.includes(event.request.url)) {
event.respondWith(
caches.open(CURRENT_CACHES.dynamic).then(cache => {
return fetch(event.request).then(response => {
const cloneResponse = response.clone();
trimCache(CURRENT_CACHES.dynamic, 30);
cache.put(event.request.url, cloneResponse);
return response;
});
}),
);
if (event.request.url.includes('/api/') || event.request.url.includes('sock')) {
event.respondWith(fetch(event.request));
} else if (isStaticAsset(event.request.url, STATIC_FILES)) {
event.respondWith(caches.match(event.request));
} else {
Expand Down
205 changes: 198 additions & 7 deletions client/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ body {
background-color: #fff;
color: #333;
}
.text-bold {
font-weight: bold;
}

a {
color: var(--primary-color);
Expand All @@ -39,7 +42,7 @@ img {
max-width: 1100px;
margin: auto;
overflow: hidden;
padding: 0 2rem;
padding: 0 1.2rem;
margin-top: 6rem;
margin-bottom: 3rem;
}
Expand Down Expand Up @@ -70,6 +73,10 @@ img {
color: var(--primary-color) !important;
}

.text-dark {
color: var(--dark-color);
}

/* Padding */
.p {
padding: 0.5rem;
Expand Down Expand Up @@ -367,11 +374,7 @@ button {
/* Profile Page */
.profile-grid {
display: grid;
grid-template-areas:
'top top'
'about about'
'exp edu'
'github github';
grid-template-areas: 'top top' 'about about' 'exp edu' 'github github';
grid-gap: 1rem;
}

Expand Down Expand Up @@ -457,6 +460,39 @@ button {
flex-basis: 20%;
}

/* Notifications*/
.notification {
display: grid;
grid-template-columns: 2fr 4fr;
grid-gap: 2rem;
}

.list {
font-size: 18px;
}

.notification .table th {
font-size: 18px;
}

.notification-item {
background-color: #fff;
color: #114ccc;
cursor: pointer;
}

.notification-hover {
background-color: #fff;
color: rgb(173, 165, 165);
font-weight: bold;
cursor: pointer;
}

.fa-trash:hover:before {
content: '\f2ed';
color: red;
}

/* Posts Page */
.post-form .post-form-header {
background: var(--primary-color);
Expand Down Expand Up @@ -492,6 +528,150 @@ button {
margin-bottom: 0.5rem;
}

/* News feed */
.news_feed {
display: flex;
padding: 20px 0 0;
margin-bottom: 14px;
box-shadow: -1px 1px 6px 0px #757c7d66;
}

.user_img {
border-radius: 10%;
width: 48px;
height: 48px;
margin: 15px 5px 0 10px;
}

.post_news {
font-size: 15px;
padding: 10px;
width: 100%;
}
.post_notification {
color: #17a2b8;
font-size: 11px;
}
.news_text {
color: #000;
}

.news_social {
margin: 5px;
color: #2e8793;
}
.more_news {
color: #2e8793;
font-style: italic;
transition: color 0.6s;
}
.more_news:hover {
color: #123438;
}
/* Mobile Styles */
@media (max-width: 700px) {
.container {
margin-top: 8rem;
}

.hide-sm {
display: none;
}

/* Text Styles */
.x-large {
font-size: 3rem;
}

.large {
font-size: 2rem;
}

.lead {
font-size: 1rem;
}

/* Navbar */
.navbar {
display: block;
text-align: center;
}

.navbar ul {
text-align: center;
justify-content: center;
}

.navbar h1 {
margin-bottom: 1rem;
}

.navbar .welcome {
display: none;
}

/* Profiles Page */
.profile {
grid-template-columns: 1fr;
text-align: center;
}

.profile ul {
display: none;
}

/* Profile Page */

.profile-top img,
.profile img {
width: 200px;
margin: auto;
}

.profile-grid {
grid-template-areas: 'top' 'about' 'exp' 'edu' 'github';
}

.profile-about .skills {
flex-direction: column;
}

.dash-buttons a {
display: block;
width: 100%;
margin-bottom: 0.2rem;
}

.post {
grid-template-columns: 1fr;
}
.post a,
.post button {
padding: 0.3rem 0.4rem;
}
}

@media (min-width: 700px) {
.news_feed {
width: 70%;
}
.user_img {
border-radius: 10%;
width: 60px;
height: 60px;
}

.post_news {
font-size: 18px;
}

.news_social {
font-size: 20px;
}
.more_news {
cursor: pointer;
}
}
/* Friends Page */
.friend-card {
border: #ccc solid 1px;
Expand Down Expand Up @@ -627,9 +807,20 @@ input[class='search-txt']::-webkit-search-results-decoration {
margin-bottom: 0.2rem;
}

/* Notification */
.notification {
grid-template-columns: 1fr;
}

.notification .table th,
.notification .table td {
font-size: 1rem;
}

.post {
grid-template-columns: 1fr;
}

.post a,
.post button {
padding: 0.3rem 0.4rem;
Expand Down Expand Up @@ -905,6 +1096,6 @@ div.header {

@media (min-width: 700px) {
.div_search {
width: 50%;
width: 30%;
}
}
10 changes: 8 additions & 2 deletions client/src/App.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { Fragment, useEffect } from 'react';
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom';
import reactGA from 'react-ga';
import Navbar from './components/layout/Navbar';
import Landing from './components/layout/Landing';
import Routes from './components/routing/Routes';

// Redux
import { Provider } from 'react-redux';
import store from './store';
Expand All @@ -25,13 +25,19 @@ const App = () => {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [loadUser]);

useEffect(() => {
reactGA.initialize('UA-153483511-1');
// to report page view
reactGA.pageview(window.location.pathname + window.location.search);
}, []);

return (
<Provider store={store}>
<Router>
<Fragment>
<Navbar />
<Switch>
<Route exact path="/" component={Landing} />
<Route exact path='/' component={Landing} />
<Route component={Routes} />
</Switch>
</Fragment>
Expand Down
Loading