From e335fbcb393695c43e22896761cf4b0b96a827bf Mon Sep 17 00:00:00 2001 From: Wenderson Pires Date: Tue, 30 Jul 2024 18:26:39 -0300 Subject: [PATCH] test Files component --- .../components/Profile/Profile.tsx | 35 +++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/src/pages/CreateProject/components/Profile/Profile.tsx b/src/pages/CreateProject/components/Profile/Profile.tsx index 106c7002..7b50a2ae 100644 --- a/src/pages/CreateProject/components/Profile/Profile.tsx +++ b/src/pages/CreateProject/components/Profile/Profile.tsx @@ -4,7 +4,7 @@ import Button from "@app/components/Button"; import Image from "@app/components/mob.near/Image"; import constants from "@app/constants"; import uploadFileUpdateState from "../../utils/uploadFileUpdateState"; -import { Container, BackgroundImage, ProfileImage } from "./styles"; +import { Container, BackgroundImage, ProfileImage, FileLabel } from "./styles"; const Profile = () => { const { IPFS_BASE_URL } = constants; @@ -14,14 +14,29 @@ const Profile = () => { const fallbackImg = "bafkreidsqk5rg6mdcdrfpedadeqejfwlfan75tjrybxu6cnlwzs4qizjdq"; const handleBgChange = (files: any) => { + console.log("Files:", files); + if (files) { uploadFileUpdateState(files[0], (res: any) => { const ipfs_cid = res.body.cid; + console.log("PIFS:", ipfs_cid); State.update({ backgroundImage: { ipfs_cid } }); }); } }; + // const handleBgChange = (files: any) => { + // console.log("Files:", files); + + // if (files) { + // // uploadFileUpdateState(files[0], (res: any) => { + // // const ipfs_cid = res.body.cid; + // // console.log("PIFS:", ipfs_cid); + // // State.update({ backgroundImage: { ipfs_cid } }); + // // }); + // } + // }; + const handleImgChange = (files: any) => { if (files) { uploadFileUpdateState(files[0], (res: any) => { @@ -43,7 +58,7 @@ const Profile = () => { accepts={["image/*"]} minFileSize={1} style={{ - zIndex: 1, + // zIndex: 1, top: 0, width: "100%", height: "100%", @@ -53,6 +68,22 @@ const Profile = () => { onChange={handleBgChange} /> + + Upload BG Test +