Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Сгенерированные fumadocs-mdx файлы
**/.source/
3 changes: 3 additions & 0 deletions apps/xi.support/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# generated content
.source
11 changes: 11 additions & 0 deletions apps/xi.support/app/[[...slug]]/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { source } from '@/lib/source';
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
import { baseOptions } from '@/lib/layout.shared';

export default function Layout({ children }: LayoutProps<'/[[...slug]]'>) {
return (
<DocsLayout tree={source.getPageTree()} {...baseOptions()}>
{children}
</DocsLayout>
);
}
51 changes: 51 additions & 0 deletions apps/xi.support/app/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { getPageImage, source } from '@/lib/source';
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from 'fumadocs-ui/layouts/docs/page';
import { notFound } from 'next/navigation';
import { getMDXComponents } from '@/mdx-components';
import { createRelativeLink } from 'fumadocs-ui/mdx';
import type { Metadata } from 'next';

export default async function Page(props: PageProps<'/[[...slug]]'>) {
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();

const { body, description, updateDate, title, toc } = page.data;

const MDX = body;

return (
<DocsPage toc={toc} className="gap-0">
<p className="text-fd-muted-foreground text-sm">Обновлено {updateDate}</p>

<DocsTitle className="mt-4">{title}</DocsTitle>
<DocsDescription>{description}</DocsDescription>

<DocsBody className="mt-4">
<MDX
components={getMDXComponents({
a: createRelativeLink(source, page),
})}
/>
</DocsBody>
</DocsPage>
);
}

export async function generateStaticParams() {

Check warning on line 35 in apps/xi.support/app/[[...slug]]/page.tsx

View workflow job for this annotation

GitHub Actions / main / lint / lint-and-format

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
return source.generateParams();
}

export async function generateMetadata(props: PageProps<'/[[...slug]]'>): Promise<Metadata> {

Check warning on line 39 in apps/xi.support/app/[[...slug]]/page.tsx

View workflow job for this annotation

GitHub Actions / main / lint / lint-and-format

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
const params = await props.params;
const page = source.getPage(params.slug);
if (!page) notFound();

return {
title: page.data.title,
description: page.data.description,
openGraph: {
images: getPageImage(page).url,
},
};
}
103 changes: 0 additions & 103 deletions apps/xi.support/app/[section]/[mdx]/page.tsx

This file was deleted.

31 changes: 0 additions & 31 deletions apps/xi.support/app/[section]/page.tsx

This file was deleted.

11 changes: 8 additions & 3 deletions apps/xi.support/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { ReactNode } from 'react';

import { RootProvider } from 'fumadocs-ui/provider/next';
import '../index.css';
import { Inter } from 'next/font/google';
import { Metadata } from 'next';
import { i18nUIProvider } from '@/lib/i18n';

export const metadata: Metadata = {

Check warning on line 8 in apps/xi.support/app/layout.tsx

View workflow job for this annotation

GitHub Actions / main / lint / lint-and-format

Fast refresh only works when a file only exports components. Use a new file to share constants or functions between components
title: 'База знаний sovlium - документация и поддержка',
description:
'Документация платформы sovlium для репетиторов. Руководства по использованию функций, ответы на вопросы и полезные материалы.',
Expand Down Expand Up @@ -95,8 +96,12 @@

export default function RootLayout({ children }: { children: ReactNode }) {
return (
<html lang="ru" className={inter.variable}>
<body className="overflow-x-hidden">{children}</body>
<html lang="ru" className={inter.variable} suppressHydrationWarning>
<body className="flex flex-col min-h-screen">
<RootProvider i18n={i18nUIProvider('ru')} search={{ enabled: false }}>
{children}
</RootProvider>
</body>
</html>
);
}
10 changes: 4 additions & 6 deletions apps/xi.support/app/not-found.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable no-irregular-whitespace */
'use client';

import Header from 'components/Common/HeaderMain';
import Link from 'next/link';
import { Mail } from '@xipkg/icons';
import { useRouter } from 'next/navigation';
Expand All @@ -11,9 +10,8 @@ export default function NotFound() {

return (
<div className="h-screen overflow-auto bg-[url('/not-found/background.png')] bg-no-repeat bg-auto xl:bg-cover">
<Header />
<main className="w-screen container max-w-[1920px] mx-auto px-8 sm:px-16 2xl:px-[160px] py-32 flex flex-col items-start justify-center">
<h1 className="flex flex-col-reverse gap-x-1 sm:inline-block text-[40px] leading-[48px] sm:text-[48px] sm:leading-[62px] lg:text-[64px] font-medium text-gray-100 mb-4">
<h1 className="flex flex-col-reverse gap-x-1 sm:inline-block text-[40px] leading-[48px] sm:text-[48px] sm:leading-[62px] lg:text-h1-line-height font-medium text-gray-100 mb-4">
Страница затерялась в облаках{' '}
<span className="inline-block text-l leading-[100%] align-super lg:text-h5 font-bold text-gray-30">
404
Expand All @@ -27,7 +25,7 @@ export default function NotFound() {
Если ошибка повторяется — напишите нам об этом{' '}
<a className="text-brand-80" href="mailto:support@sovlium.ru">
<Mail className="inline-block fill-brand-80" />
<span className='inline-block relative ml-1 after:block after:content-[""] after:left-0 after:bottom-0 after:w-full after:h-[1px] after:bg-brand-20'>
<span className='inline-block relative ml-1 after:block after:content-[""] after:left-0 after:bottom-0 after:w-full after:h-px after:bg-brand-20'>
на электронную почту
</span>
</a>
Expand All @@ -37,14 +35,14 @@ export default function NotFound() {
Вернитесь{' '}
<button
type="button"
className='inline-block border-none outline-none bg-transparent relative text-brand-80 after:block after:content-[""] after:left-0 after:bottom-0 after:w-full after:h-[1px] after:bg-brand-20'
className='inline-block border-none outline-none bg-transparent relative text-brand-80 after:block after:content-[""] after:left-0 after:bottom-0 after:w-full after:h-px after:bg-brand-20'
onClick={router.back}
>
назад
</button>{' '}
или{' '}
<Link
className='inline-block relative text-brand-80 after:block after:content-[""] after:left-0 after:bottom-0 after:w-full after:h-[1px] after:bg-brand-20'
className='inline-block relative text-brand-80 after:block after:content-[""] after:left-0 after:bottom-0 after:w-full after:h-px after:bg-brand-20'
href="/"
>
на главную
Expand Down
15 changes: 0 additions & 15 deletions apps/xi.support/app/page.tsx

This file was deleted.

28 changes: 28 additions & 0 deletions apps/xi.support/components/CallToAction.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Button } from '@xipkg/button';
import { TelegramFilled } from '@xipkg/icons';
import NextLink from 'next/link';

export const CallToAction = () => (
<section className="flex flex-col justify-center items-center max-w-[1920px] gap-8">
<h3 className="font-medium text-2xl md:text-h6 text-gray-100 dark:text-gray-0 mt-0 mb-0">
Не нашлось ответа?
</h3>
<Button
className={`font-medium hover:bg-brand-80
text-m-base md:text-lg xl:text-2xl text-gray-0
rounded-md sm:rounded-xl xl:rounded-[18px]
p-6 md:p-8`}
asChild
>
<NextLink
href="https://t.me/sovlium_support_bot"
target="_blank"
rel="noopener noreferrer"
className="no-underline"
>
Написать в телеграм
<TelegramFilled className="fill-gray-0 size-4! sm:size-8! xl:size-12! ml-1.5 sm:ml-4 xl:ml-6!" />
</NextLink>
</Button>
</section>
);
24 changes: 24 additions & 0 deletions apps/xi.support/components/Card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Link } from '@xipkg/link';

interface CardProps {
title: string;
href: string;
description: string;
}

export const Card = ({ title, href, description }: CardProps) => {
return (
<Link
href={href}
className={`flex flex-col gap-2
no-underline p-4 h-full rounded-[18px]
border border-gray-10 dark:border-gray-80 shadow-xs
bg-gray-5 hover:bg-gray-10
dark:bg-gray-90 dark:hover:bg-gray-100
transition-all duration-300 ease-in-out`}
>
<p className="mt-0 mb-0 font-medium text-lg text-brand-80 dark:text-brand-60">{title}</p>
<p className="mt-0 mb-0 text-sm text-gray-80 dark:text-gray-20">{description}</p>
</Link>
);
};
33 changes: 0 additions & 33 deletions apps/xi.support/components/Common/HeaderDoc.tsx

This file was deleted.

Loading
Loading