= ({
className,
)}
>
- {showHeader ||
- (fileName && (
-
- {renderIcon}
- {fileName ? fileName : language}
-
- {github?.path && (
-
-
-
- )}
-
-
-
- ))}
+
+ {StackButtonData[language]?.icon ||
}
+ {fileName ? fileName : language}
+
+ {github?.path && (
+
+
+
+ )}
+
+
+
{isExpanded || !isLong ? text : lines.slice(0, linesLength).join('\n')}
diff --git a/src/shared/ui/code-block/code.tsx b/src/shared/ui/code-block/code.tsx
new file mode 100644
index 0000000..40fc81f
--- /dev/null
+++ b/src/shared/ui/code-block/code.tsx
@@ -0,0 +1,48 @@
+'use client';
+
+import { useCopy } from '@/shared/hooks';
+import { Button, Tooltip } from '@nextui-org/react';
+import { FC } from 'react';
+import { StackVariants } from '../stack-buttons/model/data';
+
+interface CodeProps {
+ text: string;
+ language?: StackVariants;
+}
+
+export const Code: FC = ({ text, language = 'TypeScript' }) => {
+ const { handleCopy } = useCopy();
+ // const [mounted, setMounted] = useState(false);
+ // const { theme } = useTheme();
+
+ // useEffect(() => {
+ // setMounted(true);
+ // }, []);
+
+ return (
+
+
+
+ );
+};
diff --git a/src/shared/ui/code/code.tsx b/src/shared/ui/code/code.tsx
deleted file mode 100644
index c5fdb2f..0000000
--- a/src/shared/ui/code/code.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-'use client';
-
-import { useCopy } from '@/shared/hooks';
-import { ProgrammingLanguage } from '@/shared/types/programming-language';
-import { Theme } from '@/shared/types/theme';
-import { Button, Skeleton, Tooltip } from '@nextui-org/react';
-import { useTheme } from 'next-themes';
-import React, { FC, useEffect, useState } from 'react';
-import SyntaxHighlighter from 'react-syntax-highlighter';
-import {
- atomOneDark,
- atomOneLight,
-} from 'react-syntax-highlighter/dist/esm/styles/hljs';
-
-interface CodeProps {
- text: string;
- language?: ProgrammingLanguage;
-}
-
-export const Code: FC = ({ text, language = 'TypeScript' }) => {
- const [mounted, setMounted] = useState(false);
- const { theme } = useTheme();
- const { handleCopy } = useCopy();
-
- useEffect(() => {
- setMounted(true);
- }, []);
-
- if (!mounted) {
- return (
-
- );
- }
-
- return (
-
-
-
- );
-};
diff --git a/src/shared/ui/index.ts b/src/shared/ui/index.ts
index 8e85d74..b1f10c0 100644
--- a/src/shared/ui/index.ts
+++ b/src/shared/ui/index.ts
@@ -1,5 +1,5 @@
+import { Code } from './code-block/code';
import { CodeBlock } from './code-block/code-block';
-import { Code } from './code/code';
import { DownloadCvButton } from './download-cv-button/download-cv-button';
import { PageLoader } from './page-loader/page-loader';
import { SidebarNavigation } from './sidebar-navigation/sidebar-navigation';
diff --git a/src/shared/ui/sidebar-navigation/model/data.tsx b/src/shared/ui/sidebar-navigation/model/data.tsx
index 00f3900..e996203 100644
--- a/src/shared/ui/sidebar-navigation/model/data.tsx
+++ b/src/shared/ui/sidebar-navigation/model/data.tsx
@@ -93,29 +93,29 @@ export const SidebarItems: SidebarItemsProps[] = [
{
name: 'Next.js: Authentication (Server Components, Actions, Middleware)',
link: '/projects/app-router-auth',
- gitPath: '/app/projects/app-router-auth/page.tsx',
- },
- {
- name: 'Hook useMessage',
- link: '/projects/use-message',
- gitPath: '/src/shared/hooks/useMessage/useMessage.tsx',
+ gitPath: '/projects/app-router-auth/page.mdx',
},
// {
+ // name: 'Hook useMessage',
+ // link: '/projects/use-message',
+ // gitPath: '/src/shared/hooks/useMessage/useMessage.mdx',
+ // },
+ // {
// name: 'Infinity scroll + Virtualization',
// link: '/projects/infinity-scroll-virtualization',
// gitPath: '/app/projects/infinity-scroll-virtualization/page.tsx',
// },
],
},
- {
- title: 'UI Components',
- item: [
- {
- name: 'Card 180° Rotating',
- link: '/projects/card-rotating',
- },
- ],
- },
+ // {
+ // title: 'UI Components',
+ // item: [
+ // {
+ // name: 'Card 180° Rotating',
+ // link: '/projects/card-rotating',
+ // },
+ // ],
+ // },
// {
// title: '3D Graphics',
// item: [
diff --git a/src/shared/ui/stack-buttons/model/data.tsx b/src/shared/ui/stack-buttons/model/data.tsx
index cf44e2b..6891e86 100644
--- a/src/shared/ui/stack-buttons/model/data.tsx
+++ b/src/shared/ui/stack-buttons/model/data.tsx
@@ -1,5 +1,6 @@
import { BiLogoJavascript, BiLogoTypescript } from 'react-icons/bi';
import { MdOutlineCookie } from 'react-icons/md';
+import { PiMarkdownLogo } from 'react-icons/pi';
import { RiNextjsFill } from 'react-icons/ri';
import { SiPrisma } from 'react-icons/si';
import { TbServerBolt } from 'react-icons/tb';
@@ -11,6 +12,7 @@ export type StackVariants =
| 'Cookie'
| 'Next.js'
| 'SSR'
+ | 'Markdown'
| 'Prisma';
interface ButtonProps {
@@ -49,4 +51,7 @@ export const StackButtonData: Record = {
Prisma: {
icon: ,
},
+ Markdown: {
+ icon: ,
+ },
};
diff --git a/src/shared/ui/text/text.tsx b/src/shared/ui/text/text.tsx
index 07bf4c8..e88f85d 100644
--- a/src/shared/ui/text/text.tsx
+++ b/src/shared/ui/text/text.tsx
@@ -1,20 +1,19 @@
import { cn, toKebabCase, toLatin } from '@/shared/lib';
import Link from 'next/link';
-import { FC } from 'react';
+import { ComponentPropsWithoutRef } from 'react';
+import { FiLink } from 'react-icons/fi';
-interface TextProps {
- children: React.ReactNode;
- className?: string;
- variant?: 'h2' | 'h3';
-}
-
-export const Text: FC = ({ children, variant, className }) => {
- if (variant === 'h2') {
- if (typeof children !== 'string') {
- throw new Error('Text for "h2" must be a string');
- }
-
- const id = toKebabCase(toLatin(children));
+export const Text = {
+ p: ({ children, className }: ComponentPropsWithoutRef<'p'>) => {
+ return (
+
+ {children}
+
+ );
+ },
+ h2: ({ children }: ComponentPropsWithoutRef<'h2'>) => {
+ const text = String(children);
+ const id = toKebabCase(toLatin(text));
return (
<>
@@ -29,14 +28,7 @@ export const Text: FC = ({ children, variant, className }) => {
>
-
+
{children}
@@ -44,11 +36,18 @@ export const Text: FC = ({ children, variant, className }) => {
>
);
- }
-
- return (
-
- {children}
-
- );
+ },
+ hr: () =>
,
+ ul: ({ children, className }: ComponentPropsWithoutRef<'ul'>) => {
+ return (
+
+ );
+ },
};
diff --git a/src/widgets/footer/footer.tsx b/src/widgets/footer/footer.tsx
index c550df0..1b4140f 100644
--- a/src/widgets/footer/footer.tsx
+++ b/src/widgets/footer/footer.tsx
@@ -1,93 +1,16 @@
'use client';
-import { Button } from '@nextui-org/react';
import Link from 'next/link';
import { usePathname } from 'next/navigation';
-import { useEffect, useState } from 'react';
-import { SidebarItems } from '../../shared/ui/sidebar-navigation/model/data';
+import { Footer as MyFooter } from './navigation-button';
export const Footer = () => {
+ // const {path} = await getProjectData()
const pathname = usePathname();
- const [prevPage, setPrevPage] = useState('/');
- const [nextPage, setNextPage] = useState('/');
- const [gitPath, setGitPath] = useState();
-
- useEffect(() => {
- if (pathname) {
- determineNavigationLinks(pathname);
- }
- }, [pathname]);
-
- const determineNavigationLinks = (currentPath: string) => {
- const allPages = SidebarItems.flatMap((category) => category.item);
- const currentIndex = allPages.findIndex(
- (page) => page.link === currentPath,
- );
-
- if (currentIndex > 0) {
- setPrevPage(allPages[currentIndex - 1].link);
- setGitPath(allPages[currentIndex]?.gitPath);
- } else {
- setPrevPage('/');
- }
-
- if (currentIndex < allPages.length - 1) {
- setNextPage(allPages[currentIndex + 1].link);
- setGitPath(allPages[currentIndex]?.gitPath);
- } else {
- setNextPage('/');
- }
- };
return (
);
diff --git a/src/widgets/footer/navigation-button.tsx b/src/widgets/footer/navigation-button.tsx
new file mode 100644
index 0000000..cbeddb7
--- /dev/null
+++ b/src/widgets/footer/navigation-button.tsx
@@ -0,0 +1,90 @@
+'use client';
+
+import { Button } from '@nextui-org/react';
+import Link from 'next/link';
+import { usePathname } from 'next/navigation';
+import React, { useEffect, useState } from 'react';
+import { SidebarItems } from '../../shared/ui/sidebar-navigation/model/data';
+
+export const Footer = {
+ NavigationButton: () => {
+ const pathname = usePathname();
+ const [prevPage, setPrevPage] = useState('/');
+ const [nextPage, setNextPage] = useState('/');
+
+ useEffect(() => {
+ if (pathname) {
+ determineNavigationLinks(pathname);
+ }
+ }, [pathname]);
+
+ const determineNavigationLinks = (currentPath: string) => {
+ const allPages = SidebarItems.flatMap((category) => category.item);
+ const currentIndex = allPages.findIndex(
+ (page) => page.link === currentPath,
+ );
+
+ if (currentIndex > 0) {
+ setPrevPage(allPages[currentIndex - 1].link);
+ } else {
+ setPrevPage('/');
+ }
+
+ if (currentIndex < allPages.length - 1) {
+ setNextPage(allPages[currentIndex + 1].link);
+ } else {
+ setNextPage('/');
+ }
+ };
+
+ return (
+
+
+
+
+ );
+ },
+};
diff --git a/src/widgets/light/light.tsx b/src/widgets/light/light.tsx
index b5f8557..11425b0 100644
--- a/src/widgets/light/light.tsx
+++ b/src/widgets/light/light.tsx
@@ -28,7 +28,7 @@ export const Light = () => {