diff --git a/docs/screenshots/layout-desktop-community.png b/docs/screenshots/layout-desktop-community.png new file mode 100644 index 0000000..07dcf06 Binary files /dev/null and b/docs/screenshots/layout-desktop-community.png differ diff --git a/docs/screenshots/layout-md-community.png b/docs/screenshots/layout-md-community.png new file mode 100644 index 0000000..94467eb Binary files /dev/null and b/docs/screenshots/layout-md-community.png differ diff --git a/docs/screenshots/layout-mobile-community.png b/docs/screenshots/layout-mobile-community.png new file mode 100644 index 0000000..2589b97 Binary files /dev/null and b/docs/screenshots/layout-mobile-community.png differ diff --git a/src/app/blocking-qr/page.tsx b/src/app/blocking-qr/page.tsx index 306f3fd..787b588 100644 --- a/src/app/blocking-qr/page.tsx +++ b/src/app/blocking-qr/page.tsx @@ -179,9 +179,15 @@ export function BlockingQRProvider({children}: BlockingQRProviderProps) { // new network right away. You can do it, we encourage you to do that if // you want, but it's not a task for an average user. // - const [shouldBlock, setShouldBlock] = useState( - () => localStorage.getItem('blocking-qr-completed') !== 'true', - ); + const [shouldBlock, setShouldBlock] = useState(() => { + // TODO(demo): ?demo=1 в dev-режиме пропускает blocking-qr экран + const demo = + import.meta.env.DEV && + new URLSearchParams(window.location.search).has('demo'); + return ( + !demo && localStorage.getItem('blocking-qr-completed') !== 'true' + ); + }); const dismissBlockingQR = () => { localStorage.setItem('blocking-qr-completed', 'true'); diff --git a/src/app/community/page.tsx b/src/app/community/page.tsx index 17174ee..0b00848 100644 --- a/src/app/community/page.tsx +++ b/src/app/community/page.tsx @@ -391,7 +391,7 @@ function useListVirtualizer({items, parentRef}: ListVirtualizerProps) { return null; } return JSON.parse( - sessionStorage.getItem('activity.scroll') ?? 'null', + sessionStorage.getItem('community.scroll') ?? 'null', ) as ScrollState; }, [navigationType]); @@ -406,7 +406,7 @@ function useListVirtualizer({items, parentRef}: ListVirtualizerProps) { onChange: virtualizer => { if (virtualizer.isScrolling) return; sessionStorage.setItem( - 'activity.scroll', + 'community.scroll', JSON.stringify({ initialOffset: virtualizer.scrollOffset, initialMeasurementsCache: virtualizer.measurementsCache, diff --git a/src/app/menu.tsx b/src/app/menu.tsx index b01df8b..f644f86 100644 --- a/src/app/menu.tsx +++ b/src/app/menu.tsx @@ -42,56 +42,31 @@ const MENURAIL_ITEMS: MenuItem[] = [ }, ]; -const MENUBAR_ITEMS: MenuItem[] = [ - { - path: '/community', - title: 'community', - icon: , - }, - { - path: '/feed', - title: 'feed', - icon: , - }, - { - path: '/activity', - title: 'activity', - icon: , - }, - { - path: '/chat', - title: 'chat', - icon: , - releaseTag: 'Q4', - }, - { - path: '/profile', - title: 'profile', - icon: , - }, -]; - export function MenuRail() { const t = useTranslations('menu'); const {pathname} = useLocation(); return ( -
+
{MENURAIL_ITEMS.map(item => ( @@ -102,24 +77,46 @@ export function MenuRail() { } export function MenuBar() { + const t = useTranslations('menu'); const {pathname} = useLocation(); return ( -
- {MENUBAR_ITEMS.map(item => ( - - - - ))} + + + ); + })}
); } diff --git a/src/app/profile/page.tsx b/src/app/profile/page.tsx index d08a0f3..8a5a1d5 100644 --- a/src/app/profile/page.tsx +++ b/src/app/profile/page.tsx @@ -181,8 +181,8 @@ export function ProfilePage() { } return ( -
-
+
+
{content}
diff --git a/src/app/scaffold.tsx b/src/app/scaffold.tsx index 24774f6..ea1096c 100644 --- a/src/app/scaffold.tsx +++ b/src/app/scaffold.tsx @@ -40,12 +40,13 @@ export function Scaffold({children}: ScaffoldProps): ReactNode { return (
-
+
{showMenu && ( <>
)}
-
+
{children} diff --git a/src/components/session-provider.tsx b/src/components/session-provider.tsx index c5c7bd4..eaeec56 100644 --- a/src/components/session-provider.tsx +++ b/src/components/session-provider.tsx @@ -28,9 +28,14 @@ export function SessionProvider({children}: {children: React.ReactNode}) { const [status, setStatus] = useState('loading'); const refresh = useCallback(() => { - const ok = authService.get(app); + // TODO(demo): временно — ?demo=1 в dev-режиме показывает приложение + // с меню, даже без авторизации на бэкенде + const demo = + import.meta.env.DEV && + new URLSearchParams(window.location.search).has('demo'); + const ok = demo || authService.get(app); setStatus(ok ? 'authed' : 'guest'); - }, [backend]); + }, [app, backend]); const setAuthed = useCallback(() => setStatus('authed'), []);