diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..016f04cc --- /dev/null +++ b/.travis.yml @@ -0,0 +1,2 @@ +before_install: + - chmod +x build.sh \ No newline at end of file diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 diff --git a/READMEassets/Home.jpg b/READMEassets/Home.jpg old mode 100755 new mode 100644 diff --git a/READMEassets/Info.png b/READMEassets/Info.png old mode 100755 new mode 100644 diff --git a/READMEassets/about.jpg b/READMEassets/about.jpg old mode 100755 new mode 100644 diff --git a/READMEassets/about2.jpg b/READMEassets/about2.jpg old mode 100755 new mode 100644 diff --git a/READMEassets/codeuino.png b/READMEassets/codeuino.png old mode 100755 new mode 100644 diff --git a/READMEassets/dashboard.png b/READMEassets/dashboard.png old mode 100755 new mode 100644 diff --git a/READMEassets/doughnut.png b/READMEassets/doughnut.png old mode 100755 new mode 100644 diff --git a/READMEassets/edit_profile.png b/READMEassets/edit_profile.png old mode 100755 new mode 100644 diff --git a/READMEassets/feeds.png b/READMEassets/feeds.png old mode 100755 new mode 100644 diff --git a/READMEassets/forking-the-repo.gif b/READMEassets/forking-the-repo.gif old mode 100755 new mode 100644 diff --git a/READMEassets/landing.gif b/READMEassets/landing.gif old mode 100755 new mode 100644 diff --git a/READMEassets/running-locally.gif b/READMEassets/running-locally.gif old mode 100755 new mode 100644 diff --git a/READMEassets/signup_community.png b/READMEassets/signup_community.png old mode 100755 new mode 100644 diff --git a/READMEassets/signup_user.png b/READMEassets/signup_user.png old mode 100755 new mode 100644 diff --git a/READMEassets/womenwhocode.png b/READMEassets/womenwhocode.png old mode 100755 new mode 100644 diff --git a/src/App.js b/src/App.js index 52cdb160..46f27d8c 100644 --- a/src/App.js +++ b/src/App.js @@ -38,7 +38,7 @@ class App extends Component { rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" - crossorigin="anonymous" + crossOrigin="anonymous" /> diff --git a/src/actions/eventAction.js b/src/actions/eventAction.js new file mode 100644 index 00000000..a7961b1c --- /dev/null +++ b/src/actions/eventAction.js @@ -0,0 +1,43 @@ +import axios from 'axios'; +import { errorHandler } from '../utils/errorHandler'; +import { setRequestStatus } from '../utils/setRequestStatus'; + +// DELETE EVENT REQUEST +export const deleteEvent = (eventId) => async (dispatch) => { + try { + const res = await axios.delete(`/event/${eventId}`) + dispatch(setRequestStatus(false)); + if(res.status === 200){ + dispatch(setRequestStatus(true)); + } + } catch(error) { + dispatch(errorHandler(error)) + } +} + +// UPDATE EVENT REQUEST +export const updateEvent = (eventId, updatedInfo) => async (dispatch) => { + try { + const res = await axios.patch(`/event/${eventId}`, updatedInfo); + dispatch(setRequestStatus(false)); + if(res.status === 200){ + dispatch(setRequestStatus(true)); + } + } catch(error) { + dispatch(errorHandler(error)) + } +} + +// CREATE EVENT +export const createEvent = (eventInfo, history) => async (dispatch) => { + try { + const res = await axios.post('/event/', eventInfo) + dispatch(setRequestStatus(false)) + if(res.status === 201){ + dispatch(setRequestStatus(true)) + history.push('/events'); + } + } catch(error) { + dispatch(errorHandler(error)) + } +} diff --git a/src/images/jitsi.png b/src/images/jitsi.png new file mode 100644 index 00000000..308864f6 Binary files /dev/null and b/src/images/jitsi.png differ diff --git a/src/index.css b/src/index.css index 21c28d58..ac3c063f 100644 --- a/src/index.css +++ b/src/index.css @@ -6,6 +6,8 @@ body { /* font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; */ + box-sizing: border-box; + overflow-x: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } diff --git a/src/svgs/donut-icon.svg b/src/svgs/donut-icon.svg index bb4666aa..b7079ea9 100644 --- a/src/svgs/donut-icon.svg +++ b/src/svgs/donut-icon.svg @@ -1,3 +1,3 @@ - + diff --git a/src/user/dashboard/navigation/navigation.js b/src/user/dashboard/navigation/navigation.js index 4e553e88..9b074b51 100644 --- a/src/user/dashboard/navigation/navigation.js +++ b/src/user/dashboard/navigation/navigation.js @@ -6,7 +6,8 @@ import { DonutTitleSmall } from "../../../donutTitle/donutTitle"; import "./navigation.scss"; import Logout from "../../profile/popups/Logout"; import logo from "../../../svgs/logout.svg"; -import { Info } from "../../integrations/NameForm"; +import {Info} from "../../integrations/NameForm"; +import JitsiMeets from '../../../images/jitsi.png' class Navigation extends Component { state = { logout: false }; @@ -20,13 +21,14 @@ class Navigation extends Component { open: false, }); const divStyle = { - marginTop: "80px", + position: "fixed", + bottom: '5em' }; const divStyle2 = { - position: "absolute", - bottom: 0, + position: "fixed", + bottom: "2em" }; - + const { dashboard, posts, org, event, proj, profile, logout, settings } = this.props; return (
@@ -37,9 +39,7 @@ class Navigation extends Component {
- + @@ -60,7 +60,7 @@ class Navigation extends Component { Dashboard - + @@ -83,7 +83,7 @@ class Navigation extends Component { Pinned Posts - + @@ -105,7 +105,7 @@ class Navigation extends Component { - + @@ -127,7 +127,7 @@ class Navigation extends Component { - + @@ -149,9 +149,7 @@ class Navigation extends Component { - + @@ -171,22 +169,9 @@ class Navigation extends Component { Account - - - {this.state.open ? ( - - ) : null} - Settings - + + - -

CODEUINO

+ + +
this.setState({ open: true })} + > + jitsi + Jitsi Meet +
+ {this.state.open ? ( + + ) : null}
diff --git a/src/user/dashboard/navigation/navigation.scss b/src/user/dashboard/navigation/navigation.scss index 57db417d..2cce548b 100644 --- a/src/user/dashboard/navigation/navigation.scss +++ b/src/user/dashboard/navigation/navigation.scss @@ -54,9 +54,16 @@ } .jitsi { - margin-left: 12.5px; + display: flex; color: rgba(0, 0, 0, 0.5); } +.jitsi-meet{ + height: 21px; + width: 21px; + color: rgba(0, 0, 0, 0.5); + margin-right: 15px; + margin-left: 2px; +} .navigation { .list-group { @@ -79,17 +86,10 @@ margin-left: 2px; } -.log-button { - margin-left: -8.5px; - color: rgba(0, 0, 0, 0.5); -} - -.logo-text { - font-family: Inter; - font-style: normal; - font-weight: 500; - font-size: 12px; - text-align: center; - letter-spacing: 3.6px; +.log-button{ + margin-left: -8.5px; + position: fixed; + z-index: 999; color: rgba(0, 0, 0, 0.5); + bottom: 2em; } diff --git a/src/user/events/events.js b/src/user/events/events.js index 87d71980..00786493 100644 --- a/src/user/events/events.js +++ b/src/user/events/events.js @@ -5,44 +5,99 @@ import Event_list from "../../jsonData/events"; import { Row, Col } from "react-bootstrap"; import "./events.scss"; import Popups from './popups/popups'; +import DeleteEvent from "./popups/DeleteEvent"; +import EditEvent from "./popups/EditEvent"; class Events extends Component { constructor(props) { super(props); this.state = { event: true, - modalShow: false, - optionValue: {} + modalShow: false, + optionValue: {}, + delete: false, + edit: false } } render() { const setOptionValue = (targetId) => { - const event = Event_list.filter( - (x) => x._id === targetId - ); - this.setState({optionValue: event[0]}) + const event = Event_list.filter((x) => x._id === targetId); + this.setState({optionValue: event[0]}) } + const handleToggle = (e) => { const targetId = e.target.id; console.log("-handletoggel",targetId) - this.setState({ - modalShow: true - }); + this.setState({ modalShow: true }); setOptionValue(targetId); } + var RefinedDay = (d) => { const day = d.slice(0, 3); return day; }; - var RefinedYear = (d) => { + const editEvent = (e) => { + e.preventDefault(); + this.setState({ modalShow: false, edit: true }) + } + + const handleDelete = (e) => { + this.setState({ modalShow: false, delete: true }) + } + + const cancel = () => { + this.setState({ delete: false, edit: false }) + } + + const RefinedYear = (d) => { const month = d.slice(4, 7); const year = d.slice(11, 15); return month + " " + year; }; - let Events = Event_list.map((Item) => ( - + + const FooterOfEvents = ({ Item }) => { + return ( +
+ + +
+ + Edit + Delete + +
+ +
+ ) + } + + let Events = Event_list.map((Item, index) => ( + {Date.parse(Item.eventDate) >= Date.parse(new Date()) ? ( @@ -109,7 +164,9 @@ class Events extends Component { )} - See More +
@@ -181,7 +238,7 @@ class Events extends Component { )} - See More + @@ -205,10 +262,10 @@ class Events extends Component { + option={this.state.option} + optionValue={this.state.optionValue} + modalShow={this.state.modalShow} + /> ); } diff --git a/src/user/events/events.scss b/src/user/events/events.scss index 547b423b..432e4918 100644 --- a/src/user/events/events.scss +++ b/src/user/events/events.scss @@ -5,7 +5,6 @@ font-family: Muli, sans-serif; .events { margin-top: 2vh; - } } @@ -34,7 +33,7 @@ width: 10px; margin: 1px; text-align: center; - height: 100%; + height: 100%; font-size: 30px; } @@ -43,7 +42,7 @@ width: 10px; margin: 1px; text-align: center; - height: 100%; + height: 100%; font-size: 30px; } @@ -52,7 +51,7 @@ width: 10px; margin: 1px; text-align: center; - height: 100%; + height: 100%; font-size: 30px; } @@ -90,17 +89,19 @@ } .short-des{ -font-weight: 100; -font-size: smaller; -color: #5d5d5d; + font-weight: 100; + font-size: smaller; + color: #5d5d5d; + text-align: justify; + text-overflow: ellipsis; } .createdAt{ -text-align: center; -font-size: 12px; -font-weight: bold; + text-align: center; + font-size: 12px; + font-weight: bold; } .event-card{ -max-width: 345px; -margin-top: 20px; + max-width: 345px; + margin-top: 20px; } \ No newline at end of file diff --git a/src/user/events/popups/DeleteEvent.js b/src/user/events/popups/DeleteEvent.js new file mode 100644 index 00000000..0cc9d429 --- /dev/null +++ b/src/user/events/popups/DeleteEvent.js @@ -0,0 +1,70 @@ +import React, { Component } from 'react' +import { Modal, Button } from 'react-bootstrap'; +import PropTypes from 'prop-types'; +import { connect } from 'react-redux'; +import "./popup.scss"; +import { deleteEvent } from '../../../actions/eventAction'; + +class DeleteEvent extends Component { + constructor(props) { + super(props); + this.state = { + eventId: '', + success: false + } + } + + deleteEventClick = (e) => { + e.preventDefault(); + console.log("Clicked on delete event") + this.props.deleteEvent(this.props.eventId); + if(this.props.status.success){ + this.setState({ show: false, success: true }) + } else { + console.log('Something went wrong!') + } + } + + render() { + const { show, onHide, eventId } = this.props; + return ( +
+ +
+ + +
Delete Event?
+
Are you sure you want to delete this event?
+
+
+ +
+ + +
+
+
+
+ ) + } +} + +DeleteEvent.propTypes = { + show: PropTypes.bool.isRequired, + onHide: PropTypes.func.isRequired, + eventId: PropTypes.string.isRequired +} + +const mapStateToProps = (state) => ({ + auth: state.auth, + error: state.error, + status: state.status +}) + +export default connect(mapStateToProps, { deleteEvent })(DeleteEvent); \ No newline at end of file diff --git a/src/user/events/popups/EditEvent.js b/src/user/events/popups/EditEvent.js new file mode 100644 index 00000000..2541235d --- /dev/null +++ b/src/user/events/popups/EditEvent.js @@ -0,0 +1,157 @@ +import React, {Component} from 'react'; +import {Modal, Button, Row, Col, Form} from 'react-bootstrap'; +import "./popup.scss"; +import { connect } from 'react-redux'; +import { updateEvent, deleteEvent } from '../../../actions/eventAction'; +import PropTypes from 'prop-types' + + +class EditEvent extends Component { + constructor(props) { + super(props); + this.state = { + eventName: "", + shortDesc: "", + longDesc: "", + location: "", + date: "", + }; + } + + componentDidMount = () => { + // FETCH THE EVENT DETAILS ON POPUP GETS TRIGGERED (INTEGRATION) + console.log("Fetching the event details!"); + }; + + onChange = (event) => { + const { name, value } = event.target; + this.setState({ [name]: value }); + }; + + updateEvent = (e) => { + e.preventDefault(); + console.log("Updating the event!!"); + // DISPATCH THE ACTION TO UPDATE EVENT (INTEGRATION) + const { eventName, shortDesc, longDesc, date, location } = this.state; + const { eventId } = this.props; + const updatedInfo = { + eventName, + description: { + shortDescription: shortDesc, + longDescription: longDesc, + }, + location, + eventDate: date, + }; + console.log('submitted data ', updatedInfo); + this.props.updateEvent(eventId, updatedInfo); + }; + + render() { + const { show, onHide } = this.props; + + return ( + +
+ + +
Edit Event
+
Event Information
+
+
+ + + + Event Name + + + + + Short description + + + + Long description + + + + Location + + + + Event Date + + + +
+ + +
+
+
+ ); + } +} + +EditEvent.propTypes = { + show: PropTypes.bool.isRequired, + onHide: PropTypes.func.isRequired, + eventId: PropTypes.string.isRequired +} + +const mapStateToProps = (state) => ({ + error: state.error, + statue: state.status +}) + +export default connect(mapStateToProps, { updateEvent, deleteEvent })((EditEvent)) diff --git a/src/user/events/popups/popup.scss b/src/user/events/popups/popup.scss index 96c35c17..d9fc2de0 100644 --- a/src/user/events/popups/popup.scss +++ b/src/user/events/popups/popup.scss @@ -27,6 +27,26 @@ .info-description{ font-size: 15px; - text-align: center; + text-align: justify; color:rgb(56, 55, 55); +} + +.form-footer { + margin-top: 0; + Button { + width: 90px; + margin-right: 20px; + margin-bottom: 30px; + border-radius: 100px; + font-weight: 600; + } + .savebtn { + background-color: #1A73E8; + } +} +.modal-backdrop { + background-color: rgba(0,0,0, 0.1) !important; +} +.modal-backdrop.in{ + opacity: 0.5; } \ No newline at end of file diff --git a/src/user/pinned-posts/posts/pinPosts.js b/src/user/pinned-posts/posts/pinPosts.js index 70b68ebf..d26f26bd 100644 --- a/src/user/pinned-posts/posts/pinPosts.js +++ b/src/user/pinned-posts/posts/pinPosts.js @@ -70,10 +70,10 @@ export default function PinPosts(props){ changeType(atrb); second('s'); }; - let posts = feed.map((newsItem) => { + let posts = feed.map((newsItem, index) => { if(newsItem.type === "Project" && (type === 'All' || type === newsItem.type)){ return( -
+
) }else if(newsItem.type === "Event" && (type === 'All' || type === newsItem.type)){ return( -
+
) }else if(newsItem.type === "Donut" && (type === 'All' || type === newsItem.type)){ return( -
+
@@ -275,9 +275,9 @@ export default function PinPosts(props){

Pinned Posts

{ (first === 'f') ? - : - } + +
+ + ); + } +} +// 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/projects/projects.js b/src/user/projects/projects.js index cad9f488..e9c831e0 100644 --- a/src/user/projects/projects.js +++ b/src/user/projects/projects.js @@ -44,7 +44,6 @@ class Projects extends Component { className="img" image={Item.image} /> - {Item.Proj_name} @@ -55,13 +54,9 @@ class Projects extends Component { - - - - -
diff --git a/src/user/projects/projects.scss b/src/user/projects/projects.scss index f5cef1e8..045aab75 100644 --- a/src/user/projects/projects.scss +++ b/src/user/projects/projects.scss @@ -1,7 +1,6 @@ .organization { display: flex; min-height: 100vh; - height: auto; font-family: Muli, sans-serif; .navigation { flex: 0.5;