Add first-visit tip and how-to guide for guests

- guests in the feed see a "New here?" tip with a waving hand: swipe up to
  dismiss on mobile (top), close button on desktop (bottom right); shown
  once, remembered in localStorage
- GuideModal: six short steps (feed and map, map pins, posting, chat with
  photos/video, phone reveal, marking as returned) plus safety tips;
  guests get a sign-in button
- "How it works" item in the mobile menu and the desktop sidebar
- ru/en texts, tests, README

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SlimusMinus
2026-10-29 22:25:15 +03:00
parent 025ba2d637
commit df91e7e129
12 changed files with 734 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ import { useTranslation } from 'react-i18next';
import { useAuthContext } from "../context/AuthContext";
import { useIsDesktop } from "../hooks/useIsDesktop";
import SupportModal from "./SupportModal";
import GuideModal from "./GuideModal";
import UploadAdModal from "./UploadAdModal";
import ProfileAvatar from "./profile/ProfileAvatar";
import NahodkaLogo from "./MainNahodkaLogo";
@@ -50,7 +51,9 @@ export default function Sidebar({
const { language, toggleLanguage } = useLanguageToggle();
const [supportOpen, setSupportOpen] = useState(false);
const [uploadAdOpen, setUploadAdOpen] = useState(false);
const [guideOpen, setGuideOpen] = useState(false);
const HelpIcon = NavIcons.help;
const BookIcon = NavIcons.book;
// Десктоп (>= 900px) — отдельная навигация с картой, CTA и свёрткой в рейку.
// Мобильный drawer ниже остаётся без изменений.
@@ -210,6 +213,16 @@ export default function Sidebar({
</button>
);
})}
<button
type="button"
className="f-sb-item"
onClick={() => {
setGuideOpen(true);
onClose();
}}
>
<BookIcon /> {t('nav.guide')}
</button>
<button type="button" className="f-sb-item" onClick={() => setSupportOpen(true)}>
<HelpIcon /> {t('nav.support')} </button>
<div className="f-sb-divider" />
@@ -246,6 +259,15 @@ export default function Sidebar({
</div>
{supportOpen && <SupportModal onClose={() => setSupportOpen(false)} />}
{uploadAdOpen && <UploadAdModal onClose={() => setUploadAdOpen(false)} />}
{guideOpen && (
<GuideModal
onClose={() => setGuideOpen(false)}
onLoginClick={isAuthenticated ? undefined : () => {
setGuideOpen(false);
onLoginClick();
}}
/>
)}
</>
);
}