article form creator

This commit is contained in:
Виталий Лавшонок
2025-11-04 14:21:14 +03:00
parent 04dbc5eeb1
commit 2e3a8779fc
17 changed files with 266 additions and 107 deletions

View File

@@ -3,6 +3,7 @@ import { SecondaryButton } from "../../../components/button/SecondaryButton";
import { useAppDispatch } from "../../../redux/hooks";
import ArticleItem from "./ArticleItem";
import { setMenuActivePage } from "../../../redux/slices/store";
import { useNavigate } from "react-router-dom";
export interface Article {
@@ -15,6 +16,7 @@ export interface Article {
const Articles = () => {
const dispatch = useAppDispatch();
const navigate = useNavigate();
const articles: Article[] = [
{
@@ -142,7 +144,7 @@ const Articles = () => {
Статьи
</div>
<SecondaryButton
onClick={() => { }}
onClick={() => {navigate("/article/create")}}
text="Создать статью"
className="absolute right-0"
/>

View File

@@ -26,6 +26,7 @@ const Login = () => {
// После успешного логина
useEffect(() => {
dispatch(setMenuActivePage("account"))
console.log(submitClicked);
}, []);
useEffect(() => {

View File

@@ -35,6 +35,7 @@ const Register = () => {
if (jwt) {
navigate("/home");
}
console.log(submitClicked);
}, [jwt]);
const handleRegister = () => {

View File

@@ -1,6 +1,5 @@
import { cn } from "../../../lib/cn";
import { Account } from "../../../assets/icons/auth";
import { registerUser } from "../../../redux/slices/auth";
import { PrimaryButton } from "../../../components/button/PrimaryButton";
import { ReverseButton } from "../../../components/button/ReverseButton";

View File

@@ -4,7 +4,7 @@ import { PrimaryButton } from "../../../components/button/PrimaryButton";
import { SecondaryButton } from "../../../components/button/SecondaryButton";
import { Input } from "../../../components/input/Input";
import { useAppDispatch, useAppSelector } from "../../../redux/hooks";
import { createGroup, deleteGroup, updateGroup } from "../../../redux/slices/groups";
import { deleteGroup, updateGroup } from "../../../redux/slices/groups";
interface ModalUpdateProps {
active: boolean;