This commit is contained in:
Виталий Лавшонок
2025-12-14 17:24:02 +03:00
parent 0c41cc59b9
commit 781945b358
8 changed files with 39 additions and 21 deletions

View File

@@ -14,12 +14,15 @@ import {
} from '../../../redux/slices/contests';
import ModalCreateContest from './ModalCreate';
import Filters from './Filter';
import { toastWarning } from '../../../lib/toastNotification';
const Contests = () => {
const dispatch = useAppDispatch();
const [modalActive, setModalActive] = useState<boolean>(false);
const jwt = useAppSelector((state) => state.auth.jwt);
const { contests, status } = useAppSelector(
(state) => state.contests.fetchContests,
);
@@ -49,6 +52,10 @@ const Contests = () => {
</div>
<SecondaryButton
onClick={() => {
if (!jwt){
toastWarning("Для создания контеста необходимо авторизоваться")
return;
}
setModalActive(true);
}}
text="Создать контест"