diff --git a/apps/xi.front/.env b/apps/xi.front/.env index f79c348a..4b402195 100644 --- a/apps/xi.front/.env +++ b/apps/xi.front/.env @@ -1,3 +1,3 @@ NEXT_PUBLIC_SERVER_URL_BACKEND=https://api.xieffect.ru NEXT_PUBLIC_SERVER_URL_AUTH=https://auth.xieffect.ru -NEXT_PUBLIC_SERVER_URL_LIVE=https://live-test.xieffect.ru +NEXT_PUBLIC_SERVER_URL_LIVE=https://live-test.xieffect.ru \ No newline at end of file diff --git a/apps/xi.front/app/invite/[iid]/page.tsx b/apps/xi.front/app/(common)/invite/[iid]/invitePage.tsx similarity index 99% rename from apps/xi.front/app/invite/[iid]/page.tsx rename to apps/xi.front/app/(common)/invite/[iid]/invitePage.tsx index d9bd41f2..c2aa14db 100644 --- a/apps/xi.front/app/invite/[iid]/page.tsx +++ b/apps/xi.front/app/(common)/invite/[iid]/invitePage.tsx @@ -70,7 +70,7 @@ const InviteCard = ({ invite, iid }: InviteCardT) => { const onSubmit = () => { setIsLoading(true); - console.log('onSubmit', invite); + // console.log('onSubmit', invite); socket.emit( 'join-community', { diff --git a/apps/xi.front/app/(common)/invite/[iid]/page.tsx b/apps/xi.front/app/(common)/invite/[iid]/page.tsx new file mode 100644 index 00000000..d3d4b6df --- /dev/null +++ b/apps/xi.front/app/(common)/invite/[iid]/page.tsx @@ -0,0 +1,54 @@ +import React from 'react'; +import { Metadata } from 'next'; +// import { get } from 'pkg.utils'; +import InvitePage from './invitePage'; + +// type ResponseBodyT = { +// community: { +// id: number; +// name: string; +// description: string; +// }; +// is_authorized: boolean; +// has_already_joined: boolean; +// }; + +type PageParamsT = { + params: { + iid: string; + }; +}; + +export async function generateMetadata({ params }: PageParamsT): Promise { + // const { status, datas } = await get({ + // service: 'backend', + // path: `/api/public/community-service/invitations/by-code/${params.iid}/community/`, + // config: { + // headers: { + // 'Content-Type': 'application/json', + // }, + // }, + // }); + + // если использю get из pkg.utils то появляется ошибка: + // импорт компонентов без пометки 'use client' + const data = await fetch( + `${process.env.NEXT_PUBLIC_SERVER_URL_BACKEND}/api/public/community-service/invitations/by-code/${params.iid}/community/`, + ).then((res) => res.json()); + + return { + title: `Приглашение в сообщество ${data.community.name}`, + description: `Вы были приглашены в сообщество «${data.community.name}». + Перейдите по этой ссылке-приглашению, чтобы принять приглашение`, + openGraph: { + title: `Приглашение в сообщество ${data.community.name}`, + description: `Вы были приглашены в сообщество «${data.community.name}». + Перейдите по этой ссылке-приглашению, чтобы принять приглашение`, + images: [`https://api.xieffect.ru/files/communities/${data.community.id}/avatar.webp`], + }, + }; +} + +const Invite = ({ params }: PageParamsT) => ; + +export default Invite; diff --git a/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/chats/page.tsx b/apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/chats/page.tsx similarity index 93% rename from apps/xi.front/app/communities/[community-id]/channels/[channel-id]/chats/page.tsx rename to apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/chats/page.tsx index d5f8d638..181e4ee2 100644 --- a/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/chats/page.tsx +++ b/apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/chats/page.tsx @@ -1,5 +1,3 @@ -'use client'; - import React from 'react'; export default function Chats() { diff --git a/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/editor/page.tsx b/apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/editor/page.tsx similarity index 100% rename from apps/xi.front/app/communities/[community-id]/channels/[channel-id]/editor/page.tsx rename to apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/editor/page.tsx diff --git a/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/post/page.tsx b/apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/post/page.tsx similarity index 79% rename from apps/xi.front/app/communities/[community-id]/channels/[channel-id]/post/page.tsx rename to apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/post/page.tsx index fd029f68..ff0964bb 100644 --- a/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/post/page.tsx +++ b/apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/post/page.tsx @@ -3,13 +3,13 @@ import React from 'react'; import dynamic from 'next/dynamic'; -const Announce = dynamic(() => +const Post = dynamic(() => import('pkg.module.announces/components/AnnouncePost').then((mod) => mod.default), ); -export default function AnnouncePostPage() { +export default function PostPage() { return ( - import('pkg.module.announces').then((mod) => mod.Announces)); +const Posts = dynamic(() => import('pkg.module.announces').then((mod) => mod.Announces)); export default function AnnouncesPage() { - return ; + return ; } diff --git a/apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/tasks/page.tsx b/apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/tasks/page.tsx new file mode 100644 index 00000000..0719e561 --- /dev/null +++ b/apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/tasks/page.tsx @@ -0,0 +1,10 @@ +'use client'; + +import React from 'react'; +import dynamic from 'next/dynamic'; + +const Tasks = dynamic(() => import('pkg.module.tasks').then((mod) => mod.Tasks)); + +export default function TasksPage() { + return ; +} diff --git a/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/video/page.tsx b/apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/video/page.tsx similarity index 100% rename from apps/xi.front/app/communities/[community-id]/channels/[channel-id]/video/page.tsx rename to apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/video/page.tsx diff --git a/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/whiteboard/page.tsx b/apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/whiteboard/page.tsx similarity index 100% rename from apps/xi.front/app/communities/[community-id]/channels/[channel-id]/whiteboard/page.tsx rename to apps/xi.front/app/(protected)/communities/[community-id]/channels/[channel-id]/whiteboard/page.tsx diff --git a/apps/xi.front/app/communities/[community-id]/home/page.tsx b/apps/xi.front/app/(protected)/communities/[community-id]/home/page.tsx similarity index 89% rename from apps/xi.front/app/communities/[community-id]/home/page.tsx rename to apps/xi.front/app/(protected)/communities/[community-id]/home/page.tsx index 2174d3ae..dad732ff 100644 --- a/apps/xi.front/app/communities/[community-id]/home/page.tsx +++ b/apps/xi.front/app/(protected)/communities/[community-id]/home/page.tsx @@ -34,9 +34,9 @@ const Header = () => { return (
-
-

Добро пожаловать в сообщество

-
+
+

Добро пожаловать в сообщество

+
{!id ? (
) : ( @@ -45,7 +45,9 @@ const Header = () => { {!communityName ? (
) : ( -

{communityName}

+

+ {communityName} +

)}
@@ -136,9 +138,12 @@ const SupportBox = () => (
diff --git a/apps/xi.front/app/communities/[community-id]/layout.tsx b/apps/xi.front/app/(protected)/communities/[community-id]/layout.tsx similarity index 61% rename from apps/xi.front/app/communities/[community-id]/layout.tsx rename to apps/xi.front/app/(protected)/communities/[community-id]/layout.tsx index 637a7053..b309f37f 100644 --- a/apps/xi.front/app/communities/[community-id]/layout.tsx +++ b/apps/xi.front/app/(protected)/communities/[community-id]/layout.tsx @@ -1,14 +1,10 @@ 'use client'; -import { useMainSt } from 'pkg.stores'; - import dynamic from 'next/dynamic'; import { ReactNode } from 'react'; const Navigation = dynamic(() => import('pkg.navigation').then((mod) => mod.Navigation)); export default function CommunityLayout({ children }: { children: ReactNode }) { - const onSignOut = useMainSt((state) => state.onSignOut); - - return {children}; + return {children}; } diff --git a/apps/xi.front/app/communities/empty/page.tsx b/apps/xi.front/app/(protected)/communities/empty/page.tsx similarity index 100% rename from apps/xi.front/app/communities/empty/page.tsx rename to apps/xi.front/app/(protected)/communities/empty/page.tsx diff --git a/apps/xi.front/app/(protected)/communities/page.tsx b/apps/xi.front/app/(protected)/communities/page.tsx new file mode 100644 index 00000000..776529e1 --- /dev/null +++ b/apps/xi.front/app/(protected)/communities/page.tsx @@ -0,0 +1,175 @@ +'use client'; + +import { redirect, useRouter } from 'next/navigation'; +import { Logo } from 'pkg.logo'; +import { useMainSt } from 'pkg.stores'; +import { useEffect } from 'react'; +import { toast } from 'sonner'; + +export default function CommunitiesLoading() { + const isLogin = useMainSt((state) => state.isLogin); + const initSocket = useMainSt((state) => state.initSocket); + const socket = useMainSt((state) => state.socket); + const updateCommunityMeta = useMainSt((state) => state.updateCommunityMeta); + const communityMeta = useMainSt((state) => state.communityMeta); + const onboardingStage = useMainSt((state) => state.user.onboardingStage); + + const router = useRouter(); + + // Тоже костыль + useEffect(() => { + const toastTimerId = setTimeout(() => { + toast('Упс, проблемы с загрузкой'); + initSocket(); + }, 10000); + + const redirectTimerId = setTimeout(() => { + redirect('/communities'); + }, 11000); + + return () => { + clearTimeout(toastTimerId); + clearTimeout(redirectTimerId); + }; + }, []); + + // Если вдруг что-то пошло не так, ещё раз иницируем соединение сокета + // В initSocket есть предотвращение инициализации нескольких соединений + useEffect(() => { + console.log('initSocket'); + initSocket(); + }, []); + + useEffect(() => { + if (isLogin === false) { + redirect('/signin'); + } + }, [isLogin]); + + useEffect(() => { + console.log('onconnect', socket); + if (onboardingStage === 'completed') { + socket?.on('connect', () => { + socket.emit( + 'retrieve-any-community', + (stats: number, { community, participant }: { community: any; participant: any }) => { + if (stats === 200) { + updateCommunityMeta({ + id: community.id, + isOwner: participant.is_owner, + name: community.name, + description: community.description, + }); + } + + if (community.id) router.push(`/communities/${community.id}/home`); + }, + ); + }); + } + + if (socket?.connected === true && communityMeta.id === null) { + socket.emit( + 'retrieve-any-community', + (stats: number, { community, participant }: { community: any; participant: any }) => { + if (stats === 200) { + updateCommunityMeta({ + id: community.id, + isOwner: participant.is_owner, + name: community.name, + description: community.description, + }); + } + + if (community.id) router.push(`/communities/${community.id}/home`); + }, + ); + } + }, []); + + useEffect(() => { + if (isLogin && socket?.connected === true) { + socket.emit('retrieve-any-community', + (stats: number, { community, participant }: { community: any; participant: any }) => { + if (stats === 200) { + updateCommunityMeta({ + id: community.id, + isOwner: participant.is_owner, + name: community.name, + description: community.description, + }); + } + + if (community.id) router.push(`/communities/${community.id}/home`); + }, + ); + } + }, [isLogin, socket?.connected]); + + return ( +
+
+
+ +
+
+
+
+
+
+
    + {[...new Array(7)].map((item, index) => ( +
  • + ))} +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ); +} diff --git a/apps/xi.front/app/(protected)/layout.tsx b/apps/xi.front/app/(protected)/layout.tsx new file mode 100644 index 00000000..15fa4986 --- /dev/null +++ b/apps/xi.front/app/(protected)/layout.tsx @@ -0,0 +1,11 @@ +import { ReactNode } from 'react'; +import ProtectedProvider from './providers'; + +type ProtectedLayoutPropsT = { + children: ReactNode; +}; + +const ProtectedLayout = ({ children }: ProtectedLayoutPropsT) => ( + {children} +); +export default ProtectedLayout; diff --git a/apps/xi.front/app/(protected)/providers.tsx b/apps/xi.front/app/(protected)/providers.tsx new file mode 100644 index 00000000..42426e19 --- /dev/null +++ b/apps/xi.front/app/(protected)/providers.tsx @@ -0,0 +1,94 @@ +'use client'; + +import React, { ReactNode, useEffect } from 'react'; +import { redirect, usePathname, useRouter } from 'next/navigation'; +import { useMainSt } from 'pkg.stores'; +import Load from '../load'; + +type ProtectedProviderPropsT = { + children: ReactNode; +}; + +const ProtectedProvider = ({ children }: ProtectedProviderPropsT) => { + const socket = useMainSt((state) => state.socket); + const getUser = useMainSt((state) => state.getUser); + const updateCommunityMeta = useMainSt((state) => state.updateCommunityMeta); + const communityMeta = useMainSt((state) => state.communityMeta); + const onboardingStage = useMainSt((state) => state.user.onboardingStage); + + const isLogin = useMainSt((state) => state.isLogin); + + const pathname = usePathname(); + const router = useRouter(); + + useEffect(() => { + console.log('onconnect', socket); + if (onboardingStage === 'completed') { + socket?.on('connect', () => { + socket.emit( + 'retrieve-any-community', + (stats: number, { community, participant }: { community: any; participant: any }) => { + if (stats === 200) { + updateCommunityMeta({ + id: community.id, + isOwner: participant.is_owner, + name: community.name, + description: community.description, + }); + } + + if (community.id) router.push(`/communities/${community.id}/home`); + }, + ); + }); + } + + if (socket?.connected === true && communityMeta.id === null) { + socket.emit( + 'retrieve-any-community', + (stats: number, { community, participant }: { community: any; participant: any }) => { + if (stats === 200) { + updateCommunityMeta({ + id: community.id, + isOwner: participant.is_owner, + name: community.name, + description: community.description, + }); + } + + if (community.id) router.push(`/communities/${community.id}/home`); + }, + ); + } + }, [socket?.connected, onboardingStage]); + + useEffect(() => { + if (socket?.connected === false) { + socket?.connect(); + } + }, [socket?.connected]); + + useEffect(() => { + if (pathname !== '/communities' || (pathname === '/communities' && isLogin === null)) { + console.log('UUU', isLogin); + if (isLogin === false) { + redirect('/signin'); + } else { + getUser(); + } + } + }, [isLogin]); + + useEffect(() => { + console.log('onboardingStage', onboardingStage); + if (onboardingStage && onboardingStage !== null && onboardingStage !== 'completed' && !pathname.includes('/welcome/')) { + redirect('/welcome/user-info'); + } + }, [isLogin]); + + if (isLogin === null) return ; + + return children; +}; + +export default ProtectedProvider; diff --git a/apps/xi.front/app/welcome/community-create/page.tsx b/apps/xi.front/app/(protected)/welcome/community-create/page.tsx similarity index 99% rename from apps/xi.front/app/welcome/community-create/page.tsx rename to apps/xi.front/app/(protected)/welcome/community-create/page.tsx index d36a0647..db4286ae 100644 --- a/apps/xi.front/app/welcome/community-create/page.tsx +++ b/apps/xi.front/app/(protected)/welcome/community-create/page.tsx @@ -115,7 +115,8 @@ export default function WelcomeCommunityCreate() { const onSubmit = ({ community }: z.infer) => { setIsLoading(true); - socket.emit( + console.log('onSubmit', socket); + socket?.emit( 'create-community', { data: { diff --git a/apps/xi.front/app/welcome/community-invite/page.tsx b/apps/xi.front/app/(protected)/welcome/community-invite/page.tsx similarity index 99% rename from apps/xi.front/app/welcome/community-invite/page.tsx rename to apps/xi.front/app/(protected)/welcome/community-invite/page.tsx index f88bf476..339d7aa9 100644 --- a/apps/xi.front/app/welcome/community-invite/page.tsx +++ b/apps/xi.front/app/(protected)/welcome/community-invite/page.tsx @@ -83,7 +83,7 @@ export default function WelcomeCommunityInvite() { setIsLoading(true); const arrayFromInvite = invite.split('/'); - socket.emit( + socket?.emit( 'join-community', { code: arrayFromInvite[arrayFromInvite.length - 1], diff --git a/apps/xi.front/app/welcome/community/page.tsx b/apps/xi.front/app/(protected)/welcome/community/page.tsx similarity index 100% rename from apps/xi.front/app/welcome/community/page.tsx rename to apps/xi.front/app/(protected)/welcome/community/page.tsx diff --git a/apps/xi.front/app/welcome/final/page.tsx b/apps/xi.front/app/(protected)/welcome/final/page.tsx similarity index 100% rename from apps/xi.front/app/welcome/final/page.tsx rename to apps/xi.front/app/(protected)/welcome/final/page.tsx diff --git a/apps/xi.front/app/(protected)/welcome/layout.tsx b/apps/xi.front/app/(protected)/welcome/layout.tsx new file mode 100644 index 00000000..750b7b6f --- /dev/null +++ b/apps/xi.front/app/(protected)/welcome/layout.tsx @@ -0,0 +1,31 @@ +'use client'; + +import { redirect, usePathname } from 'next/navigation'; +import { useMainSt } from 'pkg.stores'; +import { useEffect } from 'react'; + +const welcomePagesPathsDict = { + created: '/welcome/user-info', + 'community-choice': '/welcome/community', + 'community-create': '/welcome/community-create', + 'community-invite': '/welcome/community-invite', + final: '/welcome/final', +}; + +const WelcomeLayout = ({ children }) => { + const onboardingStage = useMainSt((state) => state.user.onboardingStage); + const pathname = usePathname(); + + console.log('pathname', pathname, onboardingStage); + + useEffect(() => { + console.log('pathname', pathname, onboardingStage); + if (onboardingStage !== 'completed' && onboardingStage !== null && welcomePagesPathsDict[onboardingStage] !== pathname) { + redirect(welcomePagesPathsDict[onboardingStage]); + } + }, []); + + return children; +}; + +export default WelcomeLayout; diff --git a/apps/xi.front/app/welcome/user-info/page.tsx b/apps/xi.front/app/(protected)/welcome/user-info/page.tsx similarity index 98% rename from apps/xi.front/app/welcome/user-info/page.tsx rename to apps/xi.front/app/(protected)/welcome/user-info/page.tsx index da49c74d..25c1ea2e 100644 --- a/apps/xi.front/app/welcome/user-info/page.tsx +++ b/apps/xi.front/app/(protected)/welcome/user-info/page.tsx @@ -4,7 +4,8 @@ import { Button } from '@xipkg/button'; import React, { RefObject } from 'react'; import Image from 'next/image'; import { useRouter, useSearchParams } from 'next/navigation'; -import { put, useMedia } from 'pkg.utils'; +import { put } from 'pkg.utils'; +import { useMedia } from 'pkg.utils.client'; import { AvatarEditor } from 'pkg.avatar.editor'; import { Form, diff --git a/apps/xi.front/app/confirm-email/[id]/page.tsx b/apps/xi.front/app/(public)/confirm-email/[id]/page.tsx similarity index 96% rename from apps/xi.front/app/confirm-email/[id]/page.tsx rename to apps/xi.front/app/(public)/confirm-email/[id]/page.tsx index 5d08fddc..dd163f22 100644 --- a/apps/xi.front/app/confirm-email/[id]/page.tsx +++ b/apps/xi.front/app/(public)/confirm-email/[id]/page.tsx @@ -1,5 +1,3 @@ -'use client'; - import { SignIn } from 'pkg.form.signin'; import React from 'react'; diff --git a/apps/xi.front/app/(public)/layout.tsx b/apps/xi.front/app/(public)/layout.tsx new file mode 100644 index 00000000..54ca6368 --- /dev/null +++ b/apps/xi.front/app/(public)/layout.tsx @@ -0,0 +1,12 @@ +import { ReactNode } from 'react'; +import PublicProvider from './providers'; + +type PublicLayoutPropsT = { + children: ReactNode; +}; + +const PublicLayout = ({ children }: PublicLayoutPropsT) => ( + {children} +); + +export default PublicLayout; diff --git a/apps/xi.front/app/(public)/providers.tsx b/apps/xi.front/app/(public)/providers.tsx new file mode 100644 index 00000000..02cf613d --- /dev/null +++ b/apps/xi.front/app/(public)/providers.tsx @@ -0,0 +1,32 @@ +'use client'; + +import React, { ReactNode, useEffect } from 'react'; + +import { redirect } from 'next/navigation'; +import { useMainSt } from 'pkg.stores'; +import Load from '../load'; + +type PublicProviderPropsT = { + children: ReactNode; +}; + +const PublicProvider = ({ children }: PublicProviderPropsT) => { + const getUser = useMainSt((state) => state.getUser); + const isLogin = useMainSt((state) => state.isLogin); + + useEffect(() => { + getUser(); + }, []); + + useEffect(() => { + if (isLogin === true) { + redirect('/communities'); + } + }, [isLogin]); + + if (isLogin === null) return ; + + return children; +}; + +export default PublicProvider; diff --git a/apps/xi.front/app/reset-password/[id]/page.tsx b/apps/xi.front/app/(public)/reset-password/[id]/page.tsx similarity index 96% rename from apps/xi.front/app/reset-password/[id]/page.tsx rename to apps/xi.front/app/(public)/reset-password/[id]/page.tsx index 3e773a6c..41cfee99 100644 --- a/apps/xi.front/app/reset-password/[id]/page.tsx +++ b/apps/xi.front/app/(public)/reset-password/[id]/page.tsx @@ -1,5 +1,3 @@ -'use client'; - import { NewPassword } from 'pkg.form.new-password'; export default function ResetPasswordId() { diff --git a/apps/xi.front/app/reset-password/page.tsx b/apps/xi.front/app/(public)/reset-password/page.tsx similarity index 96% rename from apps/xi.front/app/reset-password/page.tsx rename to apps/xi.front/app/(public)/reset-password/page.tsx index 8bc86723..ebea34cf 100644 --- a/apps/xi.front/app/reset-password/page.tsx +++ b/apps/xi.front/app/(public)/reset-password/page.tsx @@ -1,5 +1,3 @@ -'use client'; - import { ResetPassword } from 'pkg.form.reset-password'; export default function ResetPasswordPage() { diff --git a/apps/xi.front/app/signin/page.tsx b/apps/xi.front/app/(public)/signin/page.tsx similarity index 89% rename from apps/xi.front/app/signin/page.tsx rename to apps/xi.front/app/(public)/signin/page.tsx index af86f5d4..606ba61a 100644 --- a/apps/xi.front/app/signin/page.tsx +++ b/apps/xi.front/app/(public)/signin/page.tsx @@ -1,7 +1,4 @@ -'use client'; - import { SignIn } from 'pkg.form.signin'; -import React from 'react'; export default function SignInPage() { return ( diff --git a/apps/xi.front/app/signup/page.tsx b/apps/xi.front/app/(public)/signup/page.tsx similarity index 58% rename from apps/xi.front/app/signup/page.tsx rename to apps/xi.front/app/(public)/signup/page.tsx index b52dcbd4..6f2741c0 100644 --- a/apps/xi.front/app/signup/page.tsx +++ b/apps/xi.front/app/(public)/signup/page.tsx @@ -1,17 +1,10 @@ -'use client'; - -import { useMainSt } from 'pkg.stores'; - import { SignUp } from 'pkg.form.signup'; -import React from 'react'; - -export default function SignUpPage() { - const onSignUp = useMainSt((state) => state.onSignUp); +export default function SignInPage() { return (
- +
); diff --git a/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/tasks/page.tsx b/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/tasks/page.tsx deleted file mode 100644 index a4c042a7..00000000 --- a/apps/xi.front/app/communities/[community-id]/channels/[channel-id]/tasks/page.tsx +++ /dev/null @@ -1,11 +0,0 @@ -'use client'; - -import React from 'react'; - -export default function Tasks() { - return ( -
- tasks -
- ); -} diff --git a/apps/xi.front/app/layout.tsx b/apps/xi.front/app/layout.tsx index 1a8915e9..b70e7c6e 100644 --- a/apps/xi.front/app/layout.tsx +++ b/apps/xi.front/app/layout.tsx @@ -2,9 +2,10 @@ import '@xipkg/tailwind/index.css'; import { Metadata } from 'next'; import { Inter } from 'next/font/google'; -import React, { ReactNode } from 'react'; +import React, { ReactNode, Suspense } from 'react'; import Script from 'next/script'; import { Providers } from './providers'; +import YandexMetrika from './metrika'; const inter = Inter({ weight: ['400', '500', '600', '700'], @@ -45,12 +46,34 @@ export default function RootLayout({ children }: { children: ReactNode }) { return ( - + + + +