moved edit profile in center window
This commit is contained in:
@@ -1,19 +1,11 @@
|
||||
import React, { useState } from "react";
|
||||
import ProfileModal from "./ProfileModal";
|
||||
import ProfileAvatar from "./ProfileAvatar";
|
||||
import ProfileInfo from "./ProfileInfo";
|
||||
|
||||
export default function Profile({ data = {} }) {
|
||||
const [showModal, setShowModal] = useState(false);
|
||||
|
||||
export default function Profile({ data = {}, onEdit }) {
|
||||
return (
|
||||
<>
|
||||
<div className="f-profile" onClick={() => setShowModal(true)}>
|
||||
<ProfileAvatar avatar={data.avatar} name={`${data.firstName || ""} ${data.lastName || ""}`} />
|
||||
<ProfileInfo firstName={data.firstName} email={data.email} />
|
||||
</div>
|
||||
|
||||
{showModal && <ProfileModal onClose={() => setShowModal(false)} initialData={data} />}
|
||||
</>
|
||||
<div className="f-profile" onClick={onEdit}>
|
||||
<ProfileAvatar avatar={data.avatar} name={`${data.firstName || ""} ${data.lastName || ""}`} />
|
||||
<ProfileInfo firstName={data.firstName} email={data.email} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user