Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 1 addition & 33 deletions src/Components/Pages/Alumni.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Link } from "react-router-dom";
import { ALUMNI } from "../../util/constants";

// material ui component
import { makeStyles } from "@material-ui/core/styles";
import { useStyles } from "../Styles/Alumni.styles";
import Grid from "@material-ui/core/Grid";
import Container from "@material-ui/core/Container";
import Typography from "@material-ui/core/Typography";
Expand All @@ -17,38 +17,6 @@ import ChatBox from "../Layouts/ChatBox";
import "../style.css";
import { ThemeContext } from "../../util/themeContext";

const useStyles = makeStyles({
root: {
flexGrow: 1,
marginTop: "100px",
marginBottom: 20,
minHeight: "580px",
},
card: {
display: "flex",
flexDirection: "column",
alignItems: "center",
padding: "25px 0px",
boxShadow: " 0px 4px 8px rgba(0, 0, 0, 0.25) !important",
lineHeight: "20px",
},
link: {
textDecoration: "none",
color: "#000",
margin: "5px",
},
circle: {
width: 125,
margin: "20px",
borderRadius: 100,
margin: "50px #fff",
boxShadow: "0 3px 6px rgba(0,0,0,0.16), 0 3px 6px rgba(0,0,0,0.23)",
},
name: {
marginTop: "15px",
},
});

export default function Team() {
const classes = useStyles();
const { theme: currentTheme } = useContext(ThemeContext);
Expand Down
181 changes: 96 additions & 85 deletions src/Components/Pages/Contactus.js
Original file line number Diff line number Diff line change
@@ -1,51 +1,50 @@
import React, { useState, useContext } from 'react';
import React, { useState, useContext } from "react";

//material ui component
import Container from '@material-ui/core/Container';
import Container from "@material-ui/core/Container";
import {
Typography,
Hidden,
Grid,
Button,
CardContent
} from '@material-ui/core';
import Card from '@material-ui/core/Card';
import { FormGroup } from '@material-ui/core';
import Divider from '@material-ui/core/Divider';
import '../style.css';
import { TwitterTimelineEmbed } from 'react-twitter-embed';
import Alert from '../Layouts/Alerts';
import AlertContext from '../../context/alert/alertContext';
import AuthContext from '../../context/auth/authContext';
import { backendUrl } from '../../context/types';
import axios from 'axios';
import SendIcon from '@material-ui/icons/Send';
CardContent,
} from "@material-ui/core";
import Card from "@material-ui/core/Card";
import { FormGroup } from "@material-ui/core";
import Divider from "@material-ui/core/Divider";
import "../style.css";
import { TwitterTimelineEmbed } from "react-twitter-embed";
import Alert from "../Layouts/Alerts";
import AlertContext from "../../context/alert/alertContext";
import AuthContext from "../../context/auth/authContext";
import { backendUrl } from "../../context/types";
import axios from "axios";
import SendIcon from "@material-ui/icons/Send";

const sectionStyle = {
width: '100%',

backgroundRepeat: 'no-repeat',
marginTop: '100px',
backgroundPositionX: 'center',

width: "100%",

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what you have changed here

backgroundRepeat: "no-repeat",
marginTop: "100px",
backgroundPositionX: "center",
};
const style = {
form: {
padding: '20px',
padding: "20px",
text: {
appearance: 'none',
width: '100%',
appearance: "none",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these things should be in the separate CSS file of contacts components

width: "100%",

height: '35px',
height: "35px",

borderRadius: '5px',
outline: 'none',
border: 'none',
background: '#e8ebed',
color: '#576366',
fontSize: '14px'
}
}
borderRadius: "5px",
outline: "none",
border: "none",
background: "#e8ebed",
color: "#576366",
fontSize: "14px",
},
},
};

const Contactus = () => {
Expand All @@ -56,91 +55,100 @@ const Contactus = () => {
const { error, loading, clearErrors, showLoading } = authContext;

const [details, setDetails] = useState({
Firstname: '',
Lastname: '',
Email: '',
Mobile: '',
Reason: ''
Firstname: "",
Lastname: "",
Email: "",
Mobile: "",
Reason: "",
});

const { FirstName, LastName, Email, Mobile, Reason } = details;

const handleChange = e => {
const handleChange = (e) => {
setDetails({
...details,
[e.target.name]: e.target.value
[e.target.name]: e.target.value,
});
};

const submitContact = async e => {
console.log('called submit contact');
const submitContact = async (e) => {
console.log("called submit contact");
e.preventDefault();
showLoading({ data: true });
let contactData = {
name: FirstName + ' ' + LastName,
name: FirstName + " " + LastName,
email: Email,
contact: Mobile,
query: Reason
query: Reason,
};

try {
let res = await axios.post(backendUrl + '/api/contact', contactData);
if (res.data.msg == 'Query submitted successfully') {
setAlert(res.data.msg, 'success');
let res = await axios.post(
backendUrl + "/api/contact",
contactData
);
if (res.data.msg == "Query submitted successfully") {
setAlert(res.data.msg, "success");
setDetails({
FirstName: '',
LastName: '',
Email: '',
Mobile: '',
Reason: ''
FirstName: "",
LastName: "",
Email: "",
Mobile: "",
Reason: "",
});
} else {
setAlert(res.data.msg, 'danger');
setAlert(res.data.msg, "danger");
}
clearErrors();
} catch (err) {
console.log('Error:', err);
console.log("Error:", err);
setAlert(
'Error occured while submitting your query.Please try again or write to us at [email protected]',
'danger'
"Error occured while submitting your query.Please try again or write to us at [email protected]",
"danger"
);
clearErrors();
showLoading({ data: false });
}
};

return (
<Container maxWidth='lg'>
<Container maxWidth="lg">
<br />
<div style={sectionStyle}>
<Grid
container
direction='row'
justify='flex-start'
alignItems='flex-start'
direction="row"
justify="flex-start"
alignItems="flex-start"
spacing={6}
>
<Grid direction='row' xs={12} sm={12} md={6} style={{padding:"20px"}}>
<Grid
direction="row"
xs={12}
sm={12}
md={6}
style={{ padding: "20px" }}
>
<Card
className='card--shadow'
style={{ borderRadius: '10px', }}
className="card--shadow"
style={{ borderRadius: "10px" }}
>
<div style={{ backgroundColor: '#24292E' }}>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want double-quotes. Move this CSS in separate file

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't want double-quotes. Move this CSS in separate file

Calm down
You know you used material-ui framework
Not all styles can be moved to a different file

<div style={{ backgroundColor: "#24292E" }}>
<br />
<CardContent>
<Hidden smUp>
<Typography
variant='h4'
className='contact_section_heading'
variant="h4"
className="contact_section_heading"
>
Get in touch
</Typography>
</Hidden>

<Hidden mdDown>
<Typography
variant='h3'
className='contact_section_heading'
variant="h3"
className="contact_section_heading"
>
Get in touch
</Typography>
Expand All @@ -150,7 +158,7 @@ const Contactus = () => {
<Divider />
<br />
<div style={style.form}>
<form autoComplete='on'>
<form autoComplete="on">
<Grid container spacing={3}>
<Grid item xs={12}>
<Alert />
Expand All @@ -160,8 +168,8 @@ const Contactus = () => {
<label>First-Name</label>
<input
style={style.form.text}
type='text'
name='FirstName'
type="text"
name="FirstName"
value={FirstName}
onChange={handleChange}
/>
Expand All @@ -172,8 +180,8 @@ const Contactus = () => {
<label>Last-Name</label>
<input
style={style.form.text}
type='text'
name='LastName'
type="text"
name="LastName"
value={LastName}
onChange={handleChange}
/>
Expand All @@ -184,8 +192,8 @@ const Contactus = () => {
<label>Email</label>
<input
style={style.form.text}
type='email'
name='Email'
type="email"
name="Email"
value={Email}
onChange={handleChange}
/>
Expand All @@ -194,8 +202,8 @@ const Contactus = () => {
<label>Contact Number</label>
<input
style={style.form.text}
type='tel'
name='Mobile'
type="tel"
name="Mobile"
value={Mobile}
onChange={handleChange}
/>
Expand All @@ -204,16 +212,16 @@ const Contactus = () => {
<label>Query</label>
<input
style={style.form.text}
type='textarea'
name='Reason'
type="textarea"
name="Reason"
value={Reason}
onChange={handleChange}
/>
</FormGroup>
<br />
<Typography className='align_center'>
<Typography className="align_center">
<Button
variant='contained'
variant="contained"
color="primary"
onClick={submitContact}
disabled={loading}
Expand All @@ -227,12 +235,15 @@ const Contactus = () => {
</Card>
</Grid>
<Grid item xs={12} sm={6} md={6}>
<Card style={{ borderRadius: '10px', fontSize: '14px' }} className="card--shadow">
<Card
style={{ borderRadius: "10px", fontSize: "14px" }}
className="card--shadow"
>
Comment on lines -230 to +241
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nothing is changed in these lines

<TwitterTimelineEmbed
sourceType='profile'
screenName='technojam_gu'
sourceType="profile"
screenName="technojam_gu"
options={{ height: 475 }}
size='20px'
size="20px"
/>
</Card>
</Grid>
Expand Down
Loading