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