-
Notifications
You must be signed in to change notification settings - Fork 65
Resolved Conflicts #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: development
Are you sure you want to change the base?
Changes from 10 commits
39a8557
f647685
6349cc8
fffbfd7
b0f21a3
8645825
45ad74a
3777230
8a5904a
d7da621
00a5daf
091e255
5d26fc8
3c4d238
21204d5
ab1082c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,21 @@ | ||
| 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 +26,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 +65,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 +151,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 +169,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,19 +200,21 @@ 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 }); | ||
| }; | ||
|
|
||
| const handleSpeakerChange = (e) => { | ||
| const { id, name, value } = e.target; | ||
| const s = [...speaker]; | ||
| s[parseInt(id, 10)][name] = value; | ||
| let { id, name, value } = e.target; | ||
| let s = [...speaker]; | ||
Amishakumari544 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| s[parseInt(id)][name] = value; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing radix parameter take reference here
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This all errors are not from my code someone has added these functions i don't know who is but that person has not resolved all this and i have to face this all issue, |
||
| setSpeaker(s); | ||
| }; | ||
|
|
||
|
|
@@ -261,10 +257,14 @@ function CreateNewEvent() { | |
| history.push(`/events/${docRef.id}`); | ||
| }); | ||
| }; | ||
| // const handleSubmit = () =>{ | ||
| // console.log('submit'); | ||
| // } | ||
|
|
||
| return ( | ||
| <DrawerLayout> | ||
| <div className={classes.root}> | ||
| <DrawerLayout> | ||
| <div className={classes.root}> | ||
| <ValidatorForm onSubmit={handleSubmit} onError={errors => console.log(errors)}> | ||
|
||
| <Box display="flex" style={{ width: '100%' }}> | ||
| <Box flexGrow={1}> | ||
| <Grid container> | ||
|
|
@@ -276,31 +276,35 @@ function CreateNewEvent() { | |
| </Grid> | ||
| <Grid container className={classes.event}> | ||
| <Grid style={{ width: '100%' }}> | ||
| <TextField | ||
| <TextValidator | ||
| placeholder="Enter name of the event" | ||
| className={classes.textField} | ||
| fullWidth | ||
| name="eventName" | ||
| value={formData.eventName} | ||
| variant="outlined" | ||
| // variant="outlined" | ||
| onChange={handleChange} | ||
| validators={['required']} | ||
| errorMessages={['This is a required field']} | ||
| /> | ||
|
|
||
| <TextField | ||
| placeholder="Add Description of the event" | ||
| <TextValidator | ||
| placeholder="Add Description of the event" | ||
Amishakumari544 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| className={classes.textField} | ||
| multiline | ||
| rows={4} | ||
| fullWidth | ||
| name="description" | ||
| value={formData.description} | ||
| variant="outlined" | ||
| // variant="outlined" | ||
| onChange={handleChange} | ||
| validators={['required']} | ||
| errorMessages={['This is a required field']} | ||
| /> | ||
|
|
||
| <Grid container> | ||
| <Grid item xs={12} sm={12} md={6}> | ||
| <TextField | ||
| <TextValidator | ||
| id="date" | ||
| type="date" | ||
| defaultValue="2017-05-24" | ||
|
|
@@ -312,54 +316,75 @@ function CreateNewEvent() { | |
| shrink: true | ||
| }} | ||
| style={{ marginRight: '30px' }} | ||
| validators={['required']} | ||
| errorMessages={['This is a required field']} | ||
| /> | ||
| </Grid> | ||
| <Grid item xs={12} sm={12} md={6}> | ||
| <TextField | ||
| <TextValidator | ||
| fullWidth | ||
| className={classes.input1} | ||
| type="time" | ||
| name="time" | ||
| value={formData.time} | ||
| id="time" | ||
| defaultValue="07:30" | ||
| variant="outlined" | ||
| // variant="outlined" | ||
| onChange={handleChange} | ||
| validators={['required']} | ||
| errorMessages={['This is a required field']} | ||
| /> | ||
| </Grid> | ||
| </Grid> | ||
|
|
||
| <TextField | ||
| <TextValidator | ||
| fullWidth | ||
| className={classes.textField} | ||
| placeholder="Event link / Registration link" | ||
| name="eventLink" | ||
| value={formData.eventLink} | ||
| variant="outlined" | ||
| // variant="outlined" | ||
| onChange={handleChange} | ||
| validators={[ | ||
| 'required']} | ||
| errorMessages={[ | ||
| 'This is a required field', | ||
| 'Please enter a valid contact number' | ||
| ]} | ||
| /> | ||
| {speaker.map((item, idx) => ( | ||
| <fieldset className={classes.socialLinks}> | ||
| <InputBase | ||
| className={classes.social} | ||
| <fieldset className={classes.speakerInput}> | ||
| <TextValidator | ||
| className={classes.speaker} | ||
| fullWidth | ||
| id={idx.toString()} | ||
| name="speakerName" | ||
| value={speaker.speakerName} | ||
| value={item.speakerName} | ||
| placeholder="Speaker Name" | ||
| onChange={handleSpeakerChange} | ||
| validators={['required']} | ||
| errorMessages={['This is a required field']} | ||
| /> | ||
| <InputBase | ||
| className={classes.social} | ||
| <TextValidator | ||
| key="linkedIn" | ||
|
||
| className={classes.speaker} | ||
| fullWidth | ||
| id={idx.toString()} | ||
| name="speakerLinkedIn" | ||
| value={speaker.speakerLinkedIn} | ||
| value={item.speakerLinkedIn} | ||
| placeholder="Speaker LinkedIn Profile Link" | ||
| onChange={handleSpeakerChange} | ||
| validators={[ | ||
| 'required', | ||
| 'matchRegexp:^(http(s)?://)?([w]+.)?linkedin.com/(pub|in|profile)' | ||
| ]} | ||
| errorMessages={[ | ||
| 'This is a required field', | ||
| 'Please enter a valid URL' | ||
| ]} | ||
| /> | ||
| </fieldset> | ||
| ))} | ||
| ))} | ||
|
||
|
|
||
| {speaker.length > 1 && ( | ||
| <Button className={classes.button} onClick={removeSpeaker}> | ||
|
|
@@ -369,7 +394,6 @@ function CreateNewEvent() { | |
| <Button className={classes.button} onClick={addSpeaker}> | ||
| Add Speaker | ||
| </Button> | ||
| {/* </div> */} | ||
| </Grid> | ||
| </Grid> | ||
| <div className={classes.createbtn}> | ||
|
|
@@ -379,7 +403,7 @@ function CreateNewEvent() { | |
| > | ||
| Cancel | ||
| </Button> | ||
| <Button className={classes.addbtn} onClick={handleSubmit}> | ||
| <Button className={classes.addbtn} type="submit"> | ||
| Create | ||
| </Button> | ||
| </div> | ||
|
|
@@ -391,7 +415,7 @@ function CreateNewEvent() { | |
| onChange={onDrop} | ||
| withPreview={imageURL !== null} | ||
| singleImage | ||
| imgExtension={['.jpg', '.gif', '.png', '.gif']} | ||
| imgExtension={['.jpg', '.gif', '.png']} | ||
| maxFileSize={5242880} | ||
| fileContainerStyle={{ | ||
| boxShadow: '2px 2px 3px 1px rgb(0, 0, 0, 0.5)' | ||
|
|
@@ -405,8 +429,9 @@ function CreateNewEvent() { | |
| style={{ marginLeft: '10px', marginTop: '20px' }} | ||
| /> | ||
| </Box> | ||
| </Box> | ||
| </div> | ||
| </Box> | ||
| </ValidatorForm> | ||
| </div> | ||
| </DrawerLayout> | ||
|
||
| ); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,14 @@ | ||
| import { | ||
| Box, Button, Grid, makeStyles | ||
| } from '@material-ui/core'; | ||
| import { 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'; | ||
|
|
||
| const useStyles = makeStyles((theme) => ({ | ||
| const useStyles = makeStyles(theme => ({ | ||
|
||
| button: { | ||
| marginLeft: '120px', | ||
| marginTop: '20px', | ||
|
|
@@ -31,7 +29,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,15 +37,16 @@ export default function EventDefaultPage() { | |
| const [eventsAttended, setEventsAttended] = useState(0); | ||
|
|
||
| useEffect(() => { | ||
| setEventsConducted(2); | ||
| setEventsAttended(2); | ||
| }, []); | ||
|
|
||
| return ( | ||
| <DrawerLayout> | ||
| <Grid container> | ||
| <Grid justify="center" md={8} sm={12} xs={12}> | ||
| { bookmarkEvent !== null && <BookmarkedEvents /> } | ||
| {/* <SearchBar /> */} | ||
| <BookmarkedEvents /> | ||
| <SearchBar /> | ||
| <UserNewEvents /> | ||
| <Box textAlign="center"> | ||
| <Button className={classes.button} onClick={handleClick}> | ||
|
|
@@ -57,7 +55,7 @@ export default function EventDefaultPage() { | |
| </Box> | ||
| </Grid> | ||
| <Grid md={4} sm={12} xs={12}> | ||
| <UserUpcomingEvents setConducted={setEventsConducted} /> | ||
| <UserUpcomingEvents /> | ||
| <UserEventStats | ||
| conducted={eventsConducted} | ||
| attended={eventsAttended} | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.