toolbar added

This commit is contained in:
Artur AGH
2023-10-03 15:57:10 +02:00
parent 55cd3f963d
commit 13e4e0a1a7
9 changed files with 181 additions and 87 deletions

View File

@@ -1,21 +1,30 @@
import { addImage, addText } from "@/store/app.slice";
import { Button } from "../ui/button";
import { Input } from "../ui/input";
import { useAppDispatch } from "@/hooks";
import { ChangeEvent, useState } from "react";
type Props = {
handleImageUploaded: any;
handleInputChange: any;
inputText: any;
handleTextAdd: any;
};
export function Sidebar({
handleImageUploaded,
handleInputChange,
handleTextAdd,
inputText,
}: Props) {
export function Sidebar() {
const dispatch = useAppDispatch();
const [inputText, setInputText] = useState("");
const handleImageUploaded = (e: ChangeEvent<HTMLInputElement>) => {
dispatch(addImage(e));
};
const handleInputChange = (e: ChangeEvent<HTMLInputElement>) => {
setInputText(e.target.value);
};
console.log(inputText);
const handleTextAdd = () => dispatch(addText({initialValue: inputText}));
return (
<div className="flex flex-col ">
<div className="h-full flex flex-col ">
<Input
type="file"
className="m-[2rem] w-auto "