- {post.creator}
+ {post.name}
{moment(post.createdAt).fromNow()}
+ {(user?.result?.googleId === post?.creator || user?.result?._id === post?.creator) && (
-
+
+ )}
{post.tags.map((tag) => `#${tag} `)}
@@ -31,8 +50,14 @@ const Post = ({ post, setCurrentId }) => {
{post.message}
-
-
+
+ {(user?.result?.googleId === post?.creator || user?.result?._id === post?.creator) && (
+
+ )}
);
diff --git a/client/src/components/Posts/styles.js b/client/src/components/Posts/styles.js
index 882f7e6bc..ce0b9cda1 100644
--- a/client/src/components/Posts/styles.js
+++ b/client/src/components/Posts/styles.js
@@ -1,13 +1,68 @@
import { makeStyles } from '@material-ui/core/styles';
+import { deepPurple } from '@material-ui/core/colors';
export default makeStyles((theme) => ({
mainContainer: {
+ borderRadius: 15,
+ margin: '30px 0',
+ display: 'flex',
+ flexDirection: 'row',
+ justifyContent: 'space-between',
+ alignItems: 'center',
+ padding: '10px 50px',
+ },
+ heading: {
+ color: 'rgba(0,183,255, 1)',
+ textDecoration: 'none',
+ },
+ image: {
+ marginLeft: '15px',
+ },
+ toolbar: {
+ display: 'flex',
+ justifyContent: 'flex-end',
+ width: '400px',
+ },
+ profile: {
+ display: 'flex',
+ justifyContent: 'space-between',
+ width: '400px',
+ },
+ userName: {
+ display: 'flex',
+ alignItems: 'center',
+ },
+ brandContainer: {
display: 'flex',
alignItems: 'center',
},
smMargin: {
margin: theme.spacing(1),
},
+ purple: {
+ color: theme.palette.getContrastText(deepPurple[500]),
+ backgroundColor: deepPurple[500],
+ },
+ [theme.breakpoints.down('sm')]: {
+ appBar: {
+ padding: '10px 20px',
+ },
+ heading: {
+ display: 'none',
+ },
+ userName: {
+ display: 'none',
+ },
+ image: {
+ marginLeft: '5px',
+ },
+ toolbar: {
+ display: 'flex',
+ justifyContent: 'flex-end',
+ width: '160px',
+ },
+ },
+
actionDiv: {
textAlign: 'center',
},
diff --git a/client/src/constants/actionTypes.js b/client/src/constants/actionTypes.js
index ea8395eae..048dc9202 100644
--- a/client/src/constants/actionTypes.js
+++ b/client/src/constants/actionTypes.js
@@ -3,3 +3,6 @@ export const UPDATE = 'UPDATE';
export const DELETE = 'DELETE';
export const FETCH_ALL = 'FETCH_ALL';
export const LIKE = 'LIKE';
+
+export const AUTH = 'AUTH';
+export const LOGOUT = 'LOGOUT';
diff --git a/client/src/index.css b/client/src/index.css
index 2f3d1fe66..108afb7c0 100644
--- a/client/src/index.css
+++ b/client/src/index.css
@@ -1,4 +1,4 @@
body {
- background-color: rgba(0,183,255, 1);
+ background-color: rgba(0,183,255, 1) !important;
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='540' height='450' viewBox='0 0 1080 900'%3E%3Cg fill-opacity='.1'%3E%3Cpolygon fill='%23444' points='90 150 0 300 180 300'/%3E%3Cpolygon points='90 150 180 0 0 0'/%3E%3Cpolygon fill='%23AAA' points='270 150 360 0 180 0'/%3E%3Cpolygon fill='%23DDD' points='450 150 360 300 540 300'/%3E%3Cpolygon fill='%23999' points='450 150 540 0 360 0'/%3E%3Cpolygon points='630 150 540 300 720 300'/%3E%3Cpolygon fill='%23DDD' points='630 150 720 0 540 0'/%3E%3Cpolygon fill='%23444' points='810 150 720 300 900 300'/%3E%3Cpolygon fill='%23FFF' points='810 150 900 0 720 0'/%3E%3Cpolygon fill='%23DDD' points='990 150 900 300 1080 300'/%3E%3Cpolygon fill='%23444' points='990 150 1080 0 900 0'/%3E%3Cpolygon fill='%23DDD' points='90 450 0 600 180 600'/%3E%3Cpolygon points='90 450 180 300 0 300'/%3E%3Cpolygon fill='%23666' points='270 450 180 600 360 600'/%3E%3Cpolygon fill='%23AAA' points='270 450 360 300 180 300'/%3E%3Cpolygon fill='%23DDD' points='450 450 360 600 540 600'/%3E%3Cpolygon fill='%23999' points='450 450 540 300 360 300'/%3E%3Cpolygon fill='%23999' points='630 450 540 600 720 600'/%3E%3Cpolygon fill='%23FFF' points='630 450 720 300 540 300'/%3E%3Cpolygon points='810 450 720 600 900 600'/%3E%3Cpolygon fill='%23DDD' points='810 450 900 300 720 300'/%3E%3Cpolygon fill='%23AAA' points='990 450 900 600 1080 600'/%3E%3Cpolygon fill='%23444' points='990 450 1080 300 900 300'/%3E%3Cpolygon fill='%23222' points='90 750 0 900 180 900'/%3E%3Cpolygon points='270 750 180 900 360 900'/%3E%3Cpolygon fill='%23DDD' points='270 750 360 600 180 600'/%3E%3Cpolygon points='450 750 540 600 360 600'/%3E%3Cpolygon points='630 750 540 900 720 900'/%3E%3Cpolygon fill='%23444' points='630 750 720 600 540 600'/%3E%3Cpolygon fill='%23AAA' points='810 750 720 900 900 900'/%3E%3Cpolygon fill='%23666' points='810 750 900 600 720 600'/%3E%3Cpolygon fill='%23999' points='990 750 900 900 1080 900'/%3E%3Cpolygon fill='%23999' points='180 0 90 150 270 150'/%3E%3Cpolygon fill='%23444' points='360 0 270 150 450 150'/%3E%3Cpolygon fill='%23FFF' points='540 0 450 150 630 150'/%3E%3Cpolygon points='900 0 810 150 990 150'/%3E%3Cpolygon fill='%23222' points='0 300 -90 450 90 450'/%3E%3Cpolygon fill='%23FFF' points='0 300 90 150 -90 150'/%3E%3Cpolygon fill='%23FFF' points='180 300 90 450 270 450'/%3E%3Cpolygon fill='%23666' points='180 300 270 150 90 150'/%3E%3Cpolygon fill='%23222' points='360 300 270 450 450 450'/%3E%3Cpolygon fill='%23FFF' points='360 300 450 150 270 150'/%3E%3Cpolygon fill='%23444' points='540 300 450 450 630 450'/%3E%3Cpolygon fill='%23222' points='540 300 630 150 450 150'/%3E%3Cpolygon fill='%23AAA' points='720 300 630 450 810 450'/%3E%3Cpolygon fill='%23666' points='720 300 810 150 630 150'/%3E%3Cpolygon fill='%23FFF' points='900 300 810 450 990 450'/%3E%3Cpolygon fill='%23999' points='900 300 990 150 810 150'/%3E%3Cpolygon points='0 600 -90 750 90 750'/%3E%3Cpolygon fill='%23666' points='0 600 90 450 -90 450'/%3E%3Cpolygon fill='%23AAA' points='180 600 90 750 270 750'/%3E%3Cpolygon fill='%23444' points='180 600 270 450 90 450'/%3E%3Cpolygon fill='%23444' points='360 600 270 750 450 750'/%3E%3Cpolygon fill='%23999' points='360 600 450 450 270 450'/%3E%3Cpolygon fill='%23666' points='540 600 630 450 450 450'/%3E%3Cpolygon fill='%23222' points='720 600 630 750 810 750'/%3E%3Cpolygon fill='%23FFF' points='900 600 810 750 990 750'/%3E%3Cpolygon fill='%23222' points='900 600 990 450 810 450'/%3E%3Cpolygon fill='%23DDD' points='0 900 90 750 -90 750'/%3E%3Cpolygon fill='%23444' points='180 900 270 750 90 750'/%3E%3Cpolygon fill='%23FFF' points='360 900 450 750 270 750'/%3E%3Cpolygon fill='%23AAA' points='540 900 630 750 450 750'/%3E%3Cpolygon fill='%23FFF' points='720 900 810 750 630 750'/%3E%3Cpolygon fill='%23222' points='900 900 990 750 810 750'/%3E%3Cpolygon fill='%23222' points='1080 300 990 450 1170 450'/%3E%3Cpolygon fill='%23FFF' points='1080 300 1170 150 990 150'/%3E%3Cpolygon points='1080 600 990 750 1170 750'/%3E%3Cpolygon fill='%23666' points='1080 600 1170 450 990 450'/%3E%3Cpolygon fill='%23DDD' points='1080 900 1170 750 990 750'/%3E%3C/g%3E%3C/svg%3E");
}
\ No newline at end of file
diff --git a/client/src/index.js b/client/src/index.js
index 2787a9d65..56d090cb3 100644
--- a/client/src/index.js
+++ b/client/src/index.js
@@ -1,14 +1,13 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
-import { createStore, applyMiddleware, compose } from 'redux';
-import thunk from 'redux-thunk';
-
+// Install "npm install @reduxjs/toolkit" on server side
+import { configureStore } from "@reduxjs/toolkit";
import { reducers } from './reducers';
import App from './App';
import './index.css';
-const store = createStore(reducers, compose(applyMiddleware(thunk)));
+const store = configureStore({ reducer: reducers });
ReactDOM.render(