@@ -200,7 +201,7 @@ const Register = () => {
/>
- {
setPoliticChecked(value);
}}
@@ -215,13 +216,13 @@ const Register = () => {
/>
Я принимаю{' '}
- {/*
+
политику конфиденциальности
- */}
+
политику конфиденциальности
-
+ */}
diff --git a/src/views/home/contests/Contests.tsx b/src/views/home/contests/Contests.tsx
index d6b4892..c259445 100644
--- a/src/views/home/contests/Contests.tsx
+++ b/src/views/home/contests/Contests.tsx
@@ -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(false);
+ const jwt = useAppSelector((state) => state.auth.jwt);
+
const { contests, status } = useAppSelector(
(state) => state.contests.fetchContests,
);
@@ -49,6 +52,10 @@ const Contests = () => {
{
+ if (!jwt){
+ toastWarning("Для создания контеста необходимо авторизоваться")
+ return;
+ }
setModalActive(true);
}}
text="Создать контест"
diff --git a/src/views/home/missions/Missions.tsx b/src/views/home/missions/Missions.tsx
index 1770cce..862afcb 100644
--- a/src/views/home/missions/Missions.tsx
+++ b/src/views/home/missions/Missions.tsx
@@ -10,6 +10,7 @@ import {
import { fetchMissions } from '../../../redux/slices/missions';
import ModalCreate from './ModalCreate';
import Filters from './Filter';
+import { toastWarning } from '../../../lib/toastNotification';
export interface Mission {
id: number;
@@ -29,6 +30,7 @@ const Missions = () => {
const missions = useAppSelector((state) => state.missions.missions);
+ const jwt = useAppSelector((state) => state.auth.jwt);
const nameFilter = useAppSelector(
(state) => state.store.missions.filterName,
);
@@ -60,6 +62,11 @@ const Missions = () => {