他人页禁止修改
This commit is contained in:
@@ -41,6 +41,7 @@ import { useCities, useProfessions } from "@/store/pickerOptionsStore";
|
||||
|
||||
// 用户信息卡片组件属性
|
||||
interface UserInfoCardProps {
|
||||
editable: boolean,
|
||||
user_info: Partial<UserInfoType>;
|
||||
is_current_user: boolean;
|
||||
is_following?: boolean;
|
||||
@@ -59,6 +60,7 @@ const on_edit = () => {
|
||||
};
|
||||
// 用户信息卡片组件
|
||||
export const UserInfoCard: React.FC<UserInfoCardProps> = ({
|
||||
editable = true,
|
||||
user_info,
|
||||
is_current_user,
|
||||
is_following = false,
|
||||
@@ -399,7 +401,7 @@ export const UserInfoCard: React.FC<UserInfoCardProps> = ({
|
||||
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<UserInfoCardProps> = ({
|
||||
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<UserInfoCardProps> = ({
|
||||
<View
|
||||
className="tag_item"
|
||||
onClick={() => {
|
||||
handle_open_edit_modal("ntrp_level");
|
||||
editable && handle_open_edit_modal("ntrp_level");
|
||||
}}>
|
||||
<Text className="tag_text">{`NTRP ${user_info.ntrp_level}`}</Text>
|
||||
</View>
|
||||
@@ -445,7 +447,7 @@ export const UserInfoCard: React.FC<UserInfoCardProps> = ({
|
||||
<View
|
||||
className="tag_item"
|
||||
onClick={() => {
|
||||
handle_open_edit_modal("occupation");
|
||||
editable && handle_open_edit_modal("occupation");
|
||||
}}>
|
||||
<Text className="tag_text">
|
||||
{user_info.occupation.split(" ")[2]}
|
||||
@@ -464,7 +466,7 @@ export const UserInfoCard: React.FC<UserInfoCardProps> = ({
|
||||
{user_info.country || user_info.province || user_info.city ? (
|
||||
<View
|
||||
className="tag_item"
|
||||
onClick={() => handle_open_edit_modal("location")}>
|
||||
onClick={() => editable && handle_open_edit_modal("location")}>
|
||||
<Text className="tag_text">{`${user_info.province}${user_info.city}`}</Text>
|
||||
</View>
|
||||
) : is_current_user ? (
|
||||
|
||||
@@ -243,6 +243,7 @@ const OtherUserPage: React.FC = () => {
|
||||
{/* 用户信息区域 */}
|
||||
<View className="user_info_section">
|
||||
<UserInfoCard
|
||||
editable={false}
|
||||
user_info={user_info}
|
||||
is_current_user={false}
|
||||
is_following={is_following}
|
||||
|
||||
Reference in New Issue
Block a user