fix
This commit is contained in:
@@ -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="Создать контест"
|
||||
|
||||
Reference in New Issue
Block a user