diff --git a/components/Partner/PartnerList/PartnerCard/index.jsx b/components/Partner/PartnerList/PartnerCard/index.jsx index ddbe478f..a028a2a9 100644 --- a/components/Partner/PartnerList/PartnerCard/index.jsx +++ b/components/Partner/PartnerList/PartnerCard/index.jsx @@ -2,7 +2,7 @@ import { Box } from '@mui/material'; import { WANT_TO_DO_WITH_PARTNER, ROLE, - EDUCATION_STEP, + EDUCATION_STAGE, } from '@/constants/member'; import moment from 'moment'; import { mapToTable } from '@/utils/helper'; @@ -25,7 +25,7 @@ import { 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 EDUCATION_STAGE_TABLE = mapToTable(EDUCATION_STAGE); function PartnerCard({ image, @@ -43,7 +43,7 @@ function PartnerCard({ .join('、'); const role = roleList.length > 0 && ROLELIST[roleList[0]]; - const edu = educationStage && EDUCATION_STEP_TABLE[educationStage]; + const edu = educationStage && EDUCATION_STAGE_TABLE[educationStage]; const locations = location && location.split('@'); return ( @@ -72,7 +72,10 @@ function PartnerCard({ {location ? location.length >= 2 - ? locations.join('').replace('台灣', '') + ? locations + .join('') + .replace('台灣', '') + .replace('null', '') : locations.join('') : '-'} diff --git a/components/Partner/SearchField/SelectedAreas.jsx b/components/Partner/SearchField/SelectedAreas.jsx index d39a5086..47ea9062 100644 --- a/components/Partner/SearchField/SelectedAreas.jsx +++ b/components/Partner/SearchField/SelectedAreas.jsx @@ -1,5 +1,5 @@ import Select from '@/shared/components/Select'; -import { AREAS } from '@/constants/areas'; +import { TAIWAN_DISTRICT } from '@/constants/areas'; import useSearchParamsManager from '@/hooks/useSearchParamsManager'; export default function SelectedAreas() { @@ -10,6 +10,11 @@ export default function SelectedAreas() { pushState(QUERY_KEY, value.toString()); }; + const AREAS = TAIWAN_DISTRICT.map(({ name }) => ({ + name, + label: name, + })).concat([{ name: '國外', label: '國外' }]); + return ( diff --git a/components/Profile/InputTags/index.jsx b/components/Profile/InputTags/index.jsx index c90bdf36..cb2b247b 100644 --- a/components/Profile/InputTags/index.jsx +++ b/components/Profile/InputTags/index.jsx @@ -38,7 +38,7 @@ const Tag = ({ label, onCancel }) => { const StyledTagsField = styled(TextField)` input { - padding-left: 0; + padding-left: ${({ hasData }) => (hasData ? '0' : '16px')}; } `; @@ -53,6 +53,7 @@ function InputTags({ value = [], change }) { }; return ( 0} fullWidth="true" placeholder="搜尋或新增標籤" onKeyDown={keyDownHandle} diff --git a/components/Profile/UserCard/index.jsx b/components/Profile/UserCard/index.jsx index 6d8edd1f..358ff6ce 100644 --- a/components/Profile/UserCard/index.jsx +++ b/components/Profile/UserCard/index.jsx @@ -194,6 +194,7 @@ function UserCard({ updatedDate, }) { const router = useRouter(); + const locations = location && location.split('@'); return ( @@ -226,9 +227,9 @@ function UserCard({ {' '} {location - ? location.split('@').length >= 2 - ? location.split('@').join('').replace('台灣', '') - : location.split('@').join('') + ? location.length >= 2 + ? locations.join('').replace('台灣', '').replace('null', '') + : locations.join('') : '-'} diff --git a/components/Profile/index.jsx b/components/Profile/index.jsx index 56097770..1196cab0 100644 --- a/components/Profile/index.jsx +++ b/components/Profile/index.jsx @@ -6,7 +6,7 @@ import ChevronLeftIcon from '@mui/icons-material/ChevronLeft'; import { WANT_TO_DO_WITH_PARTNER, ROLE, - EDUCATION_STEP, + EDUCATION_STAGE, } from '@/constants/member'; import { mapToTable } from '@/utils/helper'; import SEOConfig from '@/shared/components/SEO'; @@ -29,7 +29,7 @@ const BottonBack = { }; 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 EDUCATION_STAGE_TABLE = mapToTable(EDUCATION_STAGE); const Profile = ({ name, @@ -51,7 +51,7 @@ const Profile = ({ }) => { const router = useRouter(); const role = roleList.length > 0 && ROLELIST[roleList[0]]; - const edu = educationStage && EDUCATION_STEP_TABLE[educationStage]; + const edu = educationStage && EDUCATION_STAGE_TABLE[educationStage]; const wantTodo = wantToDoList .map((item) => WANT_TO_DO_WITH_PARTNER_TABLE[item]) .join('、'); diff --git a/constants/areas.js b/constants/areas.js index 24e08392..cb323329 100644 --- a/constants/areas.js +++ b/constants/areas.js @@ -1643,3 +1643,8 @@ export const TAIWAN_DISTRICT = [ name: '花蓮縣', }, ]; + +export const COUNTRIES = [ + { name: '國外', label: '國外' }, + { name: '台灣', label: '台灣' }, +]; diff --git a/constants/member.js b/constants/member.js index b9c68a26..6c2ca210 100644 --- a/constants/member.js +++ b/constants/member.js @@ -106,40 +106,9 @@ export const EDUCATION_STEP = [ }, ]; -export const EDUCATION_STAGE = [ - { - label: '學齡前', - value: 'preschool', - }, - { - label: '國小低年級', - value: 'elementary-junior', - }, - { - label: '國小中年級', - value: 'elementary-middle', - }, - { - label: '國小高年級', - value: 'elementary-senior', - }, - { - label: '國中', - value: 'junior-high', - }, - { - label: '高中', - value: 'high', - }, - { - label: '大學', - value: 'university', - }, - { - label: '大學以上', - value: 'other', - }, -]; +export const EDUCATION_STAGE = EDUCATION_STEP.filter( + (step) => step.key !== 'master' && step.key !== 'doctor', +); export const WANT_TO_DO_WITH_PARTNER = [ {