diff --git a/features/collections/collection-edit/collection-rules-alert.component.tsx b/features/collections/collection-edit/collection-rules-alert.component.tsx new file mode 100644 index 00000000..b012933a --- /dev/null +++ b/features/collections/collection-edit/collection-rules-alert.component.tsx @@ -0,0 +1,53 @@ +'use client'; + +import * as React from 'react'; +import { useEffect } from 'react'; +import MaterialSymbolsInfoRounded from '~icons/material-symbols/info-rounded'; + +import MDViewer from '@/components/markdown/viewer/MD-viewer'; +import { Button } from '@/components/ui/button'; + +import { useModalContext } from '@/services/providers/modal-provider'; + +const CollectionRulesAlert = () => { + const [rules, setRules] = React.useState(''); + const { openModal } = useModalContext(); + + useEffect(() => { + fetch( + 'https://raw.githubusercontent.com/hikka-io/rules/main/COLLECTION_RULES.md', + ) + .then((res) => res.text()) + .then((res) => setRules(res)); + }, []); + + return ( +
+
+ + + Перш ніж створювати колекції, рекомендуємо ознайомитись з{' '} + {' '} + створення колекцій. + +
+
+ ); +}; + +export default CollectionRulesAlert; diff --git a/features/collections/collection-edit/collection-title.component.tsx b/features/collections/collection-edit/collection-title.component.tsx index 35720f58..a4e9f0b4 100644 --- a/features/collections/collection-edit/collection-title.component.tsx +++ b/features/collections/collection-edit/collection-title.component.tsx @@ -4,6 +4,7 @@ import { useParams } from 'next/navigation'; import PlateEditor from '@/components/markdown/plate-editor/plate-editor'; import Header from '@/components/ui/header'; +import RulesAlert from '@/features/collections/collection-edit/collection-rules-alert.component'; import { useCollectionContext } from '@/services/providers/collection-provider'; @@ -19,6 +20,7 @@ const CollectionTitle = () => { return (
+ {((reference && description !== undefined) || !reference) && (