diff --git a/components/Partner/PartnerList/index.jsx b/components/Partner/PartnerList/index.jsx index fc3a15d5..549b3d0a 100644 --- a/components/Partner/PartnerList/index.jsx +++ b/components/Partner/PartnerList/index.jsx @@ -27,7 +27,7 @@ function PartnerList() { {lists.map((item, idx) => ( router.push(`partner/${item._id}`)} + onClick={() => router.push(`partner/detail?id=${item._id}`)} item width="100%" md={6} diff --git a/components/Profile/UserCard/index.jsx b/components/Profile/UserCard/index.jsx index 0d23864b..290d8e56 100644 --- a/components/Profile/UserCard/index.jsx +++ b/components/Profile/UserCard/index.jsx @@ -184,7 +184,8 @@ function Avator({ photoURL }) { function UserCard({ isLoginUser, - tagList, + tagList = [], + role, educationStepLabel, photoURL, userName, @@ -215,9 +216,9 @@ function UserCard({

{userName || '-'}

- {educationStepLabel} + {educationStepLabel && {educationStepLabel}}
-

實驗教育學生

+

{role || '-'}

@@ -228,9 +229,8 @@ function UserCard({ - {tagList.map((tag) => ( - - ))} + {!!tagList.length && + tagList[0].split('、').map((tag) => )} diff --git a/components/Profile/UserTabs/UserTabs.styled.jsx b/components/Profile/UserTabs/UserTabs.styled.jsx index d45d4035..4ad3d598 100644 --- a/components/Profile/UserTabs/UserTabs.styled.jsx +++ b/components/Profile/UserTabs/UserTabs.styled.jsx @@ -35,6 +35,8 @@ export const StyledPanelText = styled(Box)` font-weight: 400; line-height: 140%; margin-left: 12px; + display: grid; + place-items: center; } @media (max-width: 767px) { flex-direction: column; diff --git a/components/Profile/UserTabs/index.jsx b/components/Profile/UserTabs/index.jsx index a2d204da..2bbd7d68 100644 --- a/components/Profile/UserTabs/index.jsx +++ b/components/Profile/UserTabs/index.jsx @@ -10,14 +10,8 @@ import { StyledPanelText, } from './UserTabs.styled'; -const UserTabs = ({ - description = '', - wantToLearnList = [], - isLoading = false, -}) => { +const UserTabs = ({ description = '', wantToDoList = [], share = '' }) => { const [value, setValue] = useState('1'); - // TODO - console.log(description, wantToLearnList, isLoading); return (

可分享

- 自學心得 + {share || '無'}

想一起

- 學習交流、組課、共學、交朋友 + {wantToDoList || '無'}

簡介

- - 休學一年,目前是高二自學生,一直在探索自己喜歡什麼, - 喜歡聽音樂,最近要開始準備英文考試中檢 - 有興趣想交流可以來私訊我~ - + {description || '無'}
diff --git a/components/Profile/index.jsx b/components/Profile/index.jsx index 119ce3ff..1ccb9a3e 100644 --- a/components/Profile/index.jsx +++ b/components/Profile/index.jsx @@ -2,8 +2,12 @@ import { useMemo, useState } from 'react'; import { useRouter } from 'next/router'; import { Box, Button } from '@mui/material'; import ChevronLeftIcon from '@mui/icons-material/ChevronLeft'; -// import { CATEGORIES } from '@/constants/member'; -// import { mapToTable } from '@/utils/helper'; +import { + WANT_TO_DO_WITH_PARTNER, + ROLE, + EDUCATION_STEP, +} from '@/constants/member'; +import { mapToTable } from '@/utils/helper'; import SEOConfig from '@/shared/components/SEO'; import UserCard from './UserCard'; import UserTabs from './UserTabs'; @@ -23,18 +27,31 @@ const BottonBack = { position: 'unset', }, }; +const WANT_TO_DO_WITH_PARTNER_TABLE = mapToTable(WANT_TO_DO_WITH_PARTNER); +const ROLELIST = mapToTable(ROLE); +const EDUCATION_STEP_TABLE = mapToTable(EDUCATION_STEP); const Profile = ({ name, photoURL, tagList = [], - educationStepLabel, + roleList = [], + educationStage, + selfIntroduction, + wantToDoList = [], location, + share, }) => { const router = useRouter(); const [isLoading] = useState(false); const [open, setOpen] = useState(false); + const role = roleList.length > 0 && ROLELIST[roleList[0]]; + const edu = educationStage && EDUCATION_STEP_TABLE[educationStage]; + const wantTodo = wantToDoList + .map((item) => WANT_TO_DO_WITH_PARTNER_TABLE[item]) + .join('、'); + const SEOData = useMemo( () => ({ title: `${name}的小島|島島阿學`, @@ -46,7 +63,7 @@ const Profile = ({ imgLink: 'https://www.daoedu.tw/preview.webp', link: `${process.env.HOSTNAME}${router?.asPath}`, }), - [router?.asPath], + [router?.asPath, name], ); return ( @@ -95,9 +112,11 @@ const Profile = ({ 返回 +
- +