Skip to content
This repository was archived by the owner on Mar 7, 2024. It is now read-only.

Commit c5dd1f0

Browse files
committed
Add and update values on features
1 parent ef2efa7 commit c5dd1f0

File tree

7 files changed

+308
-3
lines changed

7 files changed

+308
-3
lines changed

src/data/colleges.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import React from 'react';
2+
import Button from '@material-ui/core/Button';
3+
import { ValidatorForm, TextValidator} from 'react-material-ui-form-validator';
4+
5+
export class UserEdit extends React.Component {
6+
7+
state = {
8+
email: '',
9+
}
10+
11+
handleChange = (event) => {
12+
const email = event.target.value;
13+
this.setState({ email });
14+
}
15+
16+
handleSubmit = () => {
17+
// your submit logic
18+
}
19+
20+
render() {
21+
const { email } = this.state;
22+
return (
23+
<ValidatorForm
24+
ref="form"
25+
onSubmit={this.handleSubmit}
26+
>
27+
<TextValidator
28+
label="Email"
29+
variant="outlined"
30+
onChange={this.handleChange}
31+
name="email"
32+
value={email}
33+
validators={['required']}
34+
errorMessages={['This is a required field']}
35+
/>
36+
<Button type="submit">Submit</Button>
37+
</ValidatorForm>
38+
);
39+
}
40+
}
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
import React, { useState } from 'react';
2+
import {
3+
TextField,
4+
} from '@material-ui/core';
5+
import { makeStyles } from '@material-ui/core/styles';
6+
7+
import axios from 'axios';
8+
9+
const useStyles = makeStyles(theme => ({
10+
btn: {
11+
backgroundColor: '#A60000',
12+
color: '#ffffff',
13+
textTransform: 'capitalize',
14+
[theme.breakpoints.down('sm')]: {
15+
width: '100%'
16+
},
17+
'&:hover': {
18+
backgroundColor: 'rgba(166, 0, 0, 0.8)'
19+
}
20+
},
21+
textField: {
22+
marginBottom: '16px'
23+
},
24+
submissions: {
25+
width: "80px",
26+
height: "50px"
27+
}
28+
}));
29+
30+
export default function UserProfile() {
31+
const classes = useStyles();
32+
const [formData, updateFormData] = useState({});
33+
34+
const handleChange = event => {
35+
updateFormData({
36+
...formData,
37+
[event.target.name]: event.target.value
38+
});
39+
};
40+
41+
42+
// const handleSubmit = e => {
43+
// setSubmitting(1);
44+
// e.preventDefault();
45+
// axios({
46+
// method: 'post',
47+
// url:
48+
// 'https://us-central1-codeforcauseorg.cloudfunctions.net/widgets/leads',
49+
// data: formData
50+
// })
51+
// .then(response => {
52+
// setSubmitting(0);
53+
// })
54+
// .catch(error => {});
55+
// };
56+
57+
return (
58+
<div>
59+
<form noValidate autoComplete="off">
60+
<TextField
61+
key="name"
62+
className={classes.textField}
63+
label="Full Name"
64+
variant="outlined"
65+
value={formData.name}
66+
fullWidth
67+
name="name"
68+
onChange={handleChange}
69+
/>
70+
71+
<TextField
72+
key="email"
73+
className={classes.textField}
74+
label="Email"
75+
variant="outlined"
76+
value={formData.email}
77+
fullWidth
78+
name="email"
79+
onChange={handleChange}
80+
/>
81+
82+
<TextField
83+
key="contact"
84+
className={classes.textField}
85+
label="WhatsApp / Contact Number "
86+
variant="outlined"
87+
value={formData.phone}
88+
fullWidth
89+
name="phone"
90+
onChange={handleChange}
91+
/>
92+
93+
<TextField
94+
key="linkedIn"
95+
className={classes.textField}
96+
label="LinkedIn URL"
97+
variant="outlined"
98+
value={formData.linkedIn}
99+
fullWidth
100+
name="linkedIn"
101+
onChange={handleChange}
102+
/>
103+
104+
<TextField
105+
key="course"
106+
className={classes.textField}
107+
label="Course & Branch"
108+
variant="outlined"
109+
value={formData.course}
110+
fullWidth
111+
name="course"
112+
onChange={handleChange}
113+
/>
114+
115+
<TextField
116+
key="year"
117+
className={classes.textField}
118+
label="year"
119+
variant="outlined"
120+
value={formData.year}
121+
fullWidth
122+
name="year"
123+
onChange={handleChange}
124+
/>
125+
126+
<TextField
127+
key="college"
128+
className={classes.textField}
129+
label="College Name"
130+
variant="outlined"
131+
value={formData.college}
132+
fullWidth
133+
name="college"
134+
onChange={handleChange}
135+
/>
136+
</form>
137+
138+
</div>
139+
);
140+
}
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
import React from 'react';
2+
import { makeStyles } from '@material-ui/core/styles';
3+
import Stepper from '@material-ui/core/Stepper';
4+
import Step from '@material-ui/core/Step';
5+
import StepLabel from '@material-ui/core/StepLabel';
6+
import StepContent from '@material-ui/core/StepContent';
7+
import Button from '@material-ui/core/Button';
8+
import Paper from '@material-ui/core/Paper';
9+
import Typography from '@material-ui/core/Typography';
10+
11+
const useStyles = makeStyles((theme) => ({
12+
root: {
13+
width: '100%',
14+
},
15+
button: {
16+
marginTop: theme.spacing(1),
17+
marginRight: theme.spacing(1),
18+
},
19+
actionsContainer: {
20+
marginBottom: theme.spacing(2),
21+
},
22+
resetContainer: {
23+
padding: theme.spacing(3),
24+
},
25+
}));
26+
27+
function getSteps() {
28+
return ['Select campaign settings', 'Create an ad group', 'Create an ad'];
29+
}
30+
31+
function getStepContent(step) {
32+
switch (step) {
33+
case 0:
34+
return `For each ad campaign that you create, you can control how much
35+
you're willing to spend on clicks and conversions, which networks
36+
and geographical locations you want your ads to show on, and more.`;
37+
case 1:
38+
return 'An ad group contains one or more ads which target a shared set of keywords.';
39+
case 2:
40+
return `Try out different ad text to see what brings in the most customers,
41+
and learn how to enhance your ads using features like ad extensions.
42+
If you run into any problems with your ads, find out how to tell if
43+
they're running and how to resolve approval issues.`;
44+
default:
45+
return 'Unknown step';
46+
}
47+
}
48+
49+
export default function UserRegister() {
50+
const classes = useStyles();
51+
const [activeStep, setActiveStep] = React.useState(0);
52+
const steps = getSteps();
53+
54+
const handleNext = () => {
55+
setActiveStep((prevActiveStep) => prevActiveStep + 1);
56+
};
57+
58+
const handleBack = () => {
59+
setActiveStep((prevActiveStep) => prevActiveStep - 1);
60+
};
61+
62+
const handleReset = () => {
63+
setActiveStep(0);
64+
};
65+
66+
return (
67+
<div className={classes.root}>
68+
<Stepper activeStep={activeStep} orientation="vertical">
69+
{steps.map((label, index) => (
70+
<Step key={label}>
71+
<StepLabel>{label}</StepLabel>
72+
<StepContent>
73+
<Typography>{getStepContent(index)}</Typography>
74+
<div className={classes.actionsContainer}>
75+
<div>
76+
<Button
77+
disabled={activeStep === 0}
78+
onClick={handleBack}
79+
className={classes.button}
80+
>
81+
Back
82+
</Button>
83+
<Button
84+
variant="contained"
85+
color="primary"
86+
onClick={handleNext}
87+
className={classes.button}
88+
>
89+
{activeStep === steps.length - 1 ? 'Finish' : 'Next'}
90+
</Button>
91+
</div>
92+
</div>
93+
</StepContent>
94+
</Step>
95+
))}
96+
</Stepper>
97+
{activeStep === steps.length && (
98+
<Paper square elevation={0} className={classes.resetContainer}>
99+
<Typography>All steps completed - you&apos;re finished</Typography>
100+
<Button onClick={handleReset} className={classes.button}>
101+
Reset
102+
</Button>
103+
</Paper>
104+
)}
105+
</div>
106+
);
107+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import React from 'react';
2+
import { makeStyles } from '@material-ui/core';
3+
import Page from 'src/components/Page';
4+
import {UserEdit} from './UserEdit';
5+
6+
const useStyles = makeStyles(() => ({
7+
root: {}
8+
}));
9+
10+
function ProfileView() {
11+
const classes = useStyles();
12+
13+
return (
14+
<Page className={classes.root} title="Campus Leaders">
15+
<UserEdit />
16+
</Page>
17+
);
18+
}
19+
20+
export default ProfileView;

src/views/pages/Courses/partials/FAQuestions.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import {
33
Grid,
44
Typography,
5-
Hidden,
65
Box,
76
Collapse,
87
IconButton

src/views/pages/ProfileView/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React from 'react';
22
import { makeStyles } from '@material-ui/core';
33
import Page from 'src/components/Page';
4-
// import UserProfile from './UserProfile';
5-
// import UserRegister from './UserRegister';
64
import {UserEdit} from './UserEdit';
75

86
const useStyles = makeStyles(() => ({

0 commit comments

Comments
 (0)