Skip to content

Commit

Permalink
Stable Built v.0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Abirpal202049 committed Apr 8, 2022
1 parent b48df99 commit 91ad802
Show file tree
Hide file tree
Showing 21 changed files with 85 additions and 85 deletions.
24 changes: 12 additions & 12 deletions src/Components/EventCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const EventCard = ({
name,
}) => {
const { eventImage, eventTitle, eventDetails, eventTime, _id } = cardData
// console.log("Card data :- ", cardData);
// // console.log("Card data :- ", cardData);
let navigate = useNavigate()

const [showConfirm, setShowConfirm] = useState(false)
Expand All @@ -36,7 +36,7 @@ export const EventCard = ({
} = cardEditData || {}

function onEdit(id) {
console.log(id)
// console.log(id)
setEditEventID(id)
setModalShow(true)
setAddEvent(false)
Expand All @@ -63,8 +63,8 @@ export const EventCard = ({
crossorigin: true,
headers: { Authorization: `Bearer ${authToken}` },
})
//console.log('MAIL SEND ........', parseddata)
//console.log('MAIL DATA: ', mailData)
//// console.log('MAIL SEND ........', parseddata)
//// console.log('MAIL DATA: ', mailData)
toast.success('Users Notified', {
theme: 'dark',
})
Expand All @@ -74,7 +74,7 @@ export const EventCard = ({
}

const signInFirst = () => {
//console.log('Log In to your account to Register in this event')
//// console.log('Log In to your account to Register in this event')
toast.error('Sign In To Register To The Event', {
theme: 'dark',
onClick: () => navigate('/signin'),
Expand All @@ -84,15 +84,15 @@ export const EventCard = ({
// This will register the user for the event
const registerToEvent = async (id) => {
try {
//console.log(`Events added to the user page ${id}`)
//// console.log(`Events added to the user page ${id}`)
const authToken = localStorage.getItem('token')
//console.log('AuthToken :- ', authToken)
//// console.log('AuthToken :- ', authToken)
let parseddata = await axios.post(`${Api}registerevent/${id}`, '', {
withCredentials: true,
crossorigin: true,
headers: { Authorization: `Bearer ${authToken}` },
})
//console.log('User data :- ', parseddata)
//// console.log('User data :- ', parseddata)
navigate('/dashboard')
toast.success('You have successfully registered', {
theme: 'dark',
Expand All @@ -105,15 +105,15 @@ export const EventCard = ({
}

const onDelete = async (id) => {
//console.log(`Deleting the event with id ${id}`)
//// console.log(`Deleting the event with id ${id}`)
const authToken = localStorage.getItem('token')
//console.log('AuthToken :- ', authToken)
//// console.log('AuthToken :- ', authToken)
let { data } = await axios.delete(`${Api}delete/${id}`, {
withCredentials: true,
crossorigin: true,
headers: { Authorization: `Bearer ${authToken}` },
})
//console.log('User data :- ', data)
//// console.log('User data :- ', data)
if (data.success) {
window.location.reload()
}
Expand Down Expand Up @@ -151,7 +151,7 @@ export const EventCard = ({
)}

<div className='event-btn-wrapper'>
{/* {console.log("Decd Array -> ", decisionArray)} */}
{/* {// console.log("Decd Array -> ", decisionArray)} */}
{tokenChecker ? (
userRole >= 3 ? (
<></>
Expand Down
18 changes: 9 additions & 9 deletions src/Components/EventModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,26 +37,26 @@ const EventModal = (props) => {
})
return
}
//console.log('New Event Added')
//// console.log('New Event Added')
const Data = {
eventTitle: editEventTitle,
eventTime: editEventTime,
eventImage: editEventImage,
eventDetails: editEventDetails,
}
//console.log('Event Data :- ', Data)
//// console.log('Event Data :- ', Data)

const authToken = localStorage.getItem('token')
const { data } = await axios.post(`${Api}add`, Data, {
withCredentials: true,
headers: { Authorization: `Bearer ${authToken}` },
})

//console.log('DATA :- ', data)
//// console.log('DATA :- ', data)
if (data.success) {
window.location.reload()
} else {
//console.log('error data:- ', data)
//// console.log('error data:- ', data)
toast.error(data.error, {
theme: 'dark',
})
Expand All @@ -70,14 +70,14 @@ const EventModal = (props) => {
})
return
}
//console.log('Editing Event')
//// console.log('Editing Event')
const Data = {
eventTitle: editEventTitle,
eventTime: editEventTime,
eventImage: editEventImage,
eventDetails: editEventDetails,
}
//console.log('Event Data :- ', Data)
//// console.log('Event Data :- ', Data)

const authToken = localStorage.getItem('token')
const { data } = await axios.put(`${Api}update/${editEventID}`, Data, {
Expand All @@ -88,12 +88,12 @@ const EventModal = (props) => {
if (data.success) {
window.location.reload()
} else {
//console.log('error data:- ', data)
//// console.log('error data:- ', data)
toast.error(data.error, {
theme: 'dark',
})
}
//console.log('Data :- ', data)
//// console.log('Data :- ', data)
}

useEffect(() => {
Expand All @@ -108,7 +108,7 @@ const EventModal = (props) => {
}
}, [modalShow])

//console.log('edit event id: ', editEventID)
//// console.log('edit event id: ', editEventID)

return (
<div className={modalContainerClass}>
Expand Down
2 changes: 1 addition & 1 deletion src/Components/EventsContainer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const EventsContainer = ({
// })
// setLoading(false)
// setEvents(parseddata.data.upcomingEvent)
// console.log(allEvents)
// // console.log(allEvents)
// }

// useEffect(() => {
Expand Down
6 changes: 3 additions & 3 deletions src/Components/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ const NavCompoA = () => {
};

const NavCompoB = ({ userImg, userNameText, userRole }) => {
//console.log(userNameText)
//// console.log(userNameText)
const navigate = useNavigate();

const signOut = () => {
console.log("Sign Out");
// console.log("Sign Out");
localStorage.clear();
navigate("/")
sessionStorage.clear();
Expand Down Expand Up @@ -73,7 +73,7 @@ const Navbar = ({ userImage, userNameText }) => {

const checkToken = async () => {
const token = localStorage.getItem("token");
//console.log(token)
//// console.log(token)
if (token) {
setTokenChecker(true);
// TODO: Set the Role of the user
Expand Down
6 changes: 3 additions & 3 deletions src/Pages/Components/EmailForme.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const EmailForme = () => {

const handleSubmit = async (e) => {
e.preventDefault();
console.log("Form Submitted Successfully");
// console.log("Form Submitted Successfully");
const { data } = await axios.post(
`${Api}tokenforreset`,
{
Expand All @@ -34,14 +34,14 @@ const EmailForme = () => {
});
setEmail("");
}
console.log("Data: ", data);
// console.log("Data: ", data);
};

// [email protected]

function handelChange(e) {
setEmail(e.target.value);
console.log(email);
// console.log(email);
}

return (
Expand Down
10 changes: 5 additions & 5 deletions src/Pages/Components/Otpforum.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const Otpforum = () => {

async function submit(e) {
e.preventDefault();
//console.log("Data Submitted");
//// console.log("Data Submitted");
const data = {
otp: registerdata.otp,
};
Expand All @@ -25,11 +25,11 @@ const Otpforum = () => {


if (dataposted.data.success) {
//console.log("User Created Successfully");
//// console.log("User Created Successfully");
navigate("/dashboard");
window.location.reload();
} else {
//console.log("User Not Created Successfully");
//// console.log("User Not Created Successfully");
setRegisterdata({
otp: "",
});
Expand All @@ -38,14 +38,14 @@ const Otpforum = () => {
});
navigate("/verify");
}
// console.log(dasbodedata);
// // console.log(dasbodedata);
}

function handelChange(e) {
const newdata = { ...registerdata };
newdata[e.target.id] = e.target.value;
setRegisterdata(newdata);
//console.log(newdata);
//// console.log(newdata);
}
useEffect(() => {
const e = localStorage.getItem('email')
Expand Down
18 changes: 9 additions & 9 deletions src/Pages/Components/Siginform.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const Siginform = () => {

async function submit(e) {
e.preventDefault()
//console.log('Data Submitted')
//// console.log('Data Submitted')
const data = {
uid: registerdata.uid,
password: registerdata.password,
Expand All @@ -25,7 +25,7 @@ const Siginform = () => {
})

if (dataposted.data.success) {
//console.log('Logged In Successfully')
//// console.log('Logged In Successfully')
localStorage.setItem('token', dataposted.data.token)
localStorage.setItem(
'name',
Expand All @@ -37,7 +37,7 @@ const Siginform = () => {
else navigate('/admin/overview')
window.location.reload()
} else {
//console.log('Access Denied')
//// console.log('Access Denied')
setRegisterdata({
uid: '',
password: '',
Expand All @@ -46,11 +46,11 @@ const Siginform = () => {
theme: 'dark',
})
}
//console.log(dataposted)
//// console.log(dataposted)
}
// async function submit(e) {
// e.preventDefault();
// //console.log("Data Submitted");
// //// console.log("Data Submitted");
// const data = {
// uid: registerdata.uid,
// password: registerdata.password,
Expand All @@ -61,7 +61,7 @@ const Siginform = () => {
// });

// if (dataposted.data.success) {
// //console.log("Logged In Successfully");
// //// console.log("Logged In Successfully");
// localStorage.setItem("token", dataposted.data.token);
// localStorage.setItem(
// "name",
Expand All @@ -71,13 +71,13 @@ const Siginform = () => {
// navigate("/dashboard");
// window.location.reload();
// } else {
// //console.log("Access Denied");
// //// console.log("Access Denied");
// setRegisterdata({
// uid: "",
// password: "",
// });
// }
// //console.log(dataposted);
// //// console.log(dataposted);
// }

async function tokenCheker() {
Expand All @@ -91,7 +91,7 @@ const Siginform = () => {
const newdata = { ...registerdata }
newdata[e.target.id] = e.target.value
setRegisterdata(newdata)
//console.log(newdata)
//// console.log(newdata)
}

const [viewPassword, setViewPassword] = useState(false)
Expand Down
14 changes: 7 additions & 7 deletions src/Pages/Components/Signupform.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ const Signupform = () => {
linkedin: "",
github: "",
});
//console.log("API is :- ", Api);
//// console.log("API is :- ", Api);
let navigate = useNavigate();

async function submit(e) {
e.preventDefault();
//console.log("Data Submitted");
//// console.log("Data Submitted");
const dataposted = await Axios.post(`${Api}register`, {
firstName: registerdata.firstName,
lastName: registerdata.lastName,
Expand All @@ -38,9 +38,9 @@ const Signupform = () => {
github: registerdata.github,
});

//console.log(dataposted);
//// console.log(dataposted);
if (dataposted.data.success) {
//console.log("User Created Successfully");
//// console.log("User Created Successfully");
localStorage.setItem("token", dataposted.data.token); // setting token to localstorage
localStorage.setItem(
"name",
Expand All @@ -51,13 +51,13 @@ const Signupform = () => {
// Cookies.set('token', dataposted.data.token); // setting token to cookies
navigate("/verify");
} else {
//console.log("User Not Created Successfully");
//console.log("Error data - ", dataposted.data);
//// console.log("User Not Created Successfully");
//// console.log("Error data - ", dataposted.data);
toast.error(dataposted.data.error, {
theme: "dark",
});
}
//console.log(dataposted);
//// console.log(dataposted);
}

function handelChange(e) {
Expand Down
4 changes: 2 additions & 2 deletions src/Pages/Components/Slider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ const Slider = () => {

const nextSlide = () => {
setCurrentSlide(currentSlide === slideLength - 1 ? 0 : currentSlide + 1);
//console.log("next");
//// console.log("next");

};

const prevSlide = () => {
setCurrentSlide(currentSlide === 0 ? slideLength - 1 : currentSlide - 1);
//console.log("prev");
//// console.log("prev");

};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default Admin
// withCredentials: true,
// headers: { Authorization: `Bearer ${authToken}` },
// })
// //console.log('data: ', data)
// //// console.log('data: ', data)
// setLogData(await data.data.logs)
// setLoading(false)
// }
Expand Down
Loading

0 comments on commit 91ad802

Please sign in to comment.