diff --git a/src/components/UserInfo/index.tsx b/src/components/UserInfo/index.tsx index 869e102..5a94a09 100644 --- a/src/components/UserInfo/index.tsx +++ b/src/components/UserInfo/index.tsx @@ -41,6 +41,7 @@ import { useCities, useProfessions } from "@/store/pickerOptionsStore"; // 用户信息卡片组件属性 interface UserInfoCardProps { + editable: boolean, user_info: Partial; is_current_user: boolean; is_following?: boolean; @@ -59,6 +60,7 @@ const on_edit = () => { }; // 用户信息卡片组件 export const UserInfoCard: React.FC = ({ + editable = true, user_info, is_current_user, is_following = false, @@ -399,7 +401,7 @@ export const UserInfoCard: React.FC = ({ className="tag_icon" src={require("../../static/userInfo/male.svg")} onClick={() => { - handle_open_edit_modal("gender"); + editable && handle_open_edit_modal("gender"); }} /> )} @@ -408,7 +410,7 @@ export const UserInfoCard: React.FC = ({ className="tag_icon" src={require("../../static/userInfo/female.svg")} onClick={() => { - handle_open_edit_modal("gender"); + editable && handle_open_edit_modal("gender"); }} /> )} @@ -427,7 +429,7 @@ export const UserInfoCard: React.FC = ({ { - handle_open_edit_modal("ntrp_level"); + editable && handle_open_edit_modal("ntrp_level"); }}> {`NTRP ${user_info.ntrp_level}`} @@ -445,7 +447,7 @@ export const UserInfoCard: React.FC = ({ { - handle_open_edit_modal("occupation"); + editable && handle_open_edit_modal("occupation"); }}> {user_info.occupation.split(" ")[2]} @@ -464,7 +466,7 @@ export const UserInfoCard: React.FC = ({ {user_info.country || user_info.province || user_info.city ? ( handle_open_edit_modal("location")}> + onClick={() => editable && handle_open_edit_modal("location")}> {`${user_info.province}${user_info.city}`} ) : is_current_user ? ( diff --git a/src/user_pages/other/index.tsx b/src/user_pages/other/index.tsx index 1e92c07..2305625 100644 --- a/src/user_pages/other/index.tsx +++ b/src/user_pages/other/index.tsx @@ -243,6 +243,7 @@ const OtherUserPage: React.FC = () => { {/* 用户信息区域 */}