Skip to content

Commit

Permalink
Merge pull request #93 from IIT-BHU-SPORTS-FEST/dev
Browse files Browse the repository at this point in the history
[UPDATED] registration closed
  • Loading branch information
vipul6042 authored Oct 12, 2024
2 parents d3cb644 + db9b46e commit d85a17c
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 10 deletions.
6 changes: 6 additions & 0 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "4.0.1",
"private": true,
"dependencies": {
"alertifyjs": "^1.14.0",
"axios": "^0.26.1",
"bootstrap": "^5.3.1",
"caniuse-lite": "^1.0.30001660",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import 'bootstrap/dist/css/bootstrap.min.css';
import axios from 'axios';
import { Link } from 'react-router-dom';
import { EventContext } from '../../../../../contexts/EventContext';
import { toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';

const Topbar = ({ toggleSidebar }) => {
const [open, setOpen] = useState(false);
Expand Down Expand Up @@ -89,7 +91,12 @@ const Topbar = ({ toggleSidebar }) => {
<div className="header-rightside">
<ul className="list-inline header-top pull-right">
<li className="hidden-xs">
<Link to="/dashboard/events" className="register-now">
<Link
// to="/dashboard/events"
onClick={()=>{toast.error('Registrations are closed', {
position: toast.POSITION.BOTTOM_RIGHT,
});}}
className="register-now">
Register Now
</Link>
</li>
Expand Down
17 changes: 14 additions & 3 deletions frontend/src/components/DashBoard/Registration/Events/Events.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
} from 'reactstrap';
import styles from './Events.module.css';
import { Link } from 'react-router-dom';
import { toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';

const EventsDb = () => {
const token = localStorage.getItem('token');
Expand Down Expand Up @@ -307,7 +309,10 @@ const EventsDb = () => {
<div className="events-heading">BOYS</div>
<div className="edit_button">
<Link
to="/dashboard/events"
// to="/dashboard/events"
onClick={()=>{toast.error('Registrations are closed', {
position: toast.POSITION.BOTTOM_RIGHT,
});}}
style={{ textDecoration: 'none', color: 'rgba(2, 0, 33, 1)' }}
>
Edit
Expand Down Expand Up @@ -607,7 +612,10 @@ const EventsDb = () => {
<div className="events-heading">Girls</div>
<div className="edit_button">
<Link
to="/dashboard/events"
// to="/dashboard/events"
onClick={()=>{toast.error('Registrations are closed', {
position: toast.POSITION.BOTTOM_RIGHT,
});}}
style={{ textDecoration: 'none', color: 'rgba(2, 0, 33, 1)' }}
>
Edit
Expand Down Expand Up @@ -905,7 +913,10 @@ const EventsDb = () => {
<div className="events-heading">Mixed</div>
<div className="edit_button">
<Link
to="/dashboard/events"
// to="/dashboard/events"
onClick={()=>{toast.error('Registrations are closed', {
position: toast.POSITION.BOTTOM_RIGHT,
});}}
style={{ textDecoration: 'none', color: 'rgba(2, 0, 33, 1)' }}
>
Edit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import './Registration.css';
import Events from './Events/Events';
import axios from 'axios';
import { Link } from 'react-router-dom';
import { toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';

const Registration = () => {
const [contdetails, setContDetails] = useState({
Expand Down Expand Up @@ -59,7 +61,10 @@ const Registration = () => {
<div className="events-heading">CONTINGENT DETAILS</div>
<div className="edit_button">
<Link
to="/dashboard/contingentEdit"
// to="/dashboard/contingentEdit"
onClick={()=>{toast.error('Registrations are closed', {
position: toast.POSITION.BOTTOM_RIGHT,
});}}
style={{ textDecoration: 'none', color: 'rgba(2, 0, 33, 1)' }}
>
Edit
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import React, { useState, useEffect } from 'react';
import './MiddleSection.css';
import { NavHashLink } from 'react-router-hash-link';
import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';

function Mid() {
const [daysLeft, setDaysLeft] = useState(0);


const showNotification = () => {
toast.error('Registrations closed!', {
position: toast.POSITION.TOP_CENTER,
});
};

useEffect(() => {
const timer = setInterval(() => {
const eventDate = new Date('2024-10-18');
Expand Down Expand Up @@ -32,14 +40,25 @@ function Mid() {
</div>

<div className="button-container">
<NavHashLink to="/register/signup#register">
<button className="btn2">REGISTER</button>
</NavHashLink>
<button onClick={showNotification} className="btn2">
REGISTER
</button>

<NavHashLink to="/matches">
<button className="btn1">MATCHES</button>
</NavHashLink>
</div>
</div>
<ToastContainer
style={{
zIndex: '10',
position: 'fixed',
top: '20%',
left: '70%',
transform: 'translate(-50%, -50%)',
width: 'fit-content',
}}
/>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ function Signup() {
const navigate = useNavigate();
const submitHandler = (e) => {
e.preventDefault();

// dispatchToast({
// color: 'danger',
// message: 'Registrations are Closed.',
// });
// return;
dispatchToast({
color: 'primary',
message: 'Please wait while your request is being processed.',
Expand Down

0 comments on commit d85a17c

Please sign in to comment.