Skip to content

Commit

Permalink
hotfix:fix prettier rule & update profile description
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentxuu committed Nov 11, 2024
1 parent 32c5b60 commit 9d1f760
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
23 changes: 12 additions & 11 deletions components/Profile/Edit/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
import { MobileDatePicker } from '@mui/x-date-pickers/MobileDatePicker';
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider';
import { AdapterDayjs } from '@mui/x-date-pickers/AdapterDayjs';
import Fields from '@/components/Group/Form/Fields';
import ErrorMessage from './ErrorMessage';

import TheAvator from './TheAvator';
Expand All @@ -48,7 +49,6 @@ import {
StyledButtonGroup,
StyledButton,
} from './Edit.styled';
import Fields from '@/components/Group/Form/Fields';

function EditPage() {
const mobileScreen = useMediaQuery('(max-width: 767px)');
Expand Down Expand Up @@ -146,9 +146,9 @@ function EditPage() {
sx={{
border:
errors.name ||
errors.birthDay ||
errors.gender ||
errors.roleList
errors.birthDay ||
errors.gender ||
errors.roleList
? '1px solid red'
: '',
}}
Expand Down Expand Up @@ -356,12 +356,12 @@ function EditPage() {
>
<StyledGroup mt="0">
<Typography sx={{ fontWeight: 700, fontSize: '18px' }}>
聯絡方式
聯絡方式 *
</Typography>
<Typography
sx={{ color: '#92989A', fontWeight: 400, fontSize: '14px' }}
>
聯絡資訊會呈現在你的公開頁面上,讓夥伴能聯繫你
聯絡資訊會呈現在你的公開頁面上,讓夥伴能聯繫你,至少填寫一個社交媒體帳號
</Typography>
</StyledGroup>
<Grid container columnSpacing={1}>
Expand All @@ -383,8 +383,8 @@ function EditPage() {
errors[key]
? errors[key]
: errors.socialCode
? '請填寫您的 ID'
: ''
? '請填寫您的 ID'
: ''
}
/>
</Grid>
Expand All @@ -408,7 +408,7 @@ function EditPage() {
sx={{ fontWeight: 500 }}
ref={(element) => setRef('wantToDoList', element)}
>
想和夥伴一起
想和夥伴一起 *
</Typography>
<StyledSelectWrapper>
{WANT_TO_DO_WITH_PARTNER.map(({ label, value }) => (
Expand Down Expand Up @@ -458,7 +458,8 @@ function EditPage() {
value={userState.tagList}
control={{
setRef: (name, element) => setRef(name, element),
onChange: ({ target }) => onChangeHandler({ key: target.name, value: target.value })
onChange: ({ target }) =>
onChangeHandler({ key: target.name, value: target.value }),
}}
/>
<Typography
Expand All @@ -476,7 +477,7 @@ function EditPage() {

<StyledGroup>
<Typography sx={{ fontWeight: 500, mb: '6px' }}>
個人簡介
個人簡介 *
</Typography>
<TextareaAutosize
ref={(element) => setRef('selfIntroduction', element)}
Expand Down
12 changes: 6 additions & 6 deletions components/Signin/useValidation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const initialState = {
birthDay: dayjs(),
gender: '',
roleList: [],
isSubscribeEmail: false,
isSubscribeEmail: true,
};

const userReducer = (state, payload) => {
Expand All @@ -49,12 +49,12 @@ const useProfileValidation = () => {

const validateResult = !validateAll
? schema
.partial({ [key]: true })
.safeParse({ [key]: key === 'birthDay' ? val?.$d : val })
.partial({ [key]: true })
.safeParse({ [key]: key === 'birthDay' ? val?.$d : val })
: schema.safeParse({
...fields,
birthDay: fields.birthDay?.$d,
});
...fields,
birthDay: fields.birthDay?.$d,
});

if (!validateResult.success) {
validateResult.error.issues.forEach((issue) => {
Expand Down

0 comments on commit 9d1f760

Please sign in to comment.