diff --git a/package-lock.json b/package-lock.json index 0ad9a0e..05bf3d8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,5 @@ { "name": "causefolio", - "version": "1.0.0", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package.json b/package.json index 3689d0a..6232a84 100644 --- a/package.json +++ b/package.json @@ -80,7 +80,7 @@ "react-helmet": "^6.1.0", "react-images-upload": "^1.2.8", "react-markdown": "^4.3.1", - "react-material-ui-form-validator": "^2.1.1", + "react-material-ui-form-validator": "^2.1.4", "react-modal-image": "^2.5.0", "react-perfect-scrollbar": "^1.5.8", "react-quill": "^1.3.5", diff --git a/src/components/CreateNewEvent.js b/src/components/CreateNewEvent.js index 03964b6..c1a048f 100644 --- a/src/components/CreateNewEvent.js +++ b/src/components/CreateNewEvent.js @@ -1,18 +1,18 @@ import React, { useState } from 'react'; import { makeStyles } from '@material-ui/styles'; import DrawerLayout from 'src/layouts/DrawerLayout'; +import { ValidatorForm, TextValidator } from 'react-material-ui-form-validator'; +// import CircularProgress from '@material-ui/core/CircularProgress'; import { Button, Grid, Box, Typography, - InputBase, - TextField, LinearProgress } from '@material-ui/core'; import ImageUploader from 'react-images-upload'; import { useSelector } from 'react-redux'; -import { firebase } from 'src/services/authService'; +import firebase from 'firebase'; import { useHistory } from 'react-router'; const useStyles = makeStyles((theme) => ({ @@ -23,14 +23,14 @@ const useStyles = makeStyles((theme) => ({ borderRadius: '20px', fontSize: '16px' }, - social: { - borderBottom: '1.3px solid #291757', + speaker: { marginBottom: '10px' }, - socialLinks: { + speakerInput: { marginBottom: '16px', marginTop: '8px', - backgroundColor: '#CCD2E3', + backgroundColor: 'rgb(232, 240, 254)', + border: '0', borderRadius: '20px', padding: '20px', '& .MuiOutlinedInput-notchedOutline': { @@ -62,23 +62,15 @@ const useStyles = makeStyles((theme) => ({ borderRadius: '20px', marginRight: '60px' }, - inputDiv: { - background: 'rgba(42, 23, 89, 0.25)', - borderRadius: '17px', - width: '451px', - marginBottom: '10px', - height: '70px' - }, input1: { border: '0', - // padding: '10px', font: 'inherit', + // border: '1px solid #848c83', width: '100%', - backgroundColor: '#CCD2E3', + backgroundColor: 'rgb(232, 240, 254)', borderRadius: '20px', outline: '0', - borderBlockColor: 'green', - borderColor: 'green', + padding: '12px', '& .MuiOutlinedInput-notchedOutline': { borderColor: '#F2F7FF', borderRadius: '20px', @@ -156,16 +148,15 @@ const useStyles = makeStyles((theme) => ({ }, date: { marginBottom: '16px', - backgroundColor: '#CCD2E3', - + backgroundColor: 'rgb(232, 240, 254)', borderRadius: '20px', padding: '12.5px 14px', + // border:'1px solid #848c83', '&:focus': { outline: 'none' }, '& .MuiOutlinedInput-notchedOutline': { - // borderColor: '#F2F7FF', borderRadius: '20px' }, [theme.breakpoints.down('md')]: { @@ -175,10 +166,10 @@ const useStyles = makeStyles((theme) => ({ textField: { marginBottom: '16px', marginTop: '8px', - backgroundColor: '#CCD2E3', + border: '0', + backgroundColor: 'rgb(232, 240, 254)', borderRadius: '20px', - borderBlockColor: 'green', - borderColor: 'green', + padding: '20px', '& .MuiOutlinedInput-notchedOutline': { borderColor: '#F2F7FF', borderRadius: '20px' @@ -206,10 +197,12 @@ function CreateNewEvent() { description: '', date: '', time: '', - eventLink: '' + eventLink: '', + speakerName: '', + speakerLinkedIn: '' }; const [formData, setFormData] = useState(initialFieldValues); - + // const [submit, setsubmit] = useState(0); const handleChange = (e) => { const { name, value } = e.target; setFormData({ ...formData, [name]: value }); @@ -218,7 +211,7 @@ function CreateNewEvent() { const handleSpeakerChange = (e) => { const { id, name, value } = e.target; const s = [...speaker]; - s[parseInt(id, 10)][name] = value; + s[parseInt(id)][name] = value; setSpeaker(s); }; @@ -253,159 +246,192 @@ function CreateNewEvent() { const db = firebase.firestore(); const ref = db.collection('events'); - ref - .add(formData) - .then((docRef) => { - setFormData(initialFieldValues); - setSpeaker([{}]); - history.push(`/events/${docRef.id}`); - }); + ref.add(formData).then((docRef) => { + setFormData(initialFieldValues); + setSpeaker([{}]); + history.push(`/events/${docRef.id}`); + }); }; + // const handleSubmit = () =>{ + // console.log('submit'); + // } return (
- - - - - - New Event - + console.log(errors)} + > + + + + + + New Event + + - - - - + + + - + - - - + + + + + + + - - - - - - {speaker.map((item, idx) => ( -
- - -
- ))} + + {speaker.map((item, idx) => ( +
+ + +
+ ))} - {speaker.length > 1 && ( - + )} + - )} - - {/*
*/} + - -
- - -
- - - - {imageURL === null && } - gallery-icon +
+ + +
+
+ + + {imageURL === null && } + gallery-icon + - +
); diff --git a/src/views/pages/events/eventdefault.js b/src/views/pages/events/eventdefault.js index a8dabf9..2a2c7ac 100644 --- a/src/views/pages/events/eventdefault.js +++ b/src/views/pages/events/eventdefault.js @@ -1,12 +1,15 @@ +import React, { useState, useEffect } from 'react'; import { - Box, Button, Grid, makeStyles +Box, +Button, +Grid, +makeStyles } from '@material-ui/core'; -import React, { useState, useEffect } from 'react'; import BookmarkedEvents from 'src/components/BookmarkedEvents'; import UserNewEvents from 'src/components/UserNewEvents'; import UserUpcomingEvents from 'src/components/UserUpcomingEvents'; import UserEventStats from 'src/components/UserEventStats'; -// import SearchBar from 'src/components/search'; +import SearchBar from 'src/components/search'; import DrawerLayout from 'src/layouts/DrawerLayout'; import { useHistory } from 'react-router-dom'; @@ -31,7 +34,6 @@ const useStyles = makeStyles((theme) => ({ export default function EventDefaultPage() { const classes = useStyles(); - const [bookmarkEvent] = useState(null); const history = useHistory(); const handleClick = () => { history.push('/createEvent'); @@ -40,6 +42,7 @@ export default function EventDefaultPage() { const [eventsAttended, setEventsAttended] = useState(0); useEffect(() => { + setEventsConducted(2); setEventsAttended(2); }, []); @@ -47,8 +50,8 @@ export default function EventDefaultPage() { - { bookmarkEvent !== null && } - {/* */} + +