Skip to content

Commit 8b3ac65

Browse files
authored
fix issues (#555)
1 parent 65e0814 commit 8b3ac65

File tree

19 files changed

+143
-138
lines changed

19 files changed

+143
-138
lines changed

src/actions/authAction.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,4 +140,4 @@ export const setCurrentUser = (decodedData) => {
140140
type: SET_CURRENT_USER,
141141
payload: decodedData
142142
}
143-
}
143+
}

src/actions/types.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ export const GET_DEVICE_ANALYTICS ="GET_DEVICE_ANALYTICS"
5151
export const GET_MOSTVIEWED_ANALYTICS ="GET_MOSTVIEWED_ANALYTICS"
5252
export const GET_PROPOSALVIEW_ANALYTICS="GET_PROPOSALVIEW_ANALYTICS"
5353
export const ACTIVATE_DEACTIVATE_ACCOUNT_TOGGLER = "ACTIVATE_DEACTIVATE_ACCOUNT_TOGGLER";
54+
export const CLEAR_INVITE_LINK = "CLEAR_INVITE_LINK"

src/actions/usersAction.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { GET_USER_PROFILE, GET_ALL_MEMBERS, UPDATE_USER_PROFILE, GET_USER_EVENTS, GET_USER_PROJECTS, GET_USER_POSTS, GET_INVITE_LINK, PROCESS_INVITE_LINK, SET_ADMIN } from './types'
1+
import { GET_USER_PROFILE, GET_ALL_MEMBERS, UPDATE_USER_PROFILE, GET_USER_EVENTS, GET_USER_PROJECTS, GET_USER_POSTS, GET_INVITE_LINK, PROCESS_INVITE_LINK, SET_ADMIN, CLEAR_INVITE_LINK } from './types'
22
import { errorHandler } from '../utils/errorHandler'
33
import axios from 'axios'
44
import { setRequestStatus } from '../utils/setRequestStatus'
@@ -203,6 +203,14 @@ export const processInviteToken = (token) => async (dispatch) => {
203203
}
204204
}
205205

206+
// CLEAR INVITE LINK
207+
export const clearInviteLink = () => async (dispatch) => {
208+
dispatch({
209+
type: CLEAR_INVITE_LINK,
210+
payload: ''
211+
})
212+
}
213+
206214
// ACTIVATE DEACTIVATE TOGGLER
207215
export const activateDeactivateToggler = () => async (dispatch) => {
208216
try {

src/auth/login-form/login-form.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,15 @@ class LoginForm extends Component {
6767
this.setState({ isValidForm: isValidEmail });
6868
};
6969

70+
// toggle Popups
71+
toggle = (toggler) => {
72+
this.setState({
73+
modalShow: !this.state.modalShow
74+
}, () => {
75+
console.log('toggler ', this.state);
76+
})
77+
}
78+
7079
render() {
7180
const handleToggle = (e) => {
7281
const targetName = e.target.name;
@@ -122,6 +131,7 @@ class LoginForm extends Component {
122131
option={this.state.option}
123132
optionValue={this.state.optionValue}
124133
modalShow={this.state.modalShow}
134+
toggler={this.toggle}
125135
/>
126136
</div>
127137
);

src/auth/login/login.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
body {
2+
max-height: 90vh;
3+
}
14
.login-page {
25
display: flex;
36
flex-direction: row;
@@ -14,7 +17,7 @@
1417
}
1518
}
1619
.extra-donuts {
17-
position: absolute;
20+
position: fixed;
1821
bottom: 0;
1922
left: 0;
2023
img {

src/reducers/userReducer.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { GET_USER_PROFILE, UPDATE_USER_PROFILE, GET_USER_EVENTS, GET_USER_PROJECTS, GET_USER_POSTS, GET_INVITE_LINK } from '../actions/types'
1+
import { GET_USER_PROFILE, UPDATE_USER_PROFILE, GET_USER_EVENTS, GET_USER_PROJECTS, GET_USER_POSTS, GET_INVITE_LINK, CLEAR_INVITE_LINK } from '../actions/types'
22
const initialState = {
33
userProfile: {},
44
userEvents: [],
@@ -45,6 +45,12 @@ export default (state = initialState, action) => {
4545
inviteLink: action.payload
4646
}
4747
}
48+
case CLEAR_INVITE_LINK: {
49+
return {
50+
...state,
51+
inviteLink: action.payload
52+
}
53+
}
4854
default: {
4955
return state
5056
}

src/user/Admin/register.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
1+
body {
2+
max-height: 90vh;
3+
}
24
.main__container {
35
left: 0%;
46
right: 0%;
@@ -12,6 +14,7 @@
1214
flex-direction: row;
1315
flex-wrap: wrap;
1416
margin: 50px;
17+
max-height: 70vh;
1518
.donut__text__container {
1619
flex-grow: 1.8;
1720
flex-shrink: 1;
@@ -358,7 +361,7 @@
358361
.main__container {
359362
.main__footer {
360363
.stick__to__bottom {
361-
margin-top: 19vh;
364+
margin-top: 17vh;
362365
}
363366
}
364367
}

src/user/dashboard/news-feed/news-feed.js

Lines changed: 12 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import React, { useState, useEffect } from "react";
2+
import { Button, ButtonGroup } from 'react-bootstrap'
23
import {
34
List,
45
Card,
56
Paper,
67
InputBase,
7-
ButtonGroup,
88
ListItem,
99
ListItemAvatar,
1010
Avatar,
@@ -14,7 +14,6 @@ import {
1414
CardMedia,
1515
} from "@material-ui/core";
1616
import { makeStyles } from "@material-ui/core/styles";
17-
import { Button, } from "react-bootstrap";
1817
import AddEventModal from "./popups/AddEventModal";
1918
import AddProjectModal from "./popups/AddProjectModal";
2019
import ArrowDropUpIcon from "@material-ui/icons/ArrowDropUp";
@@ -32,6 +31,7 @@ import eventImg2 from "../../../svgs/event-img-2.svg";
3231
import parse from "html-react-parser";
3332
import { withRouter } from 'react-router-dom'
3433
import { rsvpYes } from '../../../actions/eventAction'
34+
import Moment from 'react-moment'
3535

3636
const styles = makeStyles((theme) => ({
3737
root: {
@@ -180,7 +180,9 @@ function NewsFeed(props) {
180180
</ListItemAvatar>
181181
<ListItemText className="main">
182182
<h2>{post?.userId?.name?.firstName + " " + post?.userId?.name?.lastName}</h2>
183-
<small>{post?.createdAt}</small>
183+
<Moment format="DD MMM YYYY">
184+
{post?.createdAt}
185+
</Moment>
184186
</ListItemText>
185187
</ListItem>
186188
<div className="post-details2">{parse(post?.content)}</div>
@@ -241,7 +243,7 @@ function NewsFeed(props) {
241243
</ListItemAvatar>
242244
<ListItemText className="main">
243245
<h2>{project?.createdBy?.name?.firstName + " " + project?.createdBy?.name?.lastName}</h2>
244-
<small>{project?.createdAt}</small>
246+
<Moment format="DD MMM YYYY">{project?.createdAt}</Moment>
245247
</ListItemText>
246248
</ListItem>
247249
<div className="post-details2">{project?.description?.short}</div>
@@ -277,14 +279,16 @@ function NewsFeed(props) {
277279
<div className="event-schedule">
278280
<div className="event-date">
279281
<div className="date-content">
280-
<small>DATE</small>
281-
<h4>{event?.eventDate}</h4>
282+
<small>DATE</small><br/>
283+
<Moment format="DD MMM YYYY">
284+
{event?.eventDate}
285+
</Moment>
282286
</div>
283287
</div>
284288
<div className="event-time">
285289
<div className="time-content">
286290
<small>Location</small>
287-
<h4>{event?.location}</h4>
291+
<h5>{event?.location}</h5>
288292
</div>
289293
</div>
290294
</div>
@@ -308,7 +312,7 @@ function NewsFeed(props) {
308312
</ListItemAvatar>
309313
<ListItemText className="main">
310314
<h2>{event?.createdBy?.name?.firstName + " " + event?.createdBy?.name?.lastName}</h2>
311-
<small>{event?.createdAt}</small>
315+
<Moment format="DD MMM YYYY">{event?.createdAt}</Moment>
312316
</ListItemText>
313317
</ListItem>
314318
<div className="post-details2">{event?.description?.shortDescription}</div>
@@ -414,55 +418,6 @@ function NewsFeed(props) {
414418
</div>
415419
</div>
416420
<div className="news__feed__container">
417-
{/* <div className="posts">
418-
<span className="category">
419-
<span className="to-centre">
420-
{first === "f" ? (
421-
<Button
422-
active
423-
variant="primary"
424-
className="category-btn"
425-
onClick={handleClick("All")}
426-
>
427-
<span className="btn-content">All</span>
428-
</Button>
429-
) : (
430-
<Button
431-
autoFocus
432-
variant="primary"
433-
className="category-btn"
434-
onClick={handleClick("All")}
435-
>
436-
All
437-
</Button>
438-
)}
439-
<span className="space"></span>
440-
<Button
441-
variant="primary"
442-
className="category-btn"
443-
onClick={handleClick("Post")}
444-
>
445-
<span className="btn-content">Posts</span>
446-
</Button>
447-
<span className="space"></span>
448-
<Button
449-
variant="primary"
450-
className="category-btn"
451-
onClick={handleClick("Event")}
452-
>
453-
<span className="btn-content">Events</span>
454-
</Button>
455-
<span className="space"></span>
456-
<Button
457-
variant="primary"
458-
className="category-btn"
459-
onClick={handleClick("Project")}
460-
>
461-
<span className="btn-content">Projects</span>
462-
</Button>
463-
</span>
464-
</span>
465-
</div> */}
466421
<div className="tabs__container">
467422
<span className="nav__tab container">
468423
<ul className="nav__list__container">

src/user/dashboard/news-feed/news-feed.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
border-bottom: 1px solid rgba(204, 204, 204, 0.7);
130130
border-left: 1px solid rgba(204, 204, 204, 0.7);
131131
.time-content {
132-
width: 50%;
132+
width: 90%;
133133
margin: 0 auto;
134134
small {
135135
font-family: Inter;

src/user/dashboard/news-feed/popups/comment.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,14 @@ class Comment extends Component {
6565
</Col>
6666
<Col md={10}>
6767
<div className="contain">
68-
<p className="user">{comment?.userId?.name?.firstName + " " + comment?.userId?.name?.lastName || "User name"}</p>
69-
<p className="comment">{comment.content || "Comment content"}
70-
{checkDeleteRights(comment.userId?._id) ? (<MdDelete size={20} className="delete__icon" onClick={this.onDelete.bind(this, comment._id)}
71-
/>) : null}
68+
<p className="user">
69+
{comment?.userId?.name?.firstName + " " + comment?.userId?.name?.lastName || "User name"}</p>
70+
<p className="comment">
71+
{comment.content || "Comment content"}
72+
{checkDeleteRights(comment.userId?._id)
73+
? (<MdDelete size={20} className="delete__icon" onClick={this.onDelete.bind(this, comment._id)}
74+
/>)
75+
: null}
7276
</p>
7377
</div>
7478
</Col>

0 commit comments

Comments
 (0)