diff --git a/src/App.js b/src/App.js index 9d3fd213..52cdb160 100644 --- a/src/App.js +++ b/src/App.js @@ -1,11 +1,13 @@ import React, { Component } from "react"; import Router from "./router"; import "./App.css"; -import { Provider } from 'react-redux'; -import store from './store'; -import jwt_decode from 'jwt-decode'; + +import { Provider } from "react-redux"; +import store from "./store"; +import jwt_decode from "jwt-decode"; import { setAuthToken } from "./utils/setAuthToken"; import { setCurrentUser, logoutUser } from "./actions/authAction"; +import "./css/main.scss"; class App extends Component { componentDidMount() { @@ -14,23 +16,23 @@ class App extends Component { console.log("CHECKING TOKEN ", token); if (token) { const decodedData = jwt_decode(token); - // set auth token in axios header + // set auth token in axios header setAuthToken(token); - // set user in the state + // set user in the state setCurrentUser(decodedData); // check if token is valid or expired const currentTime = Date.now() / 1000; // in ms const expiryTime = decodedData.iat + 10800000; // 24 hrs if (expiryTime <= currentTime) { store.dispatch(logoutUser()); - // now redirect to home page + // now redirect to home page window.location.href = "/"; } } } render() { return ( - + Logout - +

CODEUINO

diff --git a/src/user/dashboard/news-feed/news-feed.js b/src/user/dashboard/news-feed/news-feed.js index 45e6bdb2..7e24ba62 100644 --- a/src/user/dashboard/news-feed/news-feed.js +++ b/src/user/dashboard/news-feed/news-feed.js @@ -17,6 +17,7 @@ import { makeStyles } from "@material-ui/core/styles"; import { Button } from "react-bootstrap"; import MoreHorizIcon from "@material-ui/icons/MoreHoriz"; import AddEventModal from "./popups/AddEventModal"; +import AddProjectModal from "./popups/AddProjectModal"; import ArrowDropUpIcon from "@material-ui/icons/ArrowDropUp"; import ArrowDropDownIcon from "@material-ui/icons/ArrowDropDown"; import ChatBubbleIcon from "@material-ui/icons/ChatBubble"; @@ -80,17 +81,26 @@ export default function PinPosts(props) { const classes = styles(); const [type, changeType] = React.useState("All"); const [first, second] = React.useState("f"); - const [show, setShow] = React.useState(false); + const [showProject, setShowProject] = React.useState(false); + const [showEvent, setShowEvent] = React.useState(false); let handleClick = (atrb) => () => { changeType(atrb); second("s"); }; - let handleShow = () => { - setShow(true); + let handleShow = (modalName) => { + if (modalName === "project") { + setShowProject(true); + } else if (modalName === "event") { + setShowEvent(true); + } }; - let handleClose = () => { - setShow(false); + let handleClose = (modalName) => { + if (modalName === "project") { + setShowProject(false); + } else if (modalName === "event") { + setShowEvent(false); + } }; let posts = feed.map((newsItem) => { if ( @@ -330,7 +340,9 @@ export default function PinPosts(props) { > - - + { + handleClose("project"); + }} + /> diff --git a/src/user/dashboard/news-feed/news-feed.scss b/src/user/dashboard/news-feed/news-feed.scss index 02c03613..8ccada06 100644 --- a/src/user/dashboard/news-feed/news-feed.scss +++ b/src/user/dashboard/news-feed/news-feed.scss @@ -403,77 +403,6 @@ } } -.modal-box { - .modal-header { - .modal-title { - .main { - font-family: Inter; - font-style: normal; - font-weight: 600; - font-size: 32px; - line-height: 39px; - color: #1a73e8; - } - .mini { - font-family: Inter; - font-style: normal; - font-weight: 500; - font-size: 12px; - line-height: 19px; - color: #90949c; - letter-spacing: 0.2em; - padding-top: 18px; - } - } - } - .modal-body { - .modal-form { - .modal-row { - .modal-group { - .form-label { - font-family: Inter; - font-style: normal; - font-weight: 500; - font-size: 14px; - line-height: 17px; - color: #1a73e8; - } - .post { - border: 0.75px solid #e2e2e2; - box-sizing: border-box; - border-radius: 5px; - text-align: left; - resize: none; - margin-left: 0; - } - } - } - } - } - .modal-buttons { - .save { - font-weight: bold; - background: #1a73e8; - box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.1); - border-radius: 34px; - width: 74px; - margin-right: 20px; - margin-bottom: 10px; - margin-left: 14px; - } - .cancel { - border: 1px solid #1a73e8; - box-sizing: border-box; - box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.1); - border-radius: 34px; - margin-right: 20px; - margin-bottom: 10px; - color: #1a73e8; - font-weight: 500; - } - } -} - .posts { .category { .category-btn { diff --git a/src/user/dashboard/news-feed/popups/AddEventModal.js b/src/user/dashboard/news-feed/popups/AddEventModal.js index 18c41aae..50f924b1 100644 --- a/src/user/dashboard/news-feed/popups/AddEventModal.js +++ b/src/user/dashboard/news-feed/popups/AddEventModal.js @@ -8,84 +8,81 @@ const AddEventModal = (props) => { show={props.show} onHide={props.handleClose} animation={false} - className="modal-box" + className="modal" + centered > - -
New Event
-
ABOUT THE EVENT
+ +
New Event
+
ABOUT THE EVENT
- -
- + + + - Event Name + Event Name - Location + Location - + - Date + Date - Time + Time - + - Post Description + Post Description -
- -
diff --git a/src/user/dashboard/news-feed/popups/AddProjectModal.js b/src/user/dashboard/news-feed/popups/AddProjectModal.js new file mode 100644 index 00000000..063044db --- /dev/null +++ b/src/user/dashboard/news-feed/popups/AddProjectModal.js @@ -0,0 +1,101 @@ +import React from "react"; +import { Button, Modal, Form, Col } from "react-bootstrap"; +import PropTypes from "prop-types"; + +const AddProjectModal = (props) => { + return ( + + + +
New Project
+
ABOUT THE PROJECT
+
+
+ +
+ + + Project Name + + + + + + + Project Contributers + + + + + + + + Project Description + + + + + + + Github Link + + + + + Other Link + + + +
+
+
+ + +
+
+ ); +}; +AddProjectModal.propTypes = { + onClick: PropTypes.func, + show: PropTypes.bool, + style: PropTypes.object, +}; + +export default AddProjectModal; diff --git a/src/user/dashboard/news-feed/popups/comment.js b/src/user/dashboard/news-feed/popups/comment.js index 57ad7538..d76e0256 100644 --- a/src/user/dashboard/news-feed/popups/comment.js +++ b/src/user/dashboard/news-feed/popups/comment.js @@ -1,76 +1,86 @@ -import React, {Component} from 'react'; -import {Modal, Button, Row, Col, Form} from 'react-bootstrap'; -import "./comment.scss" +import React, { Component } from "react"; +import { Modal, Button, Row, Col, Form } from "react-bootstrap"; +import "./comment.scss"; -import comments from '../../../../jsonData/comments' -export class Comment extends Component{ - // eslint-disable-next-line - constructor(props){ - super(props); - this.state={ - comment:"" - } - this.onChange = this.onChange.bind(this); - this.onSubmit = this.onSubmit.bind(this); - } +import comments from "../../../../jsonData/comments"; +export class Comment extends Component { + // eslint-disable-next-line + constructor(props) { + super(props); + this.state = { + comment: "", + }; + this.onChange = this.onChange.bind(this); + this.onSubmit = this.onSubmit.bind(this); + } - onChange(e) { this.setState({ [e.target.name]: e.target.value }); } - onSubmit(e){ - e.preventDefault(); - const comment = this.state - - console.log(comment) - } - render(){ - -var all_comments = comments.map((comment)=>( - - I -
-

{comment.name}

-

{comment.comment}

-
-
-)) + onSubmit(e) { + e.preventDefault(); + const comment = this.state; + console.log(comment); + } + render() { + var all_comments = comments.map((comment) => ( + + + I + + +
+

{comment.name}

+

{comment.comment}

+
+ +
+ )); return ( - -
- - -
Comment
-
-
- -
- - - - -
- + +
+ + +
Comment
+
+
+ + + + + + +
+ +
+ +
Other people who commented
+ {all_comments} +
- -
Other people who commented
- {all_comments} - -
); } -} \ No newline at end of file +} diff --git a/src/user/profile/popups/EditProfile.js b/src/user/profile/popups/EditProfile.js new file mode 100644 index 00000000..0fcdc5ca --- /dev/null +++ b/src/user/profile/popups/EditProfile.js @@ -0,0 +1,122 @@ +import React from "react"; +import { Button, Modal, Form, Col } from "react-bootstrap"; +import PropTypes from "prop-types"; + +const EditProfile = (props) => { + return ( + + + +
Edit Profile
+
PERSONAL INFORMATION
+
+
+ +
+ + + First Name + + + + + Last Name + + + + + + Designation + + + + + Location + + + + + + About + + + +
PROFILES
+ + + Github URL + + + + + LinkedIn URL + + + + + + Facebook URL + + + +
+
+
+ + +
+
+ ); +}; +EditProfile.propTypes = { + onClick: PropTypes.func, + show: PropTypes.bool, + style: PropTypes.object, +}; + +export default EditProfile; diff --git a/src/user/profile/popups/Followers.js b/src/user/profile/popups/Followers.js new file mode 100644 index 00000000..b48e20bf --- /dev/null +++ b/src/user/profile/popups/Followers.js @@ -0,0 +1,157 @@ +import React, { Component } from "react"; +import { Modal, Button, Row, Col, Image } from "react-bootstrap"; +import logo from "../../../svgs/logo-image.jpg"; + +export class Followers extends Component { + // eslint-disable-next-line + constructor(props) { + super(props); + } + state = { text: "Follow" }; + render() { + return ( + + + +
Followers
+
PEOPLE WHO FOLLOW YOU
+
+
+ + + + I + + + Dhanus Rajendra + + Front-End Developer + + + + + + + + + I + + + Dhanus Rajendra + + Front-End Developer + + + + + + + + + I + + + Dhanus Rajendra + + Front-End Developer + + + + + + + + + I + + + Dhanus Rajendra + + Front-End Developer + + + + + + + + + I + + + Dhanus Rajendra + + Front-End Developer + + + + + + + + + I + + + Dhanus Rajendra + + Front-End Developer + + + + + + + +
+ ); + } +} diff --git a/src/user/profile/popups/Logout.js b/src/user/profile/popups/Logout.js new file mode 100644 index 00000000..d010eb67 --- /dev/null +++ b/src/user/profile/popups/Logout.js @@ -0,0 +1,65 @@ +import React, { Component } from "react"; +import { Modal, Button, Form, Col } from "react-bootstrap"; +import { connect } from "react-redux"; +import { withRouter } from "react-router-dom"; +import { logoutUser } from "../../../actions/authAction"; + +class Logout extends Component { + // eslint-disable-next-line + constructor(props) { + super(props); + } + onLogoutClick = (e) => { + e.preventDefault(); + console.log("Logging out!"); + this.props.logoutUser(); + }; + render() { + return ( + + + +
Logout?
+
+
+ + +
+ + +
+ You sure you want to logout from Donut? +
+
+
+
+
+
+ + +
+
+ ); + } +} +// map state to props +const mapStateToProps = (state) => ({ + auth: state.auth, + error: state.error, +}); + +export default connect(mapStateToProps, { logoutUser })(withRouter(Logout)); diff --git a/src/user/profile/popups/edit-profile.js b/src/user/profile/popups/edit-profile.js deleted file mode 100644 index 86ac8a57..00000000 --- a/src/user/profile/popups/edit-profile.js +++ /dev/null @@ -1,99 +0,0 @@ -import React, {Component} from 'react'; -import {Modal, Button, Row, Col, Form} from 'react-bootstrap'; -import "./popups.scss"; - -export class EditProfile extends Component{ - // eslint-disable-next-line - constructor(props){ - super(props); - } - render(){ - return ( - -
- - -
Edit Profile
-
PERSONAL INFORMATION
-
-
- - - - First Name - - - - Last Name - - - - - - Designation - - - - Location - - - - - About - - -
PROFILES
- - - GitHub URL - - - - LinkedIn URL - - - - - - Facebook URL - - - -
-
- - -
-
-
- ); - } -} \ No newline at end of file diff --git a/src/user/profile/popups/followers.js b/src/user/profile/popups/followers.js deleted file mode 100644 index c673d738..00000000 --- a/src/user/profile/popups/followers.js +++ /dev/null @@ -1,81 +0,0 @@ -import React, {Component} from 'react'; -import {Modal, Button, Row, Col} from 'react-bootstrap'; -import logo from "../../../svgs/profile-icon.svg"; -import "./popups.scss"; - -export class Followers extends Component{ - // eslint-disable-next-line - constructor(props){ - super(props); - } - state = {text:"Follow"}; - render(){ - - return ( - -
- - -
Followers
-
PEOPLE WHO FOLLOW YOU
-
-
- - - I -
-

Dhanus Rajendra

-

Front-End Developer

-
- -
- - I -
-

Dhanus Rajendra

-

Front-End Developer

-
- -
- - I -
-

Dhanus Rajendra

-

Front-End Developer

-
- -
- - I -
-

Dhanus Rajendra

-

Front-End Developer

-
- -
- - I -
-

Dhanus Rajendra

-

Front-End Developer

-
- -
- - I -
-

Dhanus Rajendra

-

Front-End Developer

-
- -
-
-
-
- ); - } -} diff --git a/src/user/profile/popups/logout.js b/src/user/profile/popups/logout.js deleted file mode 100644 index 842e69fa..00000000 --- a/src/user/profile/popups/logout.js +++ /dev/null @@ -1,48 +0,0 @@ -import React, {Component} from 'react'; -import {Modal, Button} from 'react-bootstrap'; -import "./popups.scss"; -import { connect } from 'react-redux'; -import { withRouter } from 'react-router-dom'; -import { logoutUser } from '../../../actions/authAction'; - -class Logout extends Component{ - // eslint-disable-next-line - constructor(props){ - super(props); - } - onLogoutClick = (e) => { - e.preventDefault(); - console.log("Logging out!"); - this.props.logoutUser(); - } - render(){ - return ( - -
- - -
Logout?
-
Are you sure you want to logout of Donut?
-
-
- -
- - -
-
-
- ); - } -} -// map state to props -const mapStateToProps = (state) => ({ - auth: state.auth, - error: state.error -}); - -export default connect(mapStateToProps, { logoutUser })(withRouter(Logout)); \ No newline at end of file diff --git a/src/user/profile/popups/popups.scss b/src/user/profile/popups/popups.scss deleted file mode 100644 index 8e8f8f3c..00000000 --- a/src/user/profile/popups/popups.scss +++ /dev/null @@ -1,100 +0,0 @@ -.heading{ - margin-top: 20px; -} -.title{ - font-size: 22px; - font-weight: 700; - line-height: 29px; - color: #1A73E8; -} -.about{ - font-weight: 500; - font-size: 10px; - line-height: 14px; - letter-spacing: 0.2em; - color: #90949C; - margin-top:10px; -} -.message{ - font-weight: 500; - font-size: 14px; - line-height: 14px; - letter-spacing: 0.2em; - color: rgb(28, 30, 34); - margin-top:15px; - margin-bottom: 20px; -} -.extra{ - margin-bottom: 20px; - margin-left: -15px; -} -.label{ - font-weight: 600; - font-size: 12px; - color:#000000; - margin-bottom: 3px; -} -.form-input{ - font-family: Inter; - font-style: normal; - font-weight: 300; - font-size: 13px; - line-height: 16px; -} -.form-content{ - margin-top:-2%; - margin-bottom: 20px; - justify-content:space-between; -} -.form-footer{ - margin-top: 0; - Button{ - width:90px; - margin-right: 20px; - margin-bottom: 30px; - border-radius: 100px; - font-weight:600; - } - .savebtn{ - background-color: #1A73E8; - } - -} -.contain{ - margin-top: -3px; -} -.photo{ - margin-top: 3px; - height: 43px; - width: 43px; -} -.user{ - margin-top: 2px; - font-size: 1.1em; - color: black; -} -.descr{ - font-size: 0.8em; - color: rgb(90, 84, 84); - margin-top: -13px; -} -.follow-link{ - margin-top: 3px; - padding: 8px; - font-size: 14px; - box-shadow: 1px 2px 5px rgba(0, 0, 0, 0.1); - border-radius: 20px; - width: 80px; - height: 35px; - font-family: Inter; - font-style: normal; - font-weight: 600; - font-size: 14px; - line-height: 17px; - text-align: center; -} -.follower{ - margin-top: 10px; - margin-bottom: 10px; - justify-content:space-between; -} \ No newline at end of file diff --git a/src/user/profile/user-info/user-info.js b/src/user/profile/user-info/user-info.js index 4c806407..c0a65523 100644 --- a/src/user/profile/user-info/user-info.js +++ b/src/user/profile/user-info/user-info.js @@ -2,17 +2,19 @@ import React, { Component } from "react"; import "./user-info.scss"; import { Button } from "react-bootstrap"; import { Avatar } from "@material-ui/core"; -import {EditProfile} from "./../popups/edit-profile"; -import {Followers} from "./../popups/followers" +import EditProfile from "./../popups/EditProfile"; +import { Followers } from "../popups/Followers"; class UserInfo extends Component { - state = { editProfile:false, followersList:false }; + state = { editProfile: false, followersList: false }; render() { - let cancel =()=>this.setState({ - editProfile:false - }); - let cancelf =()=>this.setState({ - followersList:false - }); + let cancel = () => + this.setState({ + editProfile: false, + }); + let cancelf = () => + this.setState({ + followersList: false, + }); return (
@@ -20,18 +22,25 @@ class UserInfo extends Component {
- - + +

- Dhanus Rajendra - + Dhanus Rajendra{" "} + +

Front end developer

Bengaluru, Karnataka

diff --git a/src/user/projects/popups/delete-project.js b/src/user/projects/popups/delete-project.js index b2b06255..b7c757bb 100644 --- a/src/user/projects/popups/delete-project.js +++ b/src/user/projects/popups/delete-project.js @@ -1,24 +1,24 @@ import React, { Component } from "react"; import { Modal, Button } from "react-bootstrap"; -import "./popups.scss"; export class DeleteProject extends Component { - render() { return ( - - - Delete This Project - - - - - - + + + + Delete This Project + + + + + + + ); } } diff --git a/src/user/projects/popups/edit-project.js b/src/user/projects/popups/edit-project.js index 0dbc51b6..e5a0fa0a 100644 --- a/src/user/projects/popups/edit-project.js +++ b/src/user/projects/popups/edit-project.js @@ -1,29 +1,27 @@ import React, { Component } from "react"; import { Modal, Button, Row, Col, Form } from "react-bootstrap"; -import "./popups.scss"; export class EditProject extends Component { constructor(props) { super(props); this.state = { - Proj_name: '', - version: '', - short_des: '', - long_des: '', - github_link: '', - bitbucket_link: '', - host_link: '', - img_link: '' - } - this.trigger=0 - this.onChange = this.onChange.bind(this); + Proj_name: "", + version: "", + short_des: "", + long_des: "", + github_link: "", + bitbucket_link: "", + host_link: "", + img_link: "", + }; + this.trigger = 0; + this.onChange = this.onChange.bind(this); this.onSubmit = this.onSubmit.bind(this); } - componentWillReceiveProps(nextProps){ - if(this.trigger<1) - this.setState({...nextProps.data}) - this.trigger = this.trigger+1; - } + componentWillReceiveProps(nextProps) { + if (this.trigger < 1) this.setState({ ...nextProps.data }); + this.trigger = this.trigger + 1; + } onChange(e) { this.setState({ [e.target.name]: e.target.value }); @@ -31,13 +29,11 @@ export class EditProject extends Component { onSubmit(e) { e.preventDefault(); -const EditProject = this.state + const EditProject = this.state; console.log("Edited Project", EditProject); } - - render() { return ( -
+ Project Name