Skip to content

Commit

Permalink
Pre-production commits 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
tamalCodes committed Jul 26, 2022
1 parent 04004c9 commit 4b7ee2a
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/loginBanner.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const LoginBanner = () => {
more with the hardworking clubs !!!
</p>
<br />
<p>Also fell free to Contact us, or report any problem !!</p>
<p>Also feel free to Contact us, or report any problem !!</p>
</div>
</div>
);
Expand Down
35 changes: 34 additions & 1 deletion src/pages/clubs/EventCreate.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ import "../../styles/EventCreate.css";
import Events from "../../assets/pictures/CreateEventsPic.svg";
import { CreateEvent } from '../../service/MilanApi';

import { toast, ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';


export default function EventCreate() {

Expand All @@ -16,7 +19,25 @@ export default function EventCreate() {

const handleClick = async (e) => {
e.preventDefault();
await CreateEvent(eventdetails);
const eventresponse = await CreateEvent(eventdetails);

if (eventresponse.status === 200) {
toast('🌈 Event added !', {
position: "top-right",
autoClose: 3000,
hideProgressBar: false,
closeOnClick: true,
pauseOnHover: true,
draggable: true,
progress: undefined,
onClose: () => {
seteventdetails({ eventname: "", eventdate: "", eventlocation: "", eventdescription: "" });
}
});
}


console.log(eventresponse);

}

Expand All @@ -25,6 +46,18 @@ export default function EventCreate() {
<>
<Navbar />

<ToastContainer
position="top-right"
autoClose={5000}
hideProgressBar={false}
newestOnTop={false}
closeOnClick
rtl={false}
pauseOnFocusLoss
draggable
pauseOnHover
/>

<section class="vh-100">
<div class="container py-5 h-100">
<div class="row d-flex align-items-center justify-content-center h-100">
Expand Down
1 change: 1 addition & 0 deletions src/service/MilanApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export const Contact = async (formData, toast) => {
export const CreateEvent = async (eventdata) => {
try {
const response = await Axios.post(Create_Event, eventdata);
return response;
} catch (error) {
toast.error(error, {
position: toast.POSITION.TOP_RIGHT,
Expand Down

1 comment on commit 4b7ee2a

@vercel
Copy link

@vercel vercel bot commented on 4b7ee2a Jul 26, 2022

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

milan – ./

milaan.vercel.app
milan-git-main-iamtamal.vercel.app
milan-iamtamal.vercel.app

Please sign in to comment.