diff --git a/content/i18n/bg.json b/content/i18n/bg.json index 0af16c9..26788cf 100644 --- a/content/i18n/bg.json +++ b/content/i18n/bg.json @@ -23,7 +23,7 @@ "contactAll": "Участници", "feedback": "Отзиви", "contactUs": "За връзка", - "admin": "Администрация", + "admin": "Админ", "cart-places": "Места", "cart-publishers": "Вестители", "cart-events": "План", diff --git a/content/i18n/en.json b/content/i18n/en.json index 6b4c22f..19bce02 100644 --- a/content/i18n/en.json +++ b/content/i18n/en.json @@ -1,5 +1,7 @@ { "common": { + "appNameLong": "Специално свидетелстване на обществени места в София", + "contacts": "Контакти", "greeting": "Hello", "farewell": "Goodbye", "changeTo": "Change to", diff --git a/content/i18n/ru.json b/content/i18n/ru.json index bae0120..c68913e 100644 --- a/content/i18n/ru.json +++ b/content/i18n/ru.json @@ -1,13 +1,15 @@ { "common": { + "appNameLong": "Специално свидетелстване на обществени места в София", + "contacts": "Контакти", "greeting": "Здравей", "farewell": "Довиждане", "changeTo": "Смени на", - "BG": "[RU] Български", - "EN": "[RU] Английски", - "RU": "[RU] Руски", + "BG": "болгарский", + "EN": "английский", + "RU": "русский", "login": "вход", - "contacts": "Контакти" + "contacts": "Контакти te" }, "menu": { "dashboard": "Начало" diff --git a/pages/dash.tsx b/pages/dash.tsx index 53b3615..84fe059 100644 --- a/pages/dash.tsx +++ b/pages/dash.tsx @@ -1,11 +1,13 @@ import { useSession } from "next-auth/react" +import { useRouter } from 'next/router'; +import React, { useState, useEffect } from 'react'; import Layout from "../components/layout" + import AvCalendar from '../components/calendar/avcalendar'; import { getSession } from "next-auth/react"; import common from '../src/helpers/common'; import { Availability, UserRole } from "@prisma/client"; import ProtectedRoute, { serverSideAuth } from "../components/protectedRoute"; -import React, { useState, useEffect } from 'react'; import axiosInstance from '../src/axiosSecure'; // const dataHelper = require('../../src/helpers/data'); import dataHelper from '../src/helpers/data'; @@ -24,7 +26,10 @@ interface IProps { cartEvents: any; lastPublishedDate: Date; } -export default function IndexPage({ initialItems, initialUserId, cartEvents, lastPublishedDate }: IProps) { +export default function DashboardPage({ initialItems, initialUserId, cartEvents, lastPublishedDate }: IProps) { + + const router = useRouter(); + const { newLogin } = router.query; const { data: session } = useSession(); const [userName, setUserName] = useState(session?.user?.name); const [userId, setUserId] = useState(initialUserId); @@ -45,6 +50,17 @@ export default function IndexPage({ initialItems, initialUserId, cartEvents, las } }, [session]); + + //const [notificationsVisible, setNotificationsVisible] = useState(false); + + useEffect(() => { + if (newLogin === 'true') { + alert("Мили бртя, искаме само да ви напомним да ни изпратите вашите предпочитания за юни до 25-то число като използвате меню 'Възможности'. Ако имате проблем, моля пишете ни на 'specialnosvidetelstvanesofia@gmail.com'"); + const currentPath = router.pathname; + router.replace(currentPath, undefined, { shallow: true }); // Removes the query without affecting the history + } + }, [newLogin]); + const handleUserSelection = async (publisher) => { if (!publisher || publisher.id === undefined) return; console.log("selecting publisher", publisher.id); diff --git a/pages/index.tsx b/pages/index.tsx index f9ba6bc..f614892 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -17,12 +17,16 @@ export default function IndexPage() { useEffect(() => { // Redirect to /dash if user is logged in if (session) { - router.push('/dash'); + router.push('/dash?newLogin=true'); } }, [session, router]); if (status === "loading") { - return

Loading...

; // Or any other loading state + return ( +
+

Loading...

+
+ ); } if (session) {