From 5298054dcdab287d3159f132b3d2e89ab3b00323 Mon Sep 17 00:00:00 2001 From: Djibril-Mugisho Date: Wed, 24 Aug 2022 01:46:45 +0300 Subject: [PATCH] preview user data on profile page --- .env.development | 2 +- components/EditProfilePage/index.tsx | 10 +++--- package-lock.json | 46 +++++++++++++++++++--------- 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/.env.development b/.env.development index 5ff2426..cb1f717 100644 --- a/.env.development +++ b/.env.development @@ -9,4 +9,4 @@ NEXT_PUBLIC_WEB3_NODE_RPC=https://matic-mumbai.chainstacklabs.com NEXT_PUBLIC_IPFS_AUTH=7100c075ab2d434bb74187580c4bb49b NEXT_PUBLIC_WEB3_STORAGE_TOKEN=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDM1MzdCN0VkNGI1NGEzZTVjMjRiODUyOTA0ODM4OWI5ZDkxNWZBRWMiLCJpc3MiOiJ3ZWIzLXN0b3JhZ2UiLCJpYXQiOjE2NjExNjA0MzkyODMsIm5hbWUiOiJvbmdhbWFfc3RvcmFnZV90b2tlbiJ9.pt1xVsrxcpDrght2zSHreMqQE_3XDsVYioZpGXjLsxM NEXT_PUBLIC_STORAGE_FEE_RECEIVER_ADRESS=0x34bA628174007b82f5CF3449b435bB871518cD75 -NEXT_PUBLIC_STORAGE_FEE=0.0001 \ No newline at end of file +NEXT_PUBLIC_STORAGE_FEE=0.0001 diff --git a/components/EditProfilePage/index.tsx b/components/EditProfilePage/index.tsx index 77f5ce6..2dc9bca 100644 --- a/components/EditProfilePage/index.tsx +++ b/components/EditProfilePage/index.tsx @@ -10,14 +10,15 @@ import { orderObject } from "@lib/Utils"; import UploadFileProcessing from "@components/modules/__modules__/Card/UploadFileProcessing"; import UploadFileErrorCard from "@components/modules/__modules__/Card/UploadFileErrorCard"; import { currentAccountState } from "@lib/atoms"; -import { useRecoilState } from "recoil"; +import { useRecoilState, useRecoilValue } from "recoil"; import { saveFileWithWeb3Storage } from "@lib/web3StorageClient"; -import { useRecoilValue } from "recoil"; const EditProfile = () => { const userAccount = useRecoilValue(currentAccountState); const [img, setImg] = useState(null); const [previewImgLink, setPreviewImgLink] = useState(userAccount?.avatarUrl); + console.log(userAccount, "user account"); + const [profile, setProfile] = useState({ walletAddress: "", username: "", @@ -165,8 +166,9 @@ const EditProfile = () => { onChange={(e) => setProfile({ ...profile, username: e.target.value }) } - // value={currentUserInformations[0]?.username} + defaultValue={userAccount?.username} /> +