From bcec6248dd82511aa2c860f24fba5e870768cf3b Mon Sep 17 00:00:00 2001 From: hsuifang Date: Wed, 14 Feb 2024 15:30:03 +0800 Subject: [PATCH 1/3] style(profile): add skelton in usercard --- components/Profile/UserCard/index.jsx | 2 +- components/Profile/index.jsx | 59 ++++++++++++++++--------- pages/partner/[id]/index.jsx | 63 --------------------------- pages/partner/detail/index.jsx | 29 +++++++----- 4 files changed, 58 insertions(+), 95 deletions(-) delete mode 100644 pages/partner/[id]/index.jsx diff --git a/components/Profile/UserCard/index.jsx b/components/Profile/UserCard/index.jsx index 39a936e6..6d8edd1f 100644 --- a/components/Profile/UserCard/index.jsx +++ b/components/Profile/UserCard/index.jsx @@ -29,7 +29,7 @@ const BottonEdit = { }; const StyledProfileWrapper = styled(Box)` - width: 720px; + width: 100%; padding: 30px; background-color: #fff; border-radius: 20px; diff --git a/components/Profile/index.jsx b/components/Profile/index.jsx index ec002fb8..56097770 100644 --- a/components/Profile/index.jsx +++ b/components/Profile/index.jsx @@ -1,6 +1,7 @@ -import { useMemo, useState } from 'react'; +import { useMemo } from 'react'; import { useRouter } from 'next/router'; import { Box, Button } from '@mui/material'; +import Skeleton from '@mui/material/Skeleton'; import ChevronLeftIcon from '@mui/icons-material/ChevronLeft'; import { WANT_TO_DO_WITH_PARTNER, @@ -46,9 +47,9 @@ const Profile = ({ handleContactPartner, contactList = {}, updatedDate, + isLoading, }) => { const router = useRouter(); - const [isLoading] = useState(false); const role = roleList.length > 0 && ROLELIST[roleList[0]]; const edu = educationStage && EDUCATION_STEP_TABLE[educationStage]; const wantTodo = wantToDoList @@ -87,6 +88,7 @@ const Profile = ({ 返回 + {isLoading ? ( + + ) : ( + typeof t === 'string' && t !== '')} + photoURL={photoURL} + userName={name} + location={location} + updatedDate={updatedDate} + contactList={contactList} + /> + )} + - + ) : ( + typeof t === 'string' && t !== '')} - photoURL={photoURL} - userName={name} - location={location} - updatedDate={updatedDate} - contactList={contactList} + description={selfIntroduction} + wantToDoList={wantTodo} + share={share} /> - - - + )} {email !== sendEmail && (